kontact
prefs.h00001
00002
00003 #ifndef KONTACT_PREFS_H
00004 #define KONTACT_PREFS_H
00005
00006 #include <kconfigskeleton.h>
00007 #include <kdebug.h>
00008
00009 namespace Kontact {
00010
00011 class KDE_EXPORT Prefs : public KConfigSkeleton
00012 {
00013 public:
00014
00015 static Prefs *self();
00016 ~Prefs();
00017
00021 static
00022 void setActivePlugin( const QString & v )
00023 {
00024 if (!self()->isImmutable( QString::fromLatin1( "ActivePlugin" ) ))
00025 self()->mActivePlugin = v;
00026 }
00027
00031 static
00032 QString activePlugin()
00033 {
00034 return self()->mActivePlugin;
00035 }
00036
00040 ItemString *activePluginItem()
00041 {
00042 return mActivePluginItem;
00043 }
00044
00048 static
00049 void setForceStartupPlugin( bool v )
00050 {
00051 if (!self()->isImmutable( QString::fromLatin1( "ForceStartupPlugin" ) ))
00052 self()->mForceStartupPlugin = v;
00053 }
00054
00058 static
00059 bool forceStartupPlugin()
00060 {
00061 return self()->mForceStartupPlugin;
00062 }
00063
00067 ItemBool *forceStartupPluginItem()
00068 {
00069 return mForceStartupPluginItem;
00070 }
00071
00075 static
00076 void setForcedStartupPlugin( const QString & v )
00077 {
00078 if (!self()->isImmutable( QString::fromLatin1( "ForcedStartupPlugin" ) ))
00079 self()->mForcedStartupPlugin = v;
00080 }
00081
00085 static
00086 QString forcedStartupPlugin()
00087 {
00088 return self()->mForcedStartupPlugin;
00089 }
00090
00094 ItemString *forcedStartupPluginItem()
00095 {
00096 return mForcedStartupPluginItem;
00097 }
00098
00102 static
00103 void setSidePaneSplitter( const QValueList<int> & v )
00104 {
00105 if (!self()->isImmutable( QString::fromLatin1( "SidePaneSplitter" ) ))
00106 self()->mSidePaneSplitter = v;
00107 }
00108
00112 static
00113 QValueList<int> sidePaneSplitter()
00114 {
00115 return self()->mSidePaneSplitter;
00116 }
00117
00121 ItemIntList *sidePaneSplitterItem()
00122 {
00123 return mSidePaneSplitterItem;
00124 }
00125
00129 static
00130 void setSidePaneIconSize( int v )
00131 {
00132 if (!self()->isImmutable( QString::fromLatin1( "SidePaneIconSize" ) ))
00133 self()->mSidePaneIconSize = v;
00134 }
00135
00139 static
00140 int sidePaneIconSize()
00141 {
00142 return self()->mSidePaneIconSize;
00143 }
00144
00148 ItemInt *sidePaneIconSizeItem()
00149 {
00150 return mSidePaneIconSizeItem;
00151 }
00152
00156 static
00157 void setSidePaneShowIcons( bool v )
00158 {
00159 if (!self()->isImmutable( QString::fromLatin1( "SidePaneShowIcons" ) ))
00160 self()->mSidePaneShowIcons = v;
00161 }
00162
00166 static
00167 bool sidePaneShowIcons()
00168 {
00169 return self()->mSidePaneShowIcons;
00170 }
00171
00175 ItemBool *sidePaneShowIconsItem()
00176 {
00177 return mSidePaneShowIconsItem;
00178 }
00179
00183 static
00184 void setSidePaneShowText( bool v )
00185 {
00186 if (!self()->isImmutable( QString::fromLatin1( "SidePaneShowText" ) ))
00187 self()->mSidePaneShowText = v;
00188 }
00189
00193 static
00194 bool sidePaneShowText()
00195 {
00196 return self()->mSidePaneShowText;
00197 }
00198
00202 ItemBool *sidePaneShowTextItem()
00203 {
00204 return mSidePaneShowTextItem;
00205 }
00206
00210 static
00211 void setLastVersionSeen( const QString & v )
00212 {
00213 if (!self()->isImmutable( QString::fromLatin1( "LastVersionSeen" ) ))
00214 self()->mLastVersionSeen = v;
00215 }
00216
00220 static
00221 QString lastVersionSeen()
00222 {
00223 return self()->mLastVersionSeen;
00224 }
00225
00229 ItemString *lastVersionSeenItem()
00230 {
00231 return mLastVersionSeenItem;
00232 }
00233
00234 static
00235 void writeConfig()
00236 {
00237 static_cast<KConfigSkeleton*>(self())->writeConfig();
00238 }
00239 protected:
00240 Prefs();
00241 static Prefs *mSelf;
00242
00243 public:
00244
00245
00246 QString mActivePlugin;
00247 bool mForceStartupPlugin;
00248 QString mForcedStartupPlugin;
00249 QValueList<int> mSidePaneSplitter;
00250 int mSidePaneIconSize;
00251 bool mSidePaneShowIcons;
00252 bool mSidePaneShowText;
00253 QString mLastVersionSeen;
00254
00255 private:
00256 ItemString *mActivePluginItem;
00257 ItemBool *mForceStartupPluginItem;
00258 ItemString *mForcedStartupPluginItem;
00259 ItemIntList *mSidePaneSplitterItem;
00260 ItemInt *mSidePaneIconSizeItem;
00261 ItemBool *mSidePaneShowIconsItem;
00262 ItemBool *mSidePaneShowTextItem;
00263 ItemString *mLastVersionSeenItem;
00264 };
00265
00266 }
00267
00268 #endif
00269
|