Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 97 lines (84 sloc) 3.771 kB
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23
24 /**
25 * The registry maintains a database of persistent settings for an application.
26 * The settings database is organized in two groups of three layers each. The
27 * system-wide settings group contains settings information pertaining to all
28 * users on a system. The per-user settings group contains settings affecting
29 * that user only.
30 * Each settings group contains a desktop layer, which comprises the settings
31 * which affect all FOX programs, a vendor layer which holds settings that
32 * affect all applications from that vendor (e.g. a application-suite), and
33 * an application layer which holds settings only for a single application.
34 * The vendor-key and application-key determine which files these layers come
35 * from, while the "Desktop" key is used for all FOX applications.
36 * Settings in the system-wide group are overwritten by the per-user group,
37 * and settings from the "Desktop" layer are overwritten by the vendor-layer;
38 * vendor-layer settings are overwritten by the application-layer settings.
39 * Only the per-user, per-application settings ever gets written; the layers
40 * in the system-group only get written during installation and configuration
41 * of the application.
42 * The registry is read when FXApp::init() is called, and written back to the
43 * system when FXApp::exit() is called.
44 */
45 class FXRegistry : public FXSettings {
46 protected:
47 FXString applicationkey; // Application key
48 FXString vendorkey; // Vendor key
49 bool ascii; // ASCII file-based registry
50 protected:
51 bool readFromDir(const FXchar* dirname,FXbool mark);
52 #ifdef WIN32
53 bool readFromRegistry(void* hRootKey,FXbool mark);
54 bool writeToRegistry(void* hRootKey);
55 bool readFromRegistryGroup(void* org,const char* groupname,FXbool mark=FALSE);
56 bool writeToRegistryGroup(void* org,const char* groupname);
57 #endif
58 public:
bea4cad @larskanis Strip all whitespaces on line endings
authored
59
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
60 /**
61 * Construct registry object; akey and vkey must be string constants.
62 * Regular applications SHOULD set a vendor key!
63 */
64 %extend {
65 FXRegistry(const FXString& akey=FXString::null,const FXString& vkey=FXString::null){
66 return new FXRbRegistry(akey,vkey);
67 }
68 }
69
70 /// Read registry
71 bool read();
bea4cad @larskanis Strip all whitespaces on line endings
authored
72
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
73 /// Write registry
74 bool write();
75
bea4cad @larskanis Strip all whitespaces on line endings
authored
76 /// Return application key
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
77 const FXString& getAppKey() const;
78
79 /// Return vendor key
80 const FXString& getVendorKey() const;
81
82 /**
83 * Set ASCII mode; under MS-Windows, this will switch the system to a
84 * file-based registry system, instead of using the System Registry API.
85 */
86 void setAsciiMode(bool asciiMode);
87
88 /// Get ASCII mode
89 bool getAsciiMode() const;
90
91 /// Destructor
92 virtual ~FXRegistry();
93 };
94
95 DECLARE_FXOBJECT_VIRTUALS(FXRegistry)
96
Something went wrong with that request. Please try again.