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