Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
bf849bf2686bb5656ce1cb70163c996ecc400e3d
[xestiacalendar/.git] / source / common / preferences.h
1 // preferences.h - Preferences subroutines header.
2 //
3 // (c) 2012-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Calendar. Originally from Xestia Address Book.
6 //
7 // Xestia Calendar is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Calendar is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Calendar. If not, see <http://www.gnu.org/licenses/>
19 #ifndef PREFERENCES_H
20 #define PREFERENCES_H
22 #include <iostream>
23 #include <wx/wx.h>
25 void SavePreferences();
26 void LoadPreferences();
27    
28 class XCALPrefThemes
29 {
30 private:
32 public:
33     wxArrayString       ThemeName;
34     wxArrayString       ThemeData;  
35 };
37 class XCALPrefAccounts
38 {
39 private:
40     wxArrayString       AccountName;
41     wxArrayString       AccountType;
42     wxArrayString       AccountAddress;
43     wxArrayInt          AccountPort;
44     wxArrayInt          AccountSSL;
45     wxArrayString       AccountUsername;
46     wxArrayString       AccountPassword;
47     wxArrayString       DirectoryPrefix;
48     wxArrayString       AccountDirectory;
49     wxArrayLong         AccountRefresh;
50     int                 AccountsCount;
51 public:
52     XCALPrefAccounts();
53   
54     int GetCount();
55     wxString GetAccountName(int AccountNum);
56     wxString GetAccountType(int AccountNum);
57     wxString GetAccountAddress(int AccountNum);
58     int GetAccountPort(int AcconutNum);
59     bool GetAccountSSL(int AccountNum);
60     wxString GetAccountUsername(int AccountNum);
61     wxString GetAccountPassword(int AccountNum);
62     wxString GetAccountDirectory(int AccountNum);
63     wxString GetAccountDirPrefix(int AccountNum);
64     long GetAccountRefresh(int AccountNum);
65     int AddAccount(wxString NewAccName,
66         wxString NewAccType,
67         wxString NewAccAddress,
68         int NewAccPort,
69         int NewAccSSL,
70         wxString NewAccUser,
71         wxString NewAccPass,
72         wxString NewAccDirPrefix,
73         wxString NewAccDir,
74         long NewAccRefresh
75     );
76 };
78 //XCALPreferences should emulate what is in the Preferences window.
79 //Including others which aren't in the window such as main window
80 //position and size.
82 class XCALPreferences
83 {
84 private:
85     
86     // General Tab
87     bool SaveWindowPos = FALSE;
88     wxRect MainWindowData;
89     bool HideLocalABs = FALSE;
90     
91     // Themes tab
92     bool EnableThemes = FALSE;
93     
94     // Accounts tab
95     
96     // General things.
97     wxString Filename;
98     
99 public:
100     XCALPreferences(wxString PreferencesFilename);
101     ~XCALPreferences();
102     
103     XCALPrefAccounts accounts;
104     XCALPrefThemes themes;
105     
106     int WritePreferences();
107     int ReadPreferences();
108     
109     bool GetBoolData(wxString SettingName);
110     bool SetBoolData(wxString SettingName, bool SettingValue);
111     wxRect GetMainWindowData();
112     void SetMainWindowData(wxRect WindowData);
113     
114     //int AddAccount(wxString Name);
115     
116     int GetThemeCount();
117     wxString GetThemeData(wxString ThemeName);
118     
119     int ErrorFlag;
120     
121 };
123 #endif
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy