dtinfo subtree dtinfo
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Managers / PrefMgr.hh
1 /*      Copyright (c) 1994 FUJITSU LIMITED      */
2 /*      All Rights Reserved                     */
3
4 /*
5  * $XConsortium: PrefMgr.hh /main/3 1996/06/11 16:27:17 cde-hal $
6  *
7  * Copyright (c) 1992 HAL Computer Systems International, Ltd.
8  * All rights reserved.  Unpublished -- rights reserved under
9  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
10  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
11  * OR DISCLOSURE.
12  * 
13  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
14  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
15  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
16  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
17  * INTERNATIONAL, LTD.
18  * 
19  *                         RESTRICTED RIGHTS LEGEND
20  * Use, duplication, or disclosure by the Government is subject
21  * to the restrictions as set forth in subparagraph (c)(l)(ii)
22  * of the Rights in Technical Data and Computer Software clause
23  * at DFARS 252.227-7013.
24  *
25  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
26  *                  1315 Dell Avenue
27  *                  Campbell, CA  95008
28  * 
29  */
30
31 class PrefAgent;
32 class IntegerPref;
33 class BooleanPref;
34 class WindowGeometryPref;
35 class WindowGeometry;
36 class UserPreference;
37
38 typedef char *PrefSymbol;
39
40 class PrefMgr : public Long_Lived
41 {
42 public:
43   static PrefSymbol BrowseGeometry;
44   static PrefSymbol FontScale;
45   static PrefSymbol BrowseLock;
46   static PrefSymbol MapGeometry;
47   static PrefSymbol MapAutoUpdate;
48   static PrefSymbol NodeHistSize;
49   static PrefSymbol SearchHistSize;
50   static PrefSymbol MaxSearchHits;
51   static PrefSymbol DefaultMarkBase;
52   static PrefSymbol DisplayFirstHit;
53   static PrefSymbol AutomaticHelp;
54 #ifdef UseWideChars
55   // Preferences for Japanese hyphenation - 4/6/94 kamiya
56   static PrefSymbol HyphenMethod;
57   static PrefSymbol HyphenLevel;
58 #endif
59
60   enum { INT_CHANGED = FolioObject::_LAST, BOOLEAN_CHANGED,
61          STRING_CHANGED, GEOMETRY_CHANGED };
62
63   PrefMgr();
64   ~PrefMgr();
65
66   void display();
67   void sync();
68
69   int get_int (const PrefSymbol sym);
70   void set_int (const PrefSymbol sym, int value);
71
72   bool get_boolean (const PrefSymbol sym);
73   void set_boolean (const PrefSymbol sym, bool value);
74
75   const char *get_string (const PrefSymbol sym);
76   void set_string (const PrefSymbol sym, const char *value);
77
78   const WindowGeometry &get_geometry (const PrefSymbol sym);
79   void set_geometry (const PrefSymbol sym, const WindowGeometry &value);
80
81 private:
82   PrefAgent            *f_pref_agent;
83
84   PrefSymbol f_last_symbol;
85   UserPreference *f_last_preference;
86
87   LONG_LIVED_HH(PrefMgr,pref_mgr);
88 };
89
90 LONG_LIVED_HH2(PrefMgr,pref_mgr);
91
92 inline
93 PrefMgr::PrefMgr()
94 : f_pref_agent (NULL), f_last_symbol (NULL), f_last_preference (NULL)
95 {
96 }
97