1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
27 //===========================================================================
28 //#####DESCRIPTIONBEGIN####
31 // Contact(s): julians
33 // Version: $Id: appsettings.h,v 1.12 2001/12/14 17:34:03 julians Exp $
35 // Description: Header file for the ConfigTool application settings
42 //####DESCRIPTIONEND####
44 //===========================================================================
46 #ifndef _ECOS_APPSETTINGS_H_
47 #define _ECOS_APPSETTINGS_H_
49 #include "wx/config.h"
55 #include "wx/msw/winundef.h"
59 #define ecSHOW_STATUS_NORMAL 0x01
60 #define ecSHOW_STATUS_MINIMIZED 0x02
61 #define ecSHOW_STATUS_MAXIMIZED 0x03
63 // What kind of browser (wxHtmlHelpController, default browser, custom browser)
64 enum ecBrowserType { ecInternal, ecAssociatedExternal, ecCustomExternal };
68 * Settings relating to running tests
70 enum ResetType {RESET_NONE, RESET_X10, RESET_MANUAL};
71 enum TimeoutType {TIMEOUT_NONE,TIMEOUT_SPECIFIED, TIMEOUT_AUTOMATIC};
73 class ecRunTestsSettings: public wxObject
75 DECLARE_DYNAMIC_CLASS(ecRunTestsSettings)
78 ecRunTestsSettings(const ecRunTestsSettings& settings);
81 void Copy(const ecRunTestsSettings& settings);
83 bool SaveConfig(wxConfig& config);
84 bool LoadConfig(wxConfig& config);
87 CeCosTest::ExecutionParameters m_ep;
89 int m_nDownloadTimeout;
91 int m_nDownloadTimeoutType;
95 int m_nLocalTCPIPPort;
100 wxString m_strPort; // Serial port
101 wxString m_strTarget;
103 wxString m_strRemoteHost;
104 wxString m_strResourceHost;
105 wxString m_strLocalTCPIPHost;
111 * Various application settings
114 class ecSettings: public wxObject
116 DECLARE_DYNAMIC_CLASS(ecSettings)
119 ecSettings(const ecSettings& settings);
123 // Copy from settings to 'this'
124 void Copy(const ecSettings& settings);
132 // Load and save font descriptions
133 bool LoadFont(wxConfig& config, const wxString& windowName, wxFont& font);
134 bool SaveFont(wxConfig& config, const wxString& windowName, const wxFont& font);
135 bool LoadFonts(wxConfig& config);
136 bool SaveFonts(wxConfig& config);
137 bool ApplyFontsToWindows();
139 // Do some initialisation within ecApp::OnInit
142 // Show settings dialog
143 void ShowSettingsDialog(const wxString& page = wxEmptyString);
145 // Create new filename
146 wxString GenerateFilename(const wxString& rootName);
148 // Go looking for potential candidates in SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
149 int GetRepositoryRegistryClues(wxArrayString& arstr, const wxString& pszPrefix);
151 // Finds the path of the latest installed eCos (Unix only)
152 wxString FindLatestVersion();
154 // Find the subkey of the latest installed eCos, e.g. "1.4.9"
155 wxString GetInstallVersionKey ();
159 wxString GetAppName() const { return m_appName; }
161 // Get a name suitable for the configuration file on all platforms:
162 // e.g. eCos Configuration Tool on Windows, .eCosConfigTool on Unix
163 wxString GetConfigAppName() const ;
165 wxString& GetLastFilename() { return m_lastFilename; }
167 const ecFileName& DefaultExternalBrowser() ;
169 const wxString& GetUserToolsDir() const { return m_userToolsDir; }
170 const wxString& GetBuildToolsDir() const { return m_buildToolsDir; } /* Only used if no other clues */
172 wxStringToStringMap& GetBinDirs() { return m_arstrBinDirs; }
174 ecRunTestsSettings& GetRunTestsSettings() { return m_runTestsSettings; }
176 wxWindowSettings& GetWindowSettings() { return m_windowSettings; }
181 wxString m_appName; // The current name of the app...
182 bool m_showSplashScreen; // Show the splash screen
185 wxString m_lastFilename; // So we can auto-generate sensible filenames
189 wxSize m_treeSashSize;
190 wxSize m_conflictsSashSize;
191 wxSize m_propertiesSashSize;
192 wxSize m_shortDescrSashSize;
193 wxSize m_memorySashSize;
194 wxSize m_outputSashSize;
195 int m_configPaneWidth; // The sash to the right of the tree
196 bool m_showConflictsWindow;
197 bool m_showPropertiesWindow;
198 bool m_showShortDescrWindow;
199 bool m_showMemoryWindow;
200 bool m_showOutputWindow;
202 // Are we showing macro names, or ordinary names?
203 bool m_showMacroNames ;
205 // Are we merely editing the .ecc file and not saving build trees?
206 // This option is specified on the command line and not saved.
207 bool m_editSaveFileOnly;
209 // Viewers & browsers
210 bool m_bUseCustomViewer;
211 bool m_bUseExternalBrowser;
212 wxString m_strBrowser;
213 ecFileName m_strViewer;
214 ecBrowserType m_eUseCustomBrowser;
215 static ecFileName m_strDefaultExternalBrowser;
218 ecFileName m_userToolsDir;
219 ecFileName m_buildToolsDir; /* Only used if no other clues */
221 wxString m_strMakeOptions;
223 wxStringToStringMap m_arstrBinDirs; // Not saved
224 wxArrayString m_userToolPaths; // Not saved
226 ecFileName m_strRepository; // This is saved/loaded via ecSettings, and
227 // copied to/from ecConfigToolDoc on doc creation/deletion.
228 // This is because the doc doesn't have its own profile loading/saving.
230 enum {Never=0, Immediate=1, Deferred=2, SuggestFixes=4};
231 int m_nRuleChecking; // OR of above values
233 // Find dialog settings
235 bool m_findMatchWholeWord;
236 bool m_findMatchCase;
237 bool m_findDirection; // Down is TRUE, Up is FALSE
238 wxString m_findSearchWhat; // Macro names, item names etc.
239 wxPoint m_findDialogPos; // Position of dialog
241 // Run tests settings
242 ecRunTestsSettings m_runTestsSettings;
245 wxWindowSettings m_windowSettings;
247 // Packages dialog settings
248 bool m_omitHardwarePackages;
249 bool m_matchPackageNamesExactly;
253 // _ECOS_APPSETTINGS_H_