State.h
 1  #pragma once
 2  #include <keyboardmanager/common/MappingConfiguration.h>
 3  
 4  class State : public MappingConfiguration
 5  {
 6  private:
 7      // Stores the activated target application in app-specific shortcut
 8      std::wstring activatedAppSpecificShortcutTarget;
 9  
10  public:
11      // Function to get the iterator of a single key remap given the source key. Returns nullopt if it isn't remapped
12      std::optional<SingleKeyRemapTable::iterator> GetSingleKeyRemap(const DWORD& originalKey);
13  
14      // Function to get a unicode string remap given the source key. Returns nullopt if it isn't remapped
15      std::optional<std::wstring> GetSingleKeyToTextRemapEvent(const DWORD originalKey) const;
16  
17      bool CheckShortcutRemapInvoked(const std::optional<std::wstring>& appName);
18  
19      // Function to get the source and target of a shortcut remap given the source shortcut. Returns nullopt if it isn't remapped
20      ShortcutRemapTable& GetShortcutRemapTable(const std::optional<std::wstring>& appName);
21  
22      std::vector<Shortcut>& GetSortedShortcutRemapVector(const std::optional<std::wstring>& appName);
23  
24      // Sets the activated target application in app-specific shortcut
25      void SetActivatedApp(const std::wstring& appName);
26  
27      // Gets the activated target application in app-specific shortcut
28      std::wstring GetActivatedApp();
29  };