00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __POLICIES_H__
00023 #define __POLICIES_H__
00024
00025 #include <tqstring.h>
00026
00027 class KConfig;
00028
00029
00030 #define INHERIT_POLICY 32767
00031
00040 class Policies {
00041 public:
00057 Policies(KConfig* config, const TQString &group, bool global,
00058 const TQString &domain, const TQString &prefix,
00059 const TQString &feature_key);
00060
00061 virtual ~Policies();
00062
00066 bool isGlobal() const {
00067 return is_global;
00068 }
00069
00073 void setDomain(const TQString &domain);
00074
00078 bool isFeatureEnabledPolicyInherited() const {
00079 return feature_enabled == INHERIT_POLICY;
00080 }
00082 void inheritFeatureEnabledPolicy() {
00083 feature_enabled = INHERIT_POLICY;
00084 }
00091 bool isFeatureEnabled() const {
00092 return (bool)feature_enabled;
00093 }
00098 void setFeatureEnabled(int on) {
00099 feature_enabled = on;
00100 }
00101
00108 virtual void load();
00115 virtual void save();
00119 virtual void defaults();
00120
00121 protected:
00122
00123 unsigned int feature_enabled;
00124
00125 bool is_global;
00126 KConfig *config;
00127 TQString groupname;
00128 TQString domain;
00129 TQString prefix;
00130 TQString feature_key;
00131 };
00132
00133 #endif // __POLICIES_H__
00134