3 #include <score/tools/std/HashMap.hpp>
7 template <
typename T1,
typename T2>
8 using enable_if_base_of = std::enable_if<std::is_base_of<T1, T2>::value,
void*>;
26 void insert(std::vector<Action> vals);
28 auto& get() {
return m_container; }
29 auto& get()
const {
return m_container; }
43 void onDocumentChange(std::shared_ptr<ActionCondition> cond);
44 void onFocusChange(std::shared_ptr<ActionCondition> cond);
45 void onSelectionChange(std::shared_ptr<ActionCondition> cond);
46 void onCustomChange(std::shared_ptr<ActionCondition> cond);
48 const auto& documentConditions()
const {
return m_docConditions; }
49 const auto& focusConditions()
const {
return m_focusConditions; }
50 const auto& selectionConditions()
const {
return m_selectionConditions; }
51 const auto& customConditions()
const {
return m_customConditions; }
53 template <
typename Condition_T>
54 requires(std::is_base_of_v<DocumentActionCondition, Condition_T>)
55 auto& condition()
const
57 return *m_docConditions.at(Condition_T::static_key());
59 template <
typename Condition_T>
60 requires(std::is_base_of_v<FocusActionCondition, Condition_T>)
61 auto& condition()
const
63 return *m_focusConditions.at(Condition_T::static_key());
65 template <
typename Condition_T>
66 requires(std::is_base_of_v<SelectionActionCondition, Condition_T>)
67 auto& condition()
const
69 return *m_selectionConditions.at(Condition_T::static_key());
71 template <
typename Condition_T>
72 requires(std::is_base_of_v<CustomActionCondition, Condition_T>)
73 auto& condition()
const
75 return *m_customConditions.at(Condition_T::static_key());
78 template <
typename Condition_T>
80 !std::is_base_of_v<DocumentActionCondition, Condition_T>
81 && !std::is_base_of_v<FocusActionCondition, Condition_T>
82 && !std::is_base_of_v<SelectionActionCondition, Condition_T>
83 && !std::is_base_of_v<CustomActionCondition, Condition_T>
84 && std::is_base_of_v<ActionCondition, Condition_T>)
85 auto& condition()
const
87 return *m_conditions.at(Condition_T::static_key());
96 score::hash_map<ActionKey, Action> m_container;
99 score::hash_map<StringKey<ActionCondition>, std::shared_ptr<ActionCondition>>
101 score::hash_map<StringKey<ActionCondition>, std::shared_ptr<ActionCondition>>
103 score::hash_map<StringKey<ActionCondition>, std::shared_ptr<ActionCondition>>
104 m_selectionConditions;
105 score::hash_map<StringKey<ActionCondition>, std::shared_ptr<ActionCondition>>
107 score::hash_map<StringKey<ActionCondition>, std::shared_ptr<ActionCondition>>
110 QMetaObject::Connection focusConnection;
111 QMetaObject::Connection selectionConnection;
The Action class.
Definition: Action.hpp:79
The ActionManager class.
Definition: ActionManager.hpp:19
The Document class is the central part of the software.
Definition: Document.hpp:51
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18