| 3 | #include <memory> |
| 4 | |
| 5 | class ShortcutCommand |
| 6 | { |
| 7 | public: |
| 8 | explicit ShortcutCommand(int nCommandCount); |
| 9 | ~ShortcutCommand() = default; |
| 10 | |
| 11 | auto GetCommandID(CallBackID id) const -> int |
| 12 | { |
| 13 | return m_pFuncItem[At(id)]._cmdID; |
| 14 | } |
| 15 | auto GetFuncItem() const -> FuncItem* |
| 16 | { |
| 17 | return m_pFuncItem.get(); |
| 18 | } |
| 19 | |
| 20 | bool SetCommand(CallBackID id, const TCHAR* cmdName, const PFUNCPLUGINCMD pFunc, bool checkOnInit); |
| 21 | bool SetShortCut(CallBackID id, const ShortcutKey& scKey); |
| 22 | |
| 23 | private: |
| 24 | int At(CallBackID id) const |
| 25 | { |
| 26 | return static_cast<int>(id); |
| 27 | } |
| 28 | |
| 29 | private: |
| 30 | std::unique_ptr<FuncItem[]> m_pFuncItem = nullptr; |
| 31 | std::unique_ptr<ShortcutKey[]> m_pShortcutKeys = nullptr; |
| 32 | int m_nCmdCount = 0; |
| 33 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected