libyui  3.0.10
/usr/src/RPM/BUILD/libyui-3.0.10/src/YSettings.h
00001 /*
00002   Copyright (c) 2012 Björn Esser 
00003 
00004   Permission is hereby granted, free of charge, to any person obtaining
00005   a copy of this software and associated documentation files (the
00006   "Software"), to deal in the Software without restriction, including
00007   without limitation the rights to use, copy, modify, merge, publish,
00008   distribute, sublicense, and/or sell
00009   copies of the Software, and to permit persons to whom the Software is
00010   furnished to do so, subject to the following conditions:
00011 
00012   The above copyright notice and this permission notice shall be
00013   included in all copies or substantial portions of the Software.
00014 
00015   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
00018   SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00019   DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
00020   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00021   THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 */
00023 
00024 
00025 /*-/
00026 
00027   File:         YSettings.h
00028 
00029   Author:       Björn Esser <bjoern.esser@gmail.com>
00030 
00031 /-*/
00032 
00033 #ifndef YSettings_h
00034 #define YSettings_h
00035 
00036 #include <string>
00037 
00038 /**
00039  * Settings for libyui
00040  *
00041  * This singleton-object hold some presets for libyui.
00042  **/
00043 class YSettings
00044 {
00045 public:
00046     /**
00047      * This can be used to set a subdir beneath PLUGINDIR or THEMEDIR,
00048      * where your program stores a custom plugin or theme.
00049      *
00050      * Once this is set, it can't be altered. If you do so although an
00051      * exception will be thrown.
00052      **/
00053     static void setProgDir ( std::string directory );
00054     /**
00055      * Returns the value of your program's subdir.
00056      **/
00057     static std::string progDir ();
00058     
00059     /**
00060      * This can be used to set a subdir ICONDIR,
00061      * where your program stores a custom icons.
00062      *
00063      * Once this is set, it can't be altered. If you do so although an
00064      * exception will be thrown.
00065      **/
00066     static void setIconDir ( std::string directory );
00067     /**
00068      * Returns the value of your program's icons subdir.
00069      **/
00070     static std::string iconDir ();
00071     
00072     /**
00073      * This can be used to set a subdir THEMEDIR,
00074      * where your program stores a custom icons.
00075      *
00076      * Once this is set, it can't be altered. If you do so although an
00077      * exception will be thrown.
00078      **/
00079     static void setThemeDir ( std::string directory );
00080     /**
00081      * Returns the value of your program's theme subdir.
00082      **/
00083     static std::string themeDir ();
00084 
00085     /**
00086      * This can be used to set a subdir LOCALEDIR,
00087      * where your program stores translations
00088      *
00089      * Once this is set, it can't be altered. If you do so although an
00090      * exception will be thrown.
00091      **/
00092     static void setLocaleDir ( std::string directory );
00093     /**
00094      * Returns the value of your program's locale subdir.
00095      **/
00096     static std::string localeDir ();
00097 
00098 private:
00099     static std::string _progDir;
00100     static std::string _iconDir;
00101     static std::string _themeDir;
00102     static std::string _localeDir;
00103     
00104     YSettings ();
00105     YSettings ( const YSettings& );
00106     ~YSettings ();
00107 };
00108 
00109 #endif // YSettings_h
 All Classes Functions Variables Enumerations Friends