Update Turkish translation
[dasher.git] / Src / Win32 / AppSettings.h
blob6f7a7e9b8352bfd4737f1d7dd08dbb7d67314895
1 #pragma once
3 #include "../Common/AppSettingsHeader.h"
4 #include "../DasherCore/SettingsStore.h"
6 #include <memory>
7 #include <vector>
8 #include <string>
10 #include <windows.h>
12 //#include "WinCommon.h"
13 #include "WinUTF8.h"
15 // Define first int value of the first element of each type.
16 // Useful for offsetting into specific arrays,
17 // since each setting is a unique int, but all 3 arrays start at 0
18 #define FIRST_APP_BP END_OF_SPS
19 #define FIRST_APP_LP END_OF_APP_BPS
20 #define FIRST_APP_SP END_OF_APP_LPS
22 #define NUM_OF_APP_BPS (END_OF_APP_BPS - END_OF_SPS)
23 #define NUM_OF_APP_LPS (END_OF_APP_LPS - END_OF_APP_BPS)
24 #define NUM_OF_APP_SPS (END_OF_APP_SPS - END_OF_APP_LPS)
26 namespace Dasher {
27 class CDasher;
30 class CAppSettings
32 public:
33 // The constructor takes ownership of the settings_store.
34 CAppSettings(Dasher::CDasher *pDasher, HWND hWnd, Dasher::CSettingsStore* settings_store);
35 ~CAppSettings(void);
37 ///
38 /// The following all just wrap corresponding methods in CDasher,
39 /// augmented for dealing with platform-specific parameters (APP_*),
40 /// allowing the AppSettings to be used as a central point-of-access
41 /// to all the settings data necessary for the GUI.
42 ///
43 bool GetBoolParameter(int iParameter);
44 void SetBoolParameter(int iParameter, bool bValue);
45 long GetLongParameter(int iParameter);
46 void SetLongParameter(int iParameter, long iValue);
47 std::string GetStringParameter(int iParameter);
48 void SetStringParameter(int iParameter, const std::string &strValue);
49 void ResetParamater(int iParameter);
50 void GetPermittedValues(int iParameter, std::vector<std::string> &vList);
52 void SetHwnd(HWND hWnd) {
53 m_hWnd = hWnd;
57 void SetDasher(Dasher::CDasher *pDasher) {
58 m_pDasher = pDasher;
61 private:
63 Dasher::CDasher *m_pDasher;
64 HWND m_hWnd;
66 std::unique_ptr<Dasher::CSettingsStore> settings_store_;