LibrePCB Developers Documentation
workspacesettingsitem_keyboardshortcuts.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_CORE_WORKSPACESETTINGSITEM_KEYBOARDSHORTCUTS_H
21 #define LIBREPCB_CORE_WORKSPACESETTINGSITEM_KEYBOARDSHORTCUTS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "workspacesettingsitem.h"
27 
28 #include <QtCore>
29 
30 /*******************************************************************************
31  * Namespace / Forward Declarations
32  ******************************************************************************/
33 namespace librepcb {
34 
35 /*******************************************************************************
36  * Class WorkspaceSettingsItem_KeyboardShortcuts
37  ******************************************************************************/
38 
44  : public WorkspaceSettingsItem {
45 public:
46  // Constructors / Destructor
49  const WorkspaceSettingsItem_KeyboardShortcuts& other) = delete;
51  QObject* parent = nullptr) noexcept;
53 
54  // Getters
55  const QMap<QString, QList<QKeySequence>>& get() const noexcept {
56  return mOverrides;
57  }
58 
59  // Setters
60  void set(const QMap<QString, QList<QKeySequence>>& overrides) noexcept;
61 
62  // Operator Overloadings
64  const WorkspaceSettingsItem_KeyboardShortcuts& rhs) = delete;
65 
66 private: // Methods
70  virtual void restoreDefaultImpl() noexcept override;
71 
75  void loadImpl(const SExpression& root) override;
76 
80  void serializeImpl(SExpression& root) const override;
81 
82 private:
83  QMap<QString, SExpression> mNodes;
84  QMap<QString, QList<QKeySequence>> mOverrides;
85 };
86 
87 /*******************************************************************************
88  * End of File
89  ******************************************************************************/
90 
91 } // namespace librepcb
92 
93 #endif
virtual void restoreDefaultImpl() noexcept override
Restore default value.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:88
Definition: occmodel.cpp:77
QMap< QString, SExpression > mNodes
Definition: workspacesettingsitem_keyboardshortcuts.h:83
~WorkspaceSettingsItem_KeyboardShortcuts() noexcept
Definition: workspacesettingsitem_keyboardshortcuts.cpp:44
void serializeImpl(SExpression &root) const override
Serialize the value into S-Expression node.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:120
QMap< QString, QList< QKeySequence > > mOverrides
Definition: workspacesettingsitem_keyboardshortcuts.h:84
void loadImpl(const SExpression &root) override
Load value from S-Expression node.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:96
WorkspaceSettingsItem_KeyboardShortcuts & operator=(const WorkspaceSettingsItem_KeyboardShortcuts &rhs)=delete
Base class for all workspace settings items.
Definition: workspacesettingsitem.h:49
Implementation of librepcb::WorkspaceSettingsItem to store keyboard shortcuts settings.
Definition: workspacesettingsitem_keyboardshortcuts.h:43
The SExpression class.
Definition: sexpression.h:69