]>
Commit | Line | Data |
---|---|---|
d7463f75 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: appsettings.h | |
3 | // Purpose: Settings-related classes | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 2002-09-04 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _AP_APPSETTINGS_H_ | |
13 | #define _AP_APPSETTINGS_H_ | |
14 | ||
d7463f75 JS |
15 | #include "wx/notebook.h" |
16 | #include "wx/dialog.h" | |
17 | #include "wx/datetime.h" | |
d7463f75 JS |
18 | |
19 | #include "wxconfigtool.h" | |
20 | ||
21 | // Frame status | |
22 | #define ctSHOW_STATUS_NORMAL 0x01 | |
23 | #define ctSHOW_STATUS_MINIMIZED 0x02 | |
24 | #define ctSHOW_STATUS_MAXIMIZED 0x03 | |
25 | ||
26 | /*! | |
27 | * \brief ctSettings holds all the settings that can be altered | |
28 | * by the user (and probably some that can't). | |
29 | */ | |
30 | ||
31 | class ctSettings: public wxObject | |
32 | { | |
33 | DECLARE_DYNAMIC_CLASS(ctSettings) | |
34 | public: | |
35 | /// Default constructor. | |
36 | ctSettings(); | |
37 | ||
38 | /// Copy constructor. | |
39 | ctSettings(const ctSettings& settings); | |
40 | ||
41 | /// Destructor. | |
254a2129 | 42 | ~ctSettings(){}; |
d7463f75 JS |
43 | |
44 | // Operations | |
45 | ||
46 | /// Assignment operator. | |
47 | void operator = (const ctSettings& settings); | |
48 | ||
49 | /// Copy function. | |
50 | void Copy (const ctSettings& settings); | |
51 | ||
52 | /// Loads configuration information from the registry or a file. | |
53 | bool LoadConfig(); | |
54 | ||
55 | /// Saves configuration information to the registry or a file. | |
56 | bool SaveConfig(); | |
57 | ||
58 | /// Initialisation before LoadConfig is called. | |
59 | bool Init(); | |
60 | ||
61 | /// Shows the settings dialog. | |
62 | void ShowSettingsDialog(const wxString& page = wxEmptyString); | |
63 | ||
64 | /// Generates a new document filename. | |
65 | wxString GenerateFilename(const wxString& rootName); | |
66 | ||
67 | // Accessors | |
68 | ||
69 | /// Returns the long application name. This name is used | |
70 | /// for the registry key and main frame titlebar. | |
71 | wxString GetAppName() const { return m_appName; } | |
72 | ||
73 | /// Returns the short application name. | |
74 | wxString GetShortAppName() const { return m_appNameShort; } | |
75 | ||
76 | /// Gets the name of the last filename to be loaded. | |
77 | /// May not be needed in this application. | |
78 | wxString& GetLastFilename() { return m_lastFilename; } | |
79 | ||
4fe30bce | 80 | /// Returns true if this is the first time the application |
d7463f75 JS |
81 | /// has been run. |
82 | bool GetFirstTimeRun() const { return m_firstTimeRun; } | |
83 | ||
84 | public: | |
afc51590 | 85 | wxString m_lastSetupSaveDir; // Not yet used |
d7463f75 JS |
86 | wxString m_lastDocument; // Last document |
87 | bool m_showToolBar; | |
88 | bool m_smallToolbar; | |
89 | wxRect m_frameSize; | |
90 | // wxColour m_backgroundColour; // background colour | |
91 | wxFont m_editWindowFont; | |
92 | int m_noUses; // Number of times the app was invoked | |
93 | ||
94 | wxString m_appName; // The current name of the app... | |
95 | wxString m_appNameShort; // The short name of the app... | |
96 | bool m_showSplashScreen; // Show the splash screen | |
97 | wxString m_userName; | |
98 | wxString m_lastFilename; // So we can auto-generate sensible filenames | |
99 | bool m_loadLastDocument; | |
100 | bool m_useToolTips; // Use tooltips on dialogs | |
101 | int m_frameStatus; | |
102 | wxString m_exportDir; // Where files are exported to | |
103 | ||
104 | wxString m_frameworkDir; // Where the wxWin hierarchy is | |
105 | bool m_useEnvironmentVariable; // Use WXWIN | |
106 | ||
107 | /// This isn't explicitly held in the registry | |
108 | /// but deduced from whether there are values there | |
109 | bool m_firstTimeRun; | |
110 | bool m_showWelcomeDialog; // Show opening helpful dialog | |
111 | ||
112 | int m_mainSashSize; | |
113 | bool m_showTrayIcon; | |
114 | bool m_trayIconIsShown; | |
e7767867 | 115 | |
afc51590 JS |
116 | // "Setup file" or "Configure script" |
117 | wxString m_defaultFileKind; | |
118 | ||
e7767867 JS |
119 | // Search settings |
120 | bool m_matchCase; | |
121 | bool m_matchWholeWord; | |
d7463f75 JS |
122 | }; |
123 | ||
124 | #endif | |
125 | // _AP_APPSETTINGS_H_ | |
126 |