4 #include "../Common/AppSettingsHeader.h"
8 //#include "WinCommon.h"
11 // Define first int value of the first element of each type.
12 // Useful for offsetting into specific arrays,
13 // since each setting is a unique int, but all 3 arrays start at 0
14 #define FIRST_APP_BP END_OF_SPS
15 #define FIRST_APP_LP END_OF_APP_BPS
16 #define FIRST_APP_SP END_OF_APP_LPS
18 #define NUM_OF_APP_BPS (END_OF_APP_BPS - END_OF_SPS)
19 #define NUM_OF_APP_LPS (END_OF_APP_LPS - END_OF_APP_BPS)
20 #define NUM_OF_APP_SPS (END_OF_APP_SPS - END_OF_APP_LPS)
30 CAppSettings(Dasher::CDasher
*pDasher
, HWND hWnd
);
34 /// Get a boolean parameter
36 bool GetBoolParameter(int iParameter
);
39 /// Set a boolean parameter
41 void SetBoolParameter(int iParameter
, bool bValue
);
44 /// Get a long integer parameter
46 long GetLongParameter(int iParameter
);
49 /// Set a long integer parameter
51 void SetLongParameter(int iParameter
, long iValue
);
54 /// Get a string parameter
56 std::string
GetStringParameter(int iParameter
);
59 /// Set a string parameter
61 void SetStringParameter(int iParameter
, const std::string
&strValue
);
64 /// Reset a parameter to its default value
66 void ResetParamater(int iParameter
);
69 bool LoadSetting(const std::string
& Key
, LPWINDOWPLACEMENT pwp
);
70 void SaveSetting(const std::string
& Key
, const LPWINDOWPLACEMENT pwp
);
73 void SetHwnd(HWND hWnd
) {
77 void SetDasher(Dasher::CDasher
*pDasher
) {
88 std::string humanReadable
;
96 std::string humanReadable
;
103 std::string defaultVal
;
104 std::string humanReadable
;
107 bp_info
*m_pBoolTable
;
108 lp_info
*m_pLongTable
;
109 sp_info
*m_pStringTable
;
111 Dasher::CDasher
*m_pDasher
;
114 bool LoadSetting(const std::string
& Key
, bool * Value
);
115 bool LoadSetting(const std::string
& Key
, long *Value
);
116 bool LoadSetting(const std::string
& Key
, std::string
* Value
);
117 bool LoadSettingT(const std::string
& Key
, Tstring
* Value
);
119 void SaveSetting(const std::string
& Key
, bool Value
);
120 void SaveSetting(const std::string
& Key
, long Value
);
121 void SaveSetting(const std::string
& Key
, const std::string
& Value
);
123 void SaveSettingT(const std::string
& Key
, const Tstring
& TValue
);
125 // Platform Specific helpers
127 int GetOrCreate(HKEY hKey
, LPCTSTR lpSubKey
, REGSAM samDesired
, HKEY
* lpNewKey
);
128 // CARE! Users of GetlpByte must call delete[] on *Data after use.
129 bool GetlpByte(const Tstring
& key
, BYTE
** Data
) const;