libyui  3.0.10
 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 setProgDir ( std::string directory );
54  /**
55  * Returns the value of your program's subdir.
56  **/
57  static std::string progDir ();
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 setIconDir ( std::string directory );
67  /**
68  * Returns the value of your program's icons subdir.
69  **/
70  static std::string iconDir ();
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 themeDir ();
84 
85  /**
86  * This can be used to set a subdir LOCALEDIR,
87  * where your program stores translations
88  *
89  * Once this is set, it can't be altered. If you do so although an
90  * exception will be thrown.
91  **/
92  static void setLocaleDir ( std::string directory );
93  /**
94  * Returns the value of your program's locale subdir.
95  **/
96  static std::string localeDir ();
97 
98 private:
99  static std::string _progDir;
100  static std::string _iconDir;
101  static std::string _themeDir;
102  static std::string _localeDir;
103 
104  YSettings ();
105  YSettings ( const YSettings& );
106  ~YSettings ();
107 };
108 
109 #endif // YSettings_h
static std::string localeDir()
Definition: YSettings.cc:157
static void setIconDir(std::string directory)
Definition: YSettings.cc:79
static void setThemeDir(std::string directory)
Definition: YSettings.cc:108
static void setProgDir(std::string directory)
Definition: YSettings.cc:55
static void setLocaleDir(std::string directory)
Definition: YSettings.cc:141
static std::string iconDir()
Definition: YSettings.cc:95
static std::string themeDir()
Definition: YSettings.cc:124
static std::string progDir()
Definition: YSettings.cc:71