Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / common / preferences.h
1 // preferences.h - Preferences subroutines header.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book 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 Address Book 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 Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <iostream>
20 #include <wx/wx.h>
22 #ifndef PREFERENCES_H
23 #define PREFERENCES_H
25 void SavePreferences();
26 void LoadPreferences();
27    
28 class XABPrefThemes
29 {
30 private:
32 public:
33     wxArrayString       ThemeName;
34     wxArrayString       ThemeData;  
35 };
37 class XABPrefAccounts
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     XABPrefAccounts();
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 //XABPreferences 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 XABPreferences
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     // Contacts tab
97     bool UseBackgroundContactColour = false;
98     wxColour BackgroundContactColour;
100     // General things.
101     wxString Filename;
102     
103 public:
104     XABPreferences(wxString PreferencesFilename);
105     ~XABPreferences();
106     
107     XABPrefAccounts accounts;
108     XABPrefThemes themes;
109     
110     int WritePreferences();
111     int ReadPreferences();
112     
113     bool GetBoolData(wxString SettingName);
114     bool SetBoolData(wxString SettingName, bool SettingValue);
115     wxRect GetMainWindowData();
116     void SetMainWindowData(wxRect WindowData);
117     wxColour GetBackgroundContactColourData();
118     void SetBackgroundContactColourData(wxColour ColourData);
119     
120     //int AddAccount(wxString Name);
121     
122     int GetThemeCount();
123     wxString GetThemeData(wxString ThemeName);
124     
125     int ErrorFlag;
126     
127 };
129 #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