1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
5 // Copyright (C) 2003 John Dallaway
7 // This program is part of the eCos host tools.
9 // This program is free software; you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License as published by the Free
11 // Software Foundation; either version 2 of the License, or (at your option)
14 // This program is distributed in the hope that it will be useful, but WITHOUT
15 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 // You should have received a copy of the GNU General Public License along with
20 // this program; if not, write to the Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // ----------------------------------------------------------------------------
25 //####COPYRIGHTEND####
28 //===========================================================================
29 //#####DESCRIPTIONBEGIN####
31 // Author(s): julians, jld
32 // Contact(s): julians
36 // Description: Header file for the ConfigTool application settings
43 //####DESCRIPTIONEND####
45 //===========================================================================
47 #ifndef _ECOS_APPSETTINGS_H_
48 #define _ECOS_APPSETTINGS_H_
50 #include "wx/config.h"
56 #include "wx/msw/winundef.h"
60 #define ecSHOW_STATUS_NORMAL 0x01
61 #define ecSHOW_STATUS_MINIMIZED 0x02
62 #define ecSHOW_STATUS_MAXIMIZED 0x03
64 // What kind of browser (wxHtmlHelpController, default browser, custom browser)
65 enum ecBrowserType { ecInternal, ecAssociatedExternal, ecCustomExternal };
69 * Settings relating to running tests
71 enum ResetType {RESET_NONE, RESET_X10, RESET_MANUAL};
72 enum TimeoutType {TIMEOUT_NONE,TIMEOUT_SPECIFIED, TIMEOUT_AUTOMATIC};
74 class ecRunTestsSettings: public wxObject
76 DECLARE_DYNAMIC_CLASS(ecRunTestsSettings)
79 ecRunTestsSettings(const ecRunTestsSettings& settings);
82 void Copy(const ecRunTestsSettings& settings);
84 bool SaveConfig(wxConfig& config);
85 bool LoadConfig(wxConfig& config);
88 CeCosTest::ExecutionParameters m_ep;
90 int m_nDownloadTimeout;
92 int m_nDownloadTimeoutType;
96 int m_nLocalTCPIPPort;
101 wxString m_strPort; // Serial port
102 wxString m_strTarget;
104 wxString m_strRemoteHost;
105 wxString m_strResourceHost;
106 wxString m_strLocalTCPIPHost;
112 * Various application settings
115 class ecSettings: public wxObject
117 DECLARE_DYNAMIC_CLASS(ecSettings)
120 ecSettings(const ecSettings& settings);
124 // Copy from settings to 'this'
125 void Copy(const ecSettings& settings);
133 // Load and save font descriptions
134 bool LoadFont(wxConfig& config, const wxString& windowName, wxFont& font);
135 bool SaveFont(wxConfig& config, const wxString& windowName, const wxFont& font);
136 bool LoadFonts(wxConfig& config);
137 bool SaveFonts(wxConfig& config);
138 bool ApplyFontsToWindows();
140 // Do some initialisation within ecApp::OnInit
143 // Show settings dialog
144 void ShowSettingsDialog(const wxString& page = wxEmptyString);
146 // Create new filename
147 wxString GenerateFilename(const wxString& rootName);
149 // Go looking for potential candidates in SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
150 int GetRepositoryRegistryClues(wxArrayString& arstr, const wxString& pszPrefix);
152 // Finds the path of the latest installed eCos (Unix only)
153 wxString FindLatestVersion();
155 // Find the subkey of the latest installed eCos, e.g. "1.4.9"
156 wxString GetInstallVersionKey ();
159 // Find the location of the Cygwin installation
160 wxString GetCygwinInstallPath ();
165 wxString GetAppName() const { return m_appName; }
167 // Get a name suitable for the configuration file on all platforms:
168 // e.g. eCos Configuration Tool on Windows, .eCosConfigTool on Unix
169 wxString GetConfigAppName() const ;
171 wxString& GetLastFilename() { return m_lastFilename; }
173 const ecFileName& DefaultExternalBrowser() ;
175 const wxString& GetUserToolsDir() const { return m_userToolsDir; }
176 const wxString& GetBuildToolsDir() const { return m_buildToolsDir; } /* Only used if no other clues */
178 wxStringToStringMap& GetBinDirs() { return m_arstrBinDirs; }
180 ecRunTestsSettings& GetRunTestsSettings() { return m_runTestsSettings; }
182 wxWindowSettings& GetWindowSettings() { return m_windowSettings; }
187 wxString m_appName; // The current name of the app...
188 bool m_showSplashScreen; // Show the splash screen
191 wxString m_lastFilename; // So we can auto-generate sensible filenames
195 wxSize m_treeSashSize;
196 wxSize m_conflictsSashSize;
197 wxSize m_propertiesSashSize;
198 wxSize m_shortDescrSashSize;
199 wxSize m_memorySashSize;
200 wxSize m_outputSashSize;
201 int m_configPaneWidth; // The sash to the right of the tree
202 bool m_showConflictsWindow;
203 bool m_showPropertiesWindow;
204 bool m_showShortDescrWindow;
205 bool m_showMemoryWindow;
206 bool m_showOutputWindow;
208 // Are we showing macro names, or ordinary names?
209 bool m_showMacroNames ;
211 // Are we merely editing the .ecc file and not saving build trees?
212 // This option is specified on the command line and not saved.
213 bool m_editSaveFileOnly;
215 // Viewers & browsers
216 bool m_bUseCustomViewer;
217 bool m_bUseExternalBrowser;
218 wxString m_strBrowser;
219 ecFileName m_strViewer;
220 ecBrowserType m_eUseCustomBrowser;
221 static ecFileName m_strDefaultExternalBrowser;
224 ecFileName m_userToolsDir;
225 ecFileName m_buildToolsDir; /* Only used if no other clues */
227 wxString m_strMakeOptions;
229 wxStringToStringMap m_arstrBinDirs; // Not saved
230 wxArrayString m_userToolPaths; // Not saved
232 ecFileName m_strRepository; // This is saved/loaded via ecSettings, and
233 // copied to/from ecConfigToolDoc on doc creation/deletion.
234 // This is because the doc doesn't have its own profile loading/saving.
236 enum {Never=0, Immediate=1, Deferred=2, SuggestFixes=4};
237 int m_nRuleChecking; // OR of above values
239 // Find dialog settings
241 bool m_findMatchWholeWord;
242 bool m_findMatchCase;
243 bool m_findDirection; // Down is TRUE, Up is FALSE
244 wxString m_findSearchWhat; // Macro names, item names etc.
245 wxPoint m_findDialogPos; // Position of dialog
247 // Run tests settings
248 ecRunTestsSettings m_runTestsSettings;
251 wxWindowSettings m_windowSettings;
253 // Packages dialog settings
254 bool m_omitHardwarePackages;
255 bool m_matchPackageNamesExactly;
259 // _ECOS_APPSETTINGS_H_