23 #ifndef _TDECONFIGBASE_H
24 #define _TDECONFIGBASE_H
29 #include <tqdatetime.h>
30 #include <tqstrlist.h>
31 #include <tqstringlist.h>
32 #include <tqvariant.h>
35 #include "tdeconfigdata.h"
36 #include "tdelibs_export.h"
39 class TDEConfigBasePrivate;
100 void setGroup(
const TQString& group );
106 void setDesktopGroup();
114 TQString group()
const;
122 bool hasGroup(
const TQString &group)
const;
129 virtual TQStringList groupList()
const = 0;
147 const TQString& aDefault = TQString::null )
const;
157 const TQString& aDefault = TQString::null )
const;
205 const TQVariant &aDefault)
const;
222 const TQVariant &aDefault)
const;
234 int readListEntry(
const TQString& pKey, TQStrList &list,
char sep =
',' )
const;
246 int readListEntry(
const char *pKey, TQStrList &list,
char sep =
',' )
const;
255 TQStringList
readListEntry(
const TQString& pKey,
char sep =
',' )
const;
264 TQStringList
readListEntry(
const char *pKey,
char sep =
',' )
const;
275 TQStringList
readListEntry(
const char* pKey,
const TQStringList& aDefault,
276 char sep =
',' )
const;
305 TQString
readPathEntry(
const TQString& pKey,
const TQString & aDefault = TQString::null )
const;
318 TQString
readPathEntry(
const char *pKey,
const TQString & aDefault = TQString::null )
const;
360 int readNumEntry(
const TQString& pKey,
int nDefault = 0 )
const;
373 int readNumEntry(
const char *pKey,
int nDefault = 0 )
const;
465 TQ_INT64
readNum64Entry(
const TQString& pKey, TQ_INT64 nDefault = 0 )
const;
478 TQ_INT64
readNum64Entry(
const char *pKey, TQ_INT64 nDefault = 0 )
const;
543 TQFont
readFontEntry(
const TQString& pKey,
const TQFont* pDefault = 0L )
const;
556 TQFont
readFontEntry(
const char *pKey,
const TQFont* pDefault = 0L )
const;
569 bool readBoolEntry(
const TQString& pKey,
bool bDefault =
false )
const;
582 bool readBoolEntry(
const char *pKey,
bool bDefault =
false )
const;
595 TQRect
readRectEntry(
const TQString& pKey,
const TQRect* pDefault = 0L )
const;
608 TQRect
readRectEntry(
const char *pKey,
const TQRect* pDefault = 0L )
const;
621 TQPoint
readPointEntry(
const TQString& pKey,
const TQPoint* pDefault = 0L )
const;
634 TQPoint
readPointEntry(
const char *pKey,
const TQPoint* pDefault = 0L )
const;
647 TQSize
readSizeEntry(
const TQString& pKey,
const TQSize* pDefault = 0L )
const;
660 TQSize
readSizeEntry(
const char *pKey,
const TQSize* pDefault = 0L )
const;
674 TQColor
readColorEntry(
const TQString& pKey,
const TQColor* pDefault = 0L )
const;
687 TQColor
readColorEntry(
const char *pKey,
const TQColor* pDefault = 0L )
const;
701 TQDateTime
readDateTimeEntry(
const TQString& pKey,
const TQDateTime* pDefault = 0L )
const;
715 TQDateTime
readDateTimeEntry(
const char *pKey,
const TQDateTime* pDefault = 0L )
const;
726 const TQString& aDefault = TQString::null )
const;
737 const TQString& aDefault = TQString::null )
const;
758 void writeEntry(
const TQString& pKey,
const TQString& pValue,
759 bool bPersistent =
true,
bool bGlobal =
false,
779 void writeEntry(
const char *pKey,
const TQString& pValue,
780 bool bPersistent =
true,
bool bGlobal =
false,
802 void writeEntry(
const TQString& pKey,
const TQVariant& rValue,
803 bool bPersistent =
true,
bool bGlobal =
false,
824 void writeEntry(
const char *pKey,
const TQVariant& rValue,
825 bool bPersistent =
true,
bool bGlobal =
false,
848 void writeEntry(
const TQString& pKey,
const TQStrList &rValue,
849 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
870 void writeEntry(
const char *pKey,
const TQStrList &rValue,
871 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
893 void writeEntry(
const TQString& pKey,
const TQStringList &rValue,
894 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
915 void writeEntry(
const char *pKey,
const TQStringList &rValue,
916 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
938 void writeEntry(
const TQString& pKey,
const TQValueList<int>& rValue,
939 bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
959 void writeEntry(
const char *pKey,
const TQValueList<int>& rValue,
960 bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
980 bool bPersistent =
true,
bool bGlobal =
false,
982 {
writeEntry(pKey, TQString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
1001 bool bPersistent =
true,
bool bGlobal =
false,
1003 {
writeEntry(pKey, TQString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
1020 void writeEntry(
const TQString& pKey,
int nValue,
1021 bool bPersistent =
true,
bool bGlobal =
false,
1022 bool bNLS =
false );
1038 void writeEntry(
const char *pKey,
int nValue,
1039 bool bPersistent =
true,
bool bGlobal =
false,
1040 bool bNLS =
false );
1057 void writeEntry(
const TQString& pKey,
unsigned int nValue,
1058 bool bPersistent =
true,
bool bGlobal =
false,
1059 bool bNLS =
false );
1075 void writeEntry(
const char *pKey,
unsigned int nValue,
1076 bool bPersistent =
true,
bool bGlobal =
false,
1077 bool bNLS =
false );
1093 void writeEntry(
const TQString& pKey,
long nValue,
1094 bool bPersistent =
true,
bool bGlobal =
false,
1095 bool bNLS =
false );
1110 void writeEntry(
const char *pKey,
long nValue,
1111 bool bPersistent =
true,
bool bGlobal =
false,
1112 bool bNLS =
false );
1128 void writeEntry(
const TQString& pKey,
unsigned long nValue,
1129 bool bPersistent =
true,
bool bGlobal =
false,
1130 bool bNLS =
false );
1145 void writeEntry(
const char *pKey,
unsigned long nValue,
1146 bool bPersistent =
true,
bool bGlobal =
false,
1147 bool bNLS =
false );
1163 void writeEntry(
const TQString& pKey, TQ_INT64 nValue,
1164 bool bPersistent =
true,
bool bGlobal =
false,
1165 bool bNLS =
false );
1180 void writeEntry(
const char *pKey, TQ_INT64 nValue,
1181 bool bPersistent =
true,
bool bGlobal =
false,
1182 bool bNLS =
false );
1198 void writeEntry(
const TQString& pKey, TQ_UINT64 nValue,
1199 bool bPersistent =
true,
bool bGlobal =
false,
1200 bool bNLS =
false );
1215 void writeEntry(
const char *pKey, TQ_UINT64 nValue,
1216 bool bPersistent =
true,
bool bGlobal =
false,
1217 bool bNLS =
false );
1236 void writeEntry(
const TQString& pKey,
double nValue,
1237 bool bPersistent =
true,
bool bGlobal =
false,
1238 char format =
'g',
int precision = 6,
1239 bool bNLS =
false );
1257 void writeEntry(
const char *pKey,
double nValue,
1258 bool bPersistent =
true,
bool bGlobal =
false,
1259 char format =
'g',
int precision = 6,
1260 bool bNLS =
false );
1276 void writeEntry(
const TQString& pKey,
bool bValue,
1277 bool bPersistent =
true,
bool bGlobal =
false,
1278 bool bNLS =
false );
1293 void writeEntry(
const char *pKey,
bool bValue,
1294 bool bPersistent =
true,
bool bGlobal =
false,
1295 bool bNLS =
false );
1311 void writeEntry(
const TQString& pKey,
const TQFont& rFont,
1312 bool bPersistent =
true,
bool bGlobal =
false,
1313 bool bNLS =
false );
1328 void writeEntry(
const char *pKey,
const TQFont& rFont,
1329 bool bPersistent =
true,
bool bGlobal =
false,
1330 bool bNLS =
false );
1349 void writeEntry(
const TQString& pKey,
const TQColor& rColor,
1350 bool bPersistent =
true,
bool bGlobal =
false,
1351 bool bNLS =
false );
1369 void writeEntry(
const char *pKey,
const TQColor& rColor,
1370 bool bPersistent =
true,
bool bGlobal =
false,
1371 bool bNLS =
false );
1390 void writeEntry(
const TQString& pKey,
const TQDateTime& rDateTime,
1391 bool bPersistent =
true,
bool bGlobal =
false,
1392 bool bNLS =
false );
1410 void writeEntry(
const char *pKey,
const TQDateTime& rDateTime,
1411 bool bPersistent =
true,
bool bGlobal =
false,
1412 bool bNLS =
false );
1432 void writeEntry(
const TQString& pKey,
const TQRect& rValue,
1433 bool bPersistent =
true,
bool bGlobal =
false,
1434 bool bNLS =
false );
1452 void writeEntry(
const char *pKey,
const TQRect& rValue,
1453 bool bPersistent =
true,
bool bGlobal =
false,
1454 bool bNLS =
false );
1473 void writeEntry(
const TQString& pKey,
const TQPoint& rValue,
1474 bool bPersistent =
true,
bool bGlobal =
false,
1475 bool bNLS =
false );
1493 void writeEntry(
const char *pKey,
const TQPoint& rValue,
1494 bool bPersistent =
true,
bool bGlobal =
false,
1495 bool bNLS =
false );
1514 void writeEntry(
const TQString& pKey,
const TQSize& rValue,
1515 bool bPersistent =
true,
bool bGlobal =
false,
1516 bool bNLS =
false );
1534 void writeEntry(
const char *pKey,
const TQSize& rValue,
1535 bool bPersistent =
true,
bool bGlobal =
false,
1536 bool bNLS =
false );
1555 void writePathEntry(
const TQString& pKey,
const TQString & path,
1556 bool bPersistent =
true,
bool bGlobal =
false,
1557 bool bNLS =
false );
1576 bool bPersistent =
true,
bool bGlobal =
false,
1577 bool bNLS =
false );
1599 bool bPersistent,
bool bGlobal,
1600 bool bNLS,
bool expand );
1625 void writePathEntry(
const TQString& pKey,
const TQStringList &rValue,
1626 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
1650 void writePathEntry(
const char *pKey,
const TQStringList &rValue,
1651 char sep =
',',
bool bPersistent =
true,
bool bGlobal =
false,
bool bNLS =
false );
1663 bool bNLS =
false,
bool bGlobal =
false);
1673 bool bNLS =
false,
bool bGlobal =
false);
1692 bool deleteGroup(
const TQString& group,
bool bDeep =
true,
bool bGlobal =
false );
1725 virtual void rollback(
bool bDeep =
true );
1740 virtual void sync();
1773 bool hasKey(
const TQString& key )
const;
1785 virtual TQMap<TQString, TQString> entryMap(
const TQString &group)
const = 0;
1799 virtual void reparseConfiguration() = 0;
1946 virtual KEntryMap internalEntryMap(
const TQString& pGroup )
const = 0;
1959 virtual KEntryMap internalEntryMap()
const = 0;
1994 virtual bool internalHasGroup(
const TQCString &group)
const = 0;
2004 void setGroup(
const TQCString &pGroup );
2005 void setGroup(
const char *pGroup );
2006 bool hasGroup(
const TQCString &_pGroup)
const;
2007 bool hasGroup(
const char *_pGroup)
const;
2008 bool hasKey(
const char *pKey )
const;
2011 TQCString readEntryUtf8(
const char *pKey)
const;
2012 bool hasTranslatedKey(
const char *pKey )
const;
2027 bool bLocaleInitialized;
2029 mutable bool bExpand;
2032 virtual void virtual_hook(
int id,
void* data );
2034 class TDEConfigBasePrivate;
2035 TDEConfigBasePrivate *d;
2037 void writeEntry(
const char *pKey,
const TQString &rValue,
2038 bool bPersistent,
bool bGlobal,
bool bNLS,
bool bExpand );
2039 void writeEntry(
const char *pKey,
const TQStringList &rValue,
2040 char sep,
bool bPersistent,
bool bGlobal,
bool bNLS,
bool bExpand );
2044 class TDEConfigGroupSaverPrivate;
2096 : _config(config), _oldgroup(config->group())
2097 { _config->setGroup( group ); }
2100 : _config(config), _oldgroup(config->group())
2101 { _config->setGroup( group ); }
2104 : _config(config), _oldgroup(config->group())
2105 { _config->setGroup( group ); }
2118 TDEConfigGroupSaverPrivate *d;
2121 class TDEConfigGroupPrivate;
2167 virtual void setDirty(
bool _bDirty);
2170 virtual void sync();
2182 virtual TQStringList
groupList()
const {
return TQStringList(); }
2185 virtual TQMap<TQString, TQString>
entryMap(
const TQString &)
const
2186 {
return TQMap<TQString,TQString>(); }
2188 {
return KEntryMap(); }
2190 {
return KEntryMap(); }
2191 virtual bool internalHasGroup(
const TQCString &)
const
2198 virtual void virtual_hook(
int id,
void* data );
2200 TDEConfigGroupPrivate* d;