libyui  2.42.5
 All Classes Functions Variables Enumerations Friends
YSettings.h
1 /*
2  Copyright (c) 2012 Björn Esser
3 
4  Permission is hereby granted, free of charge, to any person obtaining
5  a copy of this software and associated documentation files (the
6  "Software"), to deal in the Software without restriction, including
7  without limitation the rights to use, copy, modify, merge, publish,
8  distribute, sublicense, and/or sell
9  copies of the Software, and to permit persons to whom the Software is
10  furnished to do so, subject to the following conditions:
11 
12  The above copyright notice and this permission notice shall be
13  included in all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
18  SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19  DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
21  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23 
24 
25 /*-/
26 
27  File: YSettings.h
28 
29  Author: Björn Esser <bjoern.esser@gmail.com>
30 
31 /-*/
32 
33 #ifndef YSettings_h
34 #define YSettings_h
35 
36 #include <string>
37 
38 /**
39  * Settings for libyui
40  *
41  * This singleton-object hold some presets for libyui.
42  **/
43 class YSettings
44 {
45 public:
46  /**
47  * This can be used to set a subdir beneath PLUGINDIR or THEMEDIR,
48  * where your program stores a custom plugin or theme.
49  *
50  * Once this is set, it can't be altered. If you do so although an
51  * exception will be thrown.
52  **/
53  static void setProgSubDir ( std::string directory );
54  /**
55  * Returns the value of your program's subdir.
56  **/
57  static std::string getProgSubDir ();
58 
59  /**
60  * This can be used to set a subdir ICONDIR,
61  * where your program stores a custom icons.
62  *
63  * Once this is set, it can't be altered. If you do so although an
64  * exception will be thrown.
65  **/
66  static void setIconsDir ( std::string directory );
67  /**
68  * Returns the value of your program's icons subdir.
69  **/
70  static std::string getIconsDir ();
71 
72  /**
73  * This can be used to set a subdir THEMEDIR,
74  * where your program stores a custom icons.
75  *
76  * Once this is set, it can't be altered. If you do so although an
77  * exception will be thrown.
78  **/
79  static void setThemeDir ( std::string directory );
80  /**
81  * Returns the value of your program's theme subdir.
82  **/
83  static std::string getThemeDir ();
84 
85 private:
86  static std::string progSubDir;
87  static std::string progIconDir;
88  static std::string progThemeDir;
89 
90  YSettings ();
91  YSettings ( const YSettings& );
92  ~YSettings ();
93 };
94 
95 #endif // YSettings_h