1 /*
2 * EcmaScriptApp.cpp
3 *
4 * Copyright (C) 1999 Stephen F. White
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program (see the file "COPYING" for details); if
18 * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
19 * Cambridge, MA 02139, USA.
20 */
21
22 #include "swt.h"
23 #include "PreferencesApp.h"
24 #include "EcmaScriptApp.h"
25 #include "DuneApp.h"
26
EcmaScriptApp()27 EcmaScriptApp::EcmaScriptApp()
28 {
29 m_ecmaScriptAddAvailableFunctions = false;
30 m_ecmaScriptAddAllowedValues = false;
31 m_ecmaScriptAddAllowedComponents = false;
32 m_ecmaScriptAddExampleUsage = false;
33 m_ecmaScriptAddMathObject = false;
34 m_ecmaScriptAddBrowserObject = false;
35 }
36
EcmaScriptLoadPreferences()37 void EcmaScriptApp::EcmaScriptLoadPreferences()
38 {
39 assert(TheApp != NULL);
40 m_ecmaScriptAddAvailableFunctions = TheApp->GetBoolPreference(
41 "EcmaScriptAddAvailableFunctions", false);
42 m_ecmaScriptAddAllowedValues = TheApp->GetBoolPreference(
43 "EcmaScriptAddAllowedValues", false);
44 m_ecmaScriptAddAllowedComponents = TheApp->GetBoolPreference(
45 "EcmaScriptAddAllowedComponents", false);
46 m_ecmaScriptAddExampleUsage = TheApp->GetBoolPreference(
47 "EcmaScriptAddExampleUsage", false);
48 m_ecmaScriptAddMathObject = TheApp->GetBoolPreference(
49 "EcmaScriptAddMathObject", false);
50 m_ecmaScriptAddBrowserObject = TheApp->GetBoolPreference(
51 "EcmaScriptAddBrowserObject", false);
52 }
53
EcmaScriptSavePreferences(void)54 void EcmaScriptApp::EcmaScriptSavePreferences(void)
55 {
56 TheApp->SetBoolPreference("EcmaScriptAddAvailableFunctions",
57 m_ecmaScriptAddAvailableFunctions);
58 TheApp->SetBoolPreference("EcmaScriptAddAllowedValues",
59 m_ecmaScriptAddAllowedValues);
60 TheApp->SetBoolPreference("EcmaScriptAddAllowedComponents",
61 m_ecmaScriptAddAllowedComponents);
62 TheApp->SetBoolPreference("EcmaScriptAddExampleUsage",
63 m_ecmaScriptAddExampleUsage);
64 TheApp->SetBoolPreference("EcmaScriptAddMathObject",
65 m_ecmaScriptAddMathObject);
66 TheApp->SetBoolPreference("EcmaScriptAddBrowserObject",
67 m_ecmaScriptAddBrowserObject);
68 }
69
70