MCPcopy Create free account
hub / github.com/NPP-JSONViewer/JSON-Viewer / ShortcutCommand

Class ShortcutCommand

src/NppJsonViewer/ShortcutCommand.h:5–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <memory>
4
5class ShortcutCommand
6{
7public:
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
23private:
24 int At(CallBackID id) const
25 {
26 return static_cast<int>(id);
27 }
28
29private:
30 std::unique_ptr<FuncItem[]> m_pFuncItem = nullptr;
31 std::unique_ptr<ShortcutKey[]> m_pShortcutKeys = nullptr;
32 int m_nCmdCount = 0;
33};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected