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 ******************************************************************************/
27
28#include <QtCore>
29
30/*******************************************************************************
31 * Namespace / Forward Declarations
32 ******************************************************************************/
33namespace librepcb {
34
35/*******************************************************************************
36 * Class WorkspaceSettingsItem_KeyboardShortcuts
37 ******************************************************************************/
38
44 : public WorkspaceSettingsItem {
45public:
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
66private: // Methods
70 virtual void restoreDefaultImpl() noexcept override;
71
75 void loadImpl(const SExpression& root) override;
76
80 void serializeImpl(SExpression& root) const override;
81
82private:
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
The SExpression class.
Definition: sexpression.h:69
Implementation of librepcb::WorkspaceSettingsItem to store keyboard shortcuts settings.
Definition: workspacesettingsitem_keyboardshortcuts.h:44
WorkspaceSettingsItem_KeyboardShortcuts & operator=(const WorkspaceSettingsItem_KeyboardShortcuts &rhs)=delete
virtual void restoreDefaultImpl() noexcept override
Restore default value.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:88
void loadImpl(const SExpression &root) override
Load value from S-Expression node.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:96
QMap< QString, QList< QKeySequence > > mOverrides
Definition: workspacesettingsitem_keyboardshortcuts.h:84
QMap< QString, SExpression > mNodes
Definition: workspacesettingsitem_keyboardshortcuts.h:83
void set(const QMap< QString, QList< QKeySequence > > &overrides) noexcept
Definition: workspacesettingsitem_keyboardshortcuts.cpp:51
WorkspaceSettingsItem_KeyboardShortcuts(const WorkspaceSettingsItem_KeyboardShortcuts &other)=delete
const QMap< QString, QList< QKeySequence > > & get() const noexcept
Definition: workspacesettingsitem_keyboardshortcuts.h:55
void serializeImpl(SExpression &root) const override
Serialize the value into S-Expression node.
Definition: workspacesettingsitem_keyboardshortcuts.cpp:120
Base class for all workspace settings items.
Definition: workspacesettingsitem.h:49
Definition: occmodel.cpp:77