swift
actionhotkeylist.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_INPUT_ACTIONHOTKEYLIST_H
7 #define SWIFT_MISC_INPUT_ACTIONHOTKEYLIST_H
8 
9 #include <initializer_list>
10 #include <tuple>
11 
12 #include <QMetaType>
13 #include <QString>
14 
15 #include "misc/collection.h"
17 #include "misc/sequence.h"
18 #include "misc/swiftmiscexport.h"
19 
20 SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::input, CActionHotkey, CActionHotkeyList)
21 
22 namespace swift::misc::input
23 {
26  public CSequence<CActionHotkey>,
27  public mixin::MetaType<CActionHotkeyList>
28  {
29  public:
32 
34  CActionHotkeyList() = default;
35 
38 
41  CActionHotkeyList findSubsetsOf(const CActionHotkey &other) const;
42 
45  CActionHotkeyList findSupersetsOf(const CActionHotkey &other) const;
46 
48  CActionHotkeyList findBySameMachine(const CActionHotkey &key) const;
49 
51  bool containsAction(const QString &action) const;
52 
54  void updateToCurrentMachine();
55  };
56 } // namespace swift::misc::input
57 
58 Q_DECLARE_METATYPE(swift::misc::input::CActionHotkeyList)
60 
61 #endif // SWIFT_MISC_INPUT_ACTIONHOTKEYLIST_H
Generic ordered container with value semantics.
Definition: collection.h:107
Generic sequential container with value semantics.
Definition: sequence.h:86
CSequence()=default
Default constructor.
Value object encapsulating a action hotkey.
Definition: actionhotkey.h:25
Value object encapsulating a list of hotkeys.
CActionHotkeyList()=default
Default constructor.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Definition: mixinmetatype.h:29
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition: sequence.h:62
#define SWIFT_MISC_EXPORT
Export a class or function from the library.