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