home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kconfigbase.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-02-13  |  81.3 KB  |  2,179 lines

  1. /*
  2.    This file is part of the KDE libraries
  3.    Copyright (c) 1999 Preston Brown <pbrown@kde.org>
  4.    Copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
  5.    Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
  6.  
  7.    This library is free software; you can redistribute it and/or
  8.    modify it under the terms of the GNU Library General Public
  9.    License as published by the Free Software Foundation; either
  10.    version 2 of the License, or (at your option) any later version.
  11.  
  12.    This library is distributed in the hope that it will be useful,
  13.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.    Library General Public License for more details.
  16.  
  17.    You should have received a copy of the GNU Library General Public License
  18.    along with this library; see the file COPYING.LIB.  If not, write to
  19.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20.    Boston, MA 02110-1301, USA.
  21. */
  22.  
  23. #ifndef _KCONFIGBASE_H
  24. #define _KCONFIGBASE_H
  25.  
  26. #include <qobject.h>
  27. #include <qcolor.h>
  28. #include <qfont.h>
  29. #include <qdatetime.h>
  30. #include <qstrlist.h>
  31. #include <qstringlist.h>
  32. #include <qvariant.h>
  33. #include <qmap.h>
  34.  
  35. #include "kconfigdata.h"
  36. #include "kdelibs_export.h"
  37.  
  38. class KConfigBackEnd;
  39. class KConfigBasePrivate;
  40. class KConfigGroup;
  41.  
  42. /**
  43.  * @short KDE Configuration Management abstract base class
  44.  *
  45.  * This class forms the base for all %KDE configuration. It is an
  46.  * abstract base class, meaning that you cannot directly instantiate
  47.  * objects of this class. Either use KConfig (for usual %KDE
  48.  * configuration) or KSimpleConfig (for special needs as in ksamba), or
  49.  * even KSharedConfig (stores values in shared memory).
  50.  *
  51.  * All configuration entries are key, value pairs.  Each entry also
  52.  * belongs to a specific group of related entries.  All configuration
  53.  * entries that do not explicitly specify which group they are in are
  54.  * in a special group called the default group.
  55.  *
  56.  * If there is a $ character in an entry, KConfigBase tries to expand
  57.  * environment variable and uses its value instead of its name. You
  58.  * can avoid this feature by having two consecutive $ characters in
  59.  * your config file which get expanded to one.
  60.  *
  61.  * \note the '=' char is not allowed in keys and the ']' char is not allowed in
  62.  * a group name.
  63.  *
  64.  * @author Kalle Dalheimer <kalle@kde.org>, Preston Brown <pbrown@kde.org>
  65.  * @see KGlobal#config()
  66.  * @see KConfig
  67.  * @see KSimpleConfig
  68.  * @see KSharedConfig
  69.  */
  70. class KDECORE_EXPORT KConfigBase : public QObject
  71. {
  72.   Q_OBJECT
  73.  
  74.   friend class KConfigBackEnd;
  75.   friend class KConfigINIBackEnd;
  76.   friend class KConfigGroup;
  77.  
  78. public:
  79.   /**
  80.    * Construct a KConfigBase object.
  81.    */
  82.   KConfigBase();
  83.  
  84.   /**
  85.    * Destructs the KConfigBase object.
  86.    */
  87.   virtual ~KConfigBase();
  88.  
  89.   /**
  90.    * Specifies the group in which keys will be read and written.
  91.    *
  92.    *  Subsequent
  93.    * calls to readEntry() and writeEntry() will be applied only in the
  94.    * activated group.
  95.    *
  96.    * Switch back to the default group by passing a null string.
  97.    * @param group The name of the new group.
  98.    */
  99.   void setGroup( const QString& group );
  100.  
  101.   /**
  102.    * Sets the group to the "Desktop Entry" group used for
  103.    * desktop configuration files for applications, mime types, etc.
  104.    */
  105.   void setDesktopGroup();
  106.  
  107.   /**
  108.    * Returns the name of the group in which we are
  109.    *  searching for keys and from which we are retrieving entries.
  110.    *
  111.    * @return The current group.
  112.    */
  113.   QString group() const;
  114.  
  115.   /**
  116.    * Returns true if the specified group is known about.
  117.    *
  118.    * @param group The group to search for.
  119.    * @return true if the group exists.
  120.    */
  121.   bool hasGroup(const QString &group) const;
  122.  
  123.   /**
  124.    * Returns a list of groups that are known about.
  125.    *
  126.    * @return The list of groups.
  127.    **/
  128.   virtual QStringList groupList() const = 0;
  129.  
  130.   /**
  131.    * Returns a the current locale.
  132.    *
  133.    * @return A string representing the current locale.
  134.    */
  135.   QString locale() const;
  136.  
  137.   /**
  138.    * Reads the value of an entry specified by @p pKey in the current group.
  139.    * If you want to read a path, please use readPathEntry().
  140.    *
  141.    * @param pKey The key to search for.
  142.    * @param aDefault A default value returned if the key was not found.
  143.    * @return The value for this key. Can be QString::null if aDefault is null.
  144.    */
  145.    QString readEntry(const QString& pKey,
  146.                      const QString& aDefault = QString::null ) const;
  147.  
  148.   /**
  149.    * Reads the value of an entry specified by @p pKey in the current group.
  150.    *
  151.    * @param pKey The key to search for.
  152.    * @param aDefault A default value returned if the key was not found.
  153.    * @return The value for this key. Can be QString::null if aDefault is null.
  154.    */
  155.    QString readEntry(const char *pKey,
  156.                      const QString& aDefault = QString::null ) const;
  157.  
  158.   /**
  159.    * Reads the value of an entry specified by @p pKey in the current group.
  160.    * The value is treated as if it is of the given type.
  161.    *
  162.    * Note that only the following QVariant types are allowed : String,
  163.    * StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool,
  164.    * Double, DateTime and Date.
  165.    * @deprecated
  166.    *
  167.    * @param pKey The key to search for.
  168.    * @return An invalid QVariant if the key was not found or if the
  169.    * read value cannot be converted to the given QVariant::Type.
  170.    */
  171.   QVariant readPropertyEntry( const QString& pKey, QVariant::Type ) const;
  172.  
  173.   /**
  174.    * Reads the value of an entry specified by @p pKey in the current group.
  175.    * The value is treated as if it is of the given type.
  176.    *
  177.    * Note that only the following QVariant types are allowed : String,
  178.    * StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool,
  179.    * Double, DateTime and Date.
  180.    *
  181.    * @deprecated
  182.    *
  183.    * @param pKey The key to search for.
  184.    * @return An invalid QVariant if the key was not found or if the
  185.    * read value cannot be converted to the given QVariant::Type.
  186.    */
  187.   QVariant readPropertyEntry( const char *pKey, QVariant::Type ) const;
  188.  
  189.   /**
  190.    * Reads the value of an entry specified by @p pKey in the current group.
  191.    * The value is treated as if it is of the type of the given default value.
  192.    *
  193.    * Note that only the following QVariant types are allowed : String,
  194.    * StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool,
  195.    * Double, DateTime and Date.
  196.    *
  197.    * @param pKey The key to search for.
  198.    * @param aDefault A default value returned if the key was not found or
  199.    * if the read value cannot be converted to the QVariant::Type.
  200.    * @return The value for the key or the default value if the key was not
  201.    *         found.
  202.    */
  203.   QVariant readPropertyEntry( const QString& pKey,
  204.                               const QVariant &aDefault) const;
  205.  
  206.   /**
  207.    * Reads the value of an entry specified by @p pKey in the current group.
  208.    * The value is treated as if it is of the type of the given default value.
  209.    *
  210.    * Note that only the following QVariant types are allowed : String,
  211.    * StringList, List, Font, Point, Rect, Size, Color, Int, UInt, Bool,
  212.    * Double, DateTime and Date.
  213.    *
  214.    * @param pKey The key to search for.
  215.    * @param aDefault A default value returned if the key was not found or
  216.    * if the read value cannot be converted to the QVariant::Type.
  217.    * @return The value for the key or the default value if the key was not
  218.    *         found.
  219.    */
  220.   QVariant readPropertyEntry( const char *pKey,
  221.                               const QVariant &aDefault) const;
  222.  
  223.   /**
  224.    * Reads a list of strings.
  225.    *
  226.    * @deprecated
  227.    *
  228.    * @param pKey The key to search for
  229.    * @param list In this object, the read list will be returned.
  230.    * @param sep  The list separator (default ",")
  231.    * @return The number of entries in the list.
  232.    */
  233.   int readListEntry( const QString& pKey, QStrList &list, char sep = ',' ) const;
  234.  
  235.   /**
  236.    * Reads a list of strings.
  237.    *
  238.    * @deprecated
  239.    *
  240.    * @param pKey The key to search for
  241.    * @param list In this object, the read list will be returned.
  242.    * @param sep  The list separator (default ",")
  243.    * @return The number of entries in the list.
  244.    */
  245.   int readListEntry( const char *pKey, QStrList &list, char sep = ',' ) const;
  246.  
  247.   /**
  248.    * Reads a list of strings.
  249.    *
  250.    * @param pKey The key to search for.
  251.    * @param sep  The list separator (default is ",").
  252.    * @return The list. Empty if the entry does not exist.
  253.    */
  254.   QStringList readListEntry( const QString& pKey, char sep = ',' ) const;
  255.  
  256.   /**
  257.    * Reads a list of strings.
  258.    *
  259.    * @param pKey The key to search for.
  260.    * @param sep  The list separator (default is ",").
  261.    * @return The list. Empty if the entry does not exist.
  262.    */
  263.   QStringList readListEntry( const char *pKey, char sep = ',' ) const;
  264.  
  265.   /**
  266.    * Reads a list of strings, but returns a default if the key 
  267.    * did not exist.
  268.    * @param pKey The key to search for.
  269.    * @param aDefault The default value to use if the key does not exist.
  270.    * @param sep The list separator (default is ",").
  271.    * @return The list. Contains @p aDefault if the Key does not exist.
  272.    * @since 3.3
  273.    */
  274.   QStringList readListEntry( const char* pKey, const QStringList& aDefault, 
  275.           char sep = ',' ) const;
  276.  
  277.   /**
  278.    * Reads a list of Integers.
  279.    *
  280.    * @param pKey The key to search for.
  281.    * @return The list. Empty if the entry does not exist.
  282.    */
  283.   QValueList<int> readIntListEntry( const QString& pKey ) const;
  284.  
  285.   /**
  286.    * Reads a list of Integers.
  287.    *
  288.    * @param pKey The key to search for.
  289.    * @return The list. Empty if the entry does not exist.
  290.    */
  291.   QValueList<int> readIntListEntry( const char *pKey ) const;
  292.  
  293.   /**
  294.    * Reads a path.
  295.    *
  296.    * Read the value of an entry specified by @p pKey in the current group
  297.    * and interpret it as a path. This means, dollar expansion is activated
  298.    * for this value, so that e.g. $HOME gets expanded.
  299.    *
  300.    * @param pKey The key to search for.
  301.    * @param aDefault A default value returned if the key was not found.
  302.    * @return The value for this key. Can be QString::null if aDefault is null.
  303.    */
  304.   QString readPathEntry( const QString& pKey, const QString & aDefault = QString::null ) const;
  305.  
  306.   /**
  307.    * Reads a path.
  308.    *
  309.    * Read the value of an entry specified by @p pKey in the current group
  310.    * and interpret it as a path. This means, dollar expansion is activated
  311.    * for this value, so that e.g. $HOME gets expanded.
  312.    *
  313.    * @param pKey The key to search for.
  314.    * @param aDefault A default value returned if the key was not found.
  315.    * @return The value for this key. Can be QString::null if aDefault is null.
  316.    */
  317.   QString readPathEntry( const char *pKey, const QString & aDefault = QString::null ) const;
  318.  
  319.   /**
  320.    * Reads a list of string paths.
  321.    *
  322.    * Read the value of an entry specified by @p pKey in the current group
  323.    * and interpret it as a list of paths. This means, dollar expansion is activated
  324.    * for this value, so that e.g. $HOME gets expanded.
  325.    *
  326.    * @param pKey The key to search for.
  327.    * @param sep  The list separator (default is ",").
  328.    * @return The list. Empty if the entry does not exist.
  329.    * @since 3.1.3
  330.    */
  331.   QStringList readPathListEntry( const QString& pKey, char sep = ',' ) const;
  332.  
  333.   /**
  334.    * Reads a list of string paths.
  335.    *
  336.    * Read the value of an entry specified by @p pKey in the current group
  337.    * and interpret it as a list of paths. This means, dollar expansion is activated
  338.    * for this value, so that e.g. $HOME gets expanded.
  339.    *
  340.    * @param pKey The key to search for.
  341.    * @param sep  The list separator (default is ",").
  342.    * @return The list. Empty if the entry does not exist.
  343.    * @since 3.1.3
  344.    */
  345.   QStringList readPathListEntry( const char *pKey, char sep = ',' ) const;
  346.  
  347.  
  348.   /**
  349.    * Reads a numerical value.
  350.    *
  351.    * Read the value of an entry specified by @p pKey in the current group
  352.    * and interpret it numerically.
  353.    *
  354.    * @param pKey The key to search for.
  355.    * @param nDefault A default value returned if the key was not found or if
  356.    * the read value cannot be interpreted.
  357.    * @return The value for this key.
  358.    */
  359.   int readNumEntry( const QString& pKey, int nDefault = 0 ) const;
  360.  
  361.   /**
  362.    * Reads a numerical value.
  363.    *
  364.    * Read the value of an entry specified by @p pKey in the current group
  365.    * and interpret it numerically.
  366.    *
  367.    * @param pKey The key to search for.
  368.    * @param nDefault A default value returned if the key was not found or if
  369.    * the read value cannot be interpreted.
  370.    * @return The value for this key.
  371.    */
  372.   int readNumEntry( const char *pKey, int nDefault = 0 ) const;
  373.  
  374.   /**
  375.    * Reads an unsigned numerical value.
  376.    *
  377.    * Read the value of an entry specified by @p pKey in the current group
  378.    * and interpret it numerically.
  379.    *
  380.    * @param pKey The key to search for.
  381.    * @param nDefault A default value returned if the key was not found or if
  382.    * the read value cannot be interpreted.
  383.    * @return The value for this key.
  384.    */
  385.   unsigned int readUnsignedNumEntry( const QString& pKey, unsigned int nDefault = 0 ) const;
  386.  
  387.   /**
  388.    * Reads an unsigned numerical value.
  389.    *
  390.    * Read the value of an entry specified by @p pKey in the current group
  391.    * and interpret it numerically.
  392.    *
  393.    * @param pKey The key to search for.
  394.    * @param nDefault A default value returned if the key was not found or if
  395.    * the read value cannot be interpreted.
  396.    * @return The value for this key.
  397.    */
  398.   unsigned int readUnsignedNumEntry( const char *pKey, unsigned int nDefault = 0 ) const;
  399.  
  400.  
  401.   /**
  402.    * Reads a numerical value.
  403.    *
  404.    * Read the value of an entry specified by @p pKey in the current group
  405.    * and interpret it numerically.
  406.    *
  407.    * @param pKey The key to search for.
  408.    * @param nDefault A default value returned if the key was not found or if
  409.    * the read value cannot be interpreted.
  410.    * @return The value for this key.
  411.    */
  412.   long readLongNumEntry( const QString& pKey, long nDefault = 0 ) const;
  413.  
  414.   /**
  415.    * Reads a numerical value.
  416.    *
  417.    * Read the value of an entry specified by @p pKey in the current group
  418.    * and interpret it numerically.
  419.    *
  420.    * @param pKey The key to search for.
  421.    * @param nDefault A default value returned if the key was not found or if
  422.    * the read value cannot be interpreted.
  423.    * @return The value for this key.
  424.    */
  425.   long readLongNumEntry( const char *pKey, long nDefault = 0 ) const;
  426.  
  427.   /**
  428.    * Read an unsigned numerical value.
  429.    *
  430.    * Read the value of an entry specified by @p pKey in the current group
  431.    * and interpret it numerically.
  432.    *
  433.    * @param pKey The key to search for.
  434.    * @param nDefault A default value returned if the key was not found or if
  435.    * the read value cannot be interpreted.
  436.    * @return The value for this key.
  437.    */
  438.   unsigned long readUnsignedLongNumEntry( const QString& pKey, unsigned long nDefault = 0 ) const;
  439.  
  440.   /**
  441.    * Read an unsigned numerical value.
  442.    *
  443.    * Read the value of an entry specified by @p pKey in the current group
  444.    * and interpret it numerically.
  445.    *
  446.    * @param pKey The key to search for.
  447.    * @param nDefault A default value returned if the key was not found or if
  448.    * the read value cannot be interpreted.
  449.    * @return The value for this key.
  450.    */
  451.   unsigned long readUnsignedLongNumEntry( const char *pKey, unsigned long nDefault = 0 ) const;
  452.  
  453.   /**
  454.    * Reads a 64-bit numerical value.
  455.    *
  456.    * Read the value of an entry specified by @p pKey in the current group
  457.    * and interpret it numerically.
  458.    *
  459.    * @param pKey The key to search for.
  460.    * @param nDefault A default value returned if the key was not found or if
  461.    * the read value cannot be interpreted.
  462.    * @return The value for this key.
  463.    */
  464.   Q_INT64 readNum64Entry( const QString& pKey, Q_INT64 nDefault = 0 ) const;
  465.  
  466.   /**
  467.    * Reads a 64-bit numerical value.
  468.    *
  469.    * Read the value of an entry specified by @p pKey in the current group
  470.    * and interpret it numerically.
  471.    *
  472.    * @param pKey The key to search for.
  473.    * @param nDefault A default value returned if the key was not found or if
  474.    * the read value cannot be interpreted.
  475.    * @return The value for this key.
  476.    */
  477.   Q_INT64 readNum64Entry( const char *pKey, Q_INT64 nDefault = 0 ) const;
  478.  
  479.   /**
  480.    * Read an 64-bit unsigned numerical value.
  481.    *
  482.    * Read the value of an entry specified by @p pKey in the current group
  483.    * and interpret it numerically.
  484.    *
  485.    * @param pKey The key to search for.
  486.    * @param nDefault A default value returned if the key was not found or if
  487.    * the read value cannot be interpreted.
  488.    * @return The value for this key.
  489.    */
  490.   Q_UINT64 readUnsignedNum64Entry( const QString& pKey, Q_UINT64 nDefault = 0 ) const;
  491.  
  492.   /**
  493.    * Read an 64-bit unsigned numerical value.
  494.    *
  495.    * Read the value of an entry specified by @p pKey in the current group
  496.    * and interpret it numerically.
  497.    *
  498.    * @param pKey The key to search for.
  499.    * @param nDefault A default value returned if the key was not found or if
  500.    * the read value cannot be interpreted.
  501.    * @return The value for this key.
  502.    */
  503.   Q_UINT64 readUnsignedNum64Entry( const char *pKey, Q_UINT64 nDefault = 0 ) const;
  504.  
  505.   /**
  506.    * Reads a floating point value.
  507.    *
  508.    * Read the value of an entry specified by @p pKey in the current group
  509.    * and interpret it numerically.
  510.    *
  511.    * @param pKey The key to search for.
  512.    * @param nDefault A default value returned if the key was not found or if
  513.    * the read value cannot be interpreted.
  514.    * @return The value for this key.
  515.    */
  516.   double readDoubleNumEntry( const QString& pKey, double nDefault = 0.0 ) const;
  517.  
  518.   /**
  519.    * Reads a floating point value.
  520.    *
  521.    * Read the value of an entry specified by @p pKey in the current group
  522.    * and interpret it numerically.
  523.    *
  524.    * @param pKey The key to search for.
  525.    * @param nDefault A default value returned if the key was not found or if
  526.    * the read value cannot be interpreted.
  527.    * @return The value for this key.
  528.    */
  529.   double readDoubleNumEntry( const char *pKey, double nDefault = 0.0 ) const;
  530.  
  531.   /**
  532.    * Reads a QFont value.
  533.    *
  534.    * Read the value of an entry specified by @p pKey in the current group
  535.    * and interpret it as a font object.
  536.    *
  537.    * @param pKey The key to search for.
  538.    * @param pDefault A default value (null QFont by default) returned if the
  539.    * key was not found or if the read value cannot be interpreted.
  540.    * @return The value for this key.
  541.    */
  542.   QFont readFontEntry( const QString& pKey, const QFont* pDefault = 0L ) const;
  543.  
  544.   /**
  545.    * Reads a QFont value.
  546.    *
  547.    * Read the value of an entry specified by @p pKey in the current group
  548.    * and interpret it as a font object.
  549.    *
  550.    * @param pKey The key to search for.
  551.    * @param pDefault A default value (null QFont by default) returned if the
  552.    * key was not found or if the read value cannot be interpreted.
  553.    * @return The value for this key.
  554.    */
  555.   QFont readFontEntry( const char *pKey, const QFont* pDefault = 0L ) const;
  556.  
  557.   /**
  558.    * Reads a boolean entry.
  559.    *
  560.    * Read the value of an entry specified by @p pKey in the current group
  561.    * and interpret it as a boolean value. Currently "on", "yes", "1" and
  562.    * "true" are accepted as true, everything else if false.
  563.    *
  564.    * @param pKey The key to search for
  565.    * @param bDefault A default value returned if the key was not found.
  566.    * @return The value for this key.
  567.    */
  568.   bool readBoolEntry( const QString& pKey, bool bDefault = false ) const;
  569.  
  570.   /**
  571.    * Reads a boolean entry.
  572.    *
  573.    * Read the value of an entry specified by @p pKey in the current group
  574.    * and interpret it as a boolean value. Currently "on", "yes", "1" and
  575.    * "true" are accepted as true, everything else if false.
  576.    *
  577.    * @param pKey The key to search for
  578.    * @param bDefault A default value returned if the key was not found.
  579.    * @return The value for this key.
  580.    */
  581.   bool readBoolEntry( const char *pKey, bool bDefault = false ) const;
  582.  
  583.   /**
  584.    * Reads a QRect entry.
  585.    *
  586.    * Read the value of an entry specified by pKey in the current group
  587.    * and interpret it as a QRect object.
  588.    *
  589.    * @param pKey The key to search for
  590.    * @param pDefault A default value (null QRect by default) returned if the
  591.    * key was not found or if the read value cannot be interpreted.
  592.    * @return The value for this key.
  593.    */
  594.   QRect readRectEntry( const QString& pKey, const QRect* pDefault = 0L ) const;
  595.  
  596.   /**
  597.    * Reads a QRect entry.
  598.    *
  599.    * Read the value of an entry specified by pKey in the current group
  600.    * and interpret it as a QRect object.
  601.    *
  602.    * @param pKey The key to search for
  603.    * @param pDefault A default value (null QRect by default) returned if the
  604.    * key was not found or if the read value cannot be interpreted.
  605.    * @return The value for this key.
  606.    */
  607.   QRect readRectEntry( const char *pKey, const QRect* pDefault = 0L ) const;
  608.  
  609.   /**
  610.    * Reads a QPoint entry.
  611.    *
  612.    * Read the value of an entry specified by @p pKey in the current group
  613.    * and interpret it as a QPoint object.
  614.    *
  615.    * @param pKey The key to search for
  616.    * @param pDefault A default value (null QPoint by default) returned if the
  617.    * key was not found or if the read value cannot be interpreted.
  618.    * @return The value for this key.
  619.    */
  620.   QPoint readPointEntry( const QString& pKey, const QPoint* pDefault = 0L ) const;
  621.  
  622.   /**
  623.    * Reads a QPoint entry.
  624.    *
  625.    * Read the value of an entry specified by @p pKey in the current group
  626.    * and interpret it as a QPoint object.
  627.    *
  628.    * @param pKey The key to search for
  629.    * @param pDefault A default value (null QPoint by default) returned if the
  630.    * key was not found or if the read value cannot be interpreted.
  631.    * @return The value for this key.
  632.    */
  633.   QPoint readPointEntry( const char *pKey, const QPoint* pDefault = 0L ) const;
  634.  
  635.   /**
  636.    * Reads a QSize entry.
  637.    *
  638.    * Read the value of an entry specified by @p pKey in the current group
  639.    * and interpret it as a QSize object.
  640.    *
  641.    * @param pKey The key to search for
  642.    * @param pDefault A default value (null QSize by default) returned if the
  643.    * key was not found or if the read value cannot be interpreted.
  644.    * @return The value for this key.
  645.    */
  646.   QSize readSizeEntry( const QString& pKey, const QSize* pDefault = 0L ) const;
  647.  
  648.   /**
  649.    * Reads a QSize entry.
  650.    *
  651.    * Read the value of an entry specified by @p pKey in the current group
  652.    * and interpret it as a QSize object.
  653.    *
  654.    * @param pKey The key to search for
  655.    * @param pDefault A default value (null QSize by default) returned if the
  656.    * key was not found or if the read value cannot be interpreted.
  657.    * @return The value for this key.
  658.    */
  659.   QSize readSizeEntry( const char *pKey, const QSize* pDefault = 0L ) const;
  660.  
  661.  
  662.   /**
  663.    * Reads a QColor entry.
  664.    *
  665.    * Read the value of an entry specified by @p pKey in the current group
  666.    * and interpret it as a color.
  667.    *
  668.    * @param pKey The key to search for.
  669.    * @param pDefault A default value (null QColor by default) returned if the
  670.    * key was not found or if the value cannot be interpreted.
  671.    * @return The value for this key.
  672.    */
  673.   QColor readColorEntry( const QString& pKey, const QColor* pDefault = 0L ) const;
  674.  
  675.   /**
  676.    * Reads a QColor entry.
  677.    *
  678.    * Read the value of an entry specified by @p pKey in the current group
  679.    * and interpret it as a color.
  680.    *
  681.    * @param pKey The key to search for.
  682.    * @param pDefault A default value (null QColor by default) returned if the
  683.    * key was not found or if the value cannot be interpreted.
  684.    * @return The value for this key.
  685.    */
  686.   QColor readColorEntry( const char *pKey, const QColor* pDefault = 0L ) const;
  687.  
  688.   /**
  689.    * Reads a QDateTime entry.
  690.    *
  691.    * Read the value of an entry specified by @p pKey in the current group
  692.    * and interpret it as a date and time.
  693.    *
  694.    * @param pKey The key to search for.
  695.    * @param pDefault A default value ( currentDateTime() by default)
  696.    * returned if the key was not found or if the read value cannot be
  697.    * interpreted.
  698.    * @return The value for this key.
  699.    */
  700.   QDateTime readDateTimeEntry( const QString& pKey, const QDateTime* pDefault = 0L ) const;
  701.  
  702.   /**
  703.    * Reads a QDateTime entry.
  704.    *
  705.    * Read the value of an entry specified by @p pKey in the current group
  706.    * and interpret it as a date and time.
  707.    *
  708.    * @param pKey The key to search for.
  709.    * @param pDefault A default value ( currentDateTime() by default)
  710.    * returned if the key was not found or if the read value cannot be
  711.    * interpreted.
  712.    * @return The value for this key.
  713.    */
  714.   QDateTime readDateTimeEntry( const char *pKey, const QDateTime* pDefault = 0L ) const;
  715.  
  716.   /**
  717.    * Reads the value of an entry specified by @p pKey in the current group.
  718.    * The untranslated entry is returned, you normally do not need this.
  719.    *
  720.    * @param pKey The key to search for.
  721.    * @param aDefault A default value returned if the key was not found.
  722.    * @return The value for this key.
  723.    */
  724.    QString readEntryUntranslated( const QString& pKey,
  725.                      const QString& aDefault = QString::null ) const;
  726.  
  727.   /**
  728.    * Reads the value of an entry specified by @p pKey in the current group.
  729.    * The untranslated entry is returned, you normally do not need this.
  730.    *
  731.    * @param pKey The key to search for.
  732.    * @param aDefault A default value returned if the key was not found.
  733.    * @return The value for this key.
  734.    */
  735.    QString readEntryUntranslated( const char *pKey,
  736.                      const QString& aDefault = QString::null ) const;
  737.  
  738.   /**
  739.    * Writes a key/value pair.
  740.    *
  741.    * This is stored in the most specific config file when destroying the
  742.    * config object or when calling sync().
  743.    *
  744.    * If you want to write a path, please use writePathEntry().
  745.    *
  746.    * @param pKey         The key to write.
  747.    * @param pValue       The value to write.
  748.    * @param bPersistent  If @p bPersistent is false, the entry's dirty
  749.    *                     flag will not be set and thus the entry will
  750.    *                     not be written to disk at deletion time.
  751.    * @param bGlobal      If @p bGlobal is true, the pair is not saved to the
  752.    *                     application specific config file, but to the
  753.    *                     global KDE config file.
  754.    * @param bNLS         If @p bNLS is true, the locale tag is added to the key
  755.    *                     when writing it back.
  756.    */
  757.   void writeEntry( const QString& pKey, const QString& pValue,
  758.                       bool bPersistent = true, bool bGlobal = false,
  759.                       bool bNLS = false );
  760.  
  761.   /**
  762.    * Writes a key/value pair.
  763.    *
  764.    * This is stored in the most specific config file when destroying the
  765.    * config object or when calling sync().
  766.    *
  767.    * @param pKey         The key to write.
  768.    * @param pValue       The value to write.
  769.    * @param bPersistent  If @p bPersistent is false, the entry's dirty
  770.    *                     flag will not be set and thus the entry will
  771.    *                     not be written to disk at deletion time.
  772.    * @param bGlobal      If @p bGlobal is true, the pair is not saved to the
  773.    *                     application specific config file, but to the
  774.    *                     global KDE config file.
  775.    * @param bNLS         If @p bNLS is true, the locale tag is added to the key
  776.    *                     when writing it back.
  777.    */
  778.   void writeEntry( const char *pKey, const QString& pValue,
  779.                       bool bPersistent = true, bool bGlobal = false,
  780.                       bool bNLS = false );
  781.  
  782.   /**
  783.    * writeEntry() Overridden to accept a property.
  784.    *
  785.    * Note: Unlike the other writeEntry() functions, the old value is
  786.    * _not_ returned here!
  787.    *
  788.    * @param pKey The key to write
  789.    * @param rValue The property to write
  790.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  791.    *                    will not be set and thus the entry will not be
  792.    *                    written to disk at deletion time.
  793.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  794.    *                    application specific config file, but to the
  795.    *                    global KDE config file.
  796.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  797.    *             when writing it back.
  798.    *
  799.    * @see  writeEntry()
  800.    */
  801.   void writeEntry( const QString& pKey, const QVariant& rValue,
  802.                     bool bPersistent = true, bool bGlobal = false,
  803.                     bool bNLS = false );
  804.   /**
  805.    * writeEntry() Overridden to accept a property.
  806.    *
  807.    * Note: Unlike the other writeEntry() functions, the old value is
  808.    * _not_ returned here!
  809.    *
  810.    * @param pKey The key to write
  811.    * @param rValue The property to write
  812.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  813.    *                    will not be set and thus the entry will not be
  814.    *                    written to disk at deletion time.
  815.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  816.    *                    application specific config file, but to the
  817.    *                    global KDE config file.
  818.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  819.    *             when writing it back.
  820.    *
  821.    * @see  writeEntry()
  822.    */
  823.   void writeEntry( const char *pKey, const QVariant& rValue,
  824.                     bool bPersistent = true, bool bGlobal = false,
  825.                     bool bNLS = false );
  826.  
  827.   /**
  828.    * writeEntry() overridden to accept a list of strings.
  829.    *
  830.    * Note: Unlike the other writeEntry() functions, the old value is
  831.    * _not_ returned here!
  832.    *
  833.    * @param pKey The key to write
  834.    * @param rValue The list to write
  835.    * @param sep  The list separator (default is ",").
  836.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  837.    *                    will not be set and thus the entry will not be
  838.    *                    written to disk at deletion time.
  839.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  840.    *                application specific config file, but to the
  841.    *                global KDE config file.
  842.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  843.    *             when writing it back.
  844.    *
  845.    * @see  writeEntry()
  846.    */
  847.   void writeEntry( const QString& pKey, const QStrList &rValue,
  848.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  849.   /**
  850.    * writeEntry() overridden to accept a list of strings.
  851.    *
  852.    * Note: Unlike the other writeEntry() functions, the old value is
  853.    * _not_ returned here!
  854.    *
  855.    * @param pKey The key to write
  856.    * @param rValue The list to write
  857.    * @param sep  The list separator (default is ",").
  858.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  859.    *                    will not be set and thus the entry will not be
  860.    *                    written to disk at deletion time.
  861.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  862.    *                application specific config file, but to the
  863.    *                global KDE config file.
  864.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  865.    *             when writing it back.
  866.    *
  867.    * @see  writeEntry()
  868.    */
  869.   void writeEntry( const char *pKey, const QStrList &rValue,
  870.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  871.  
  872.   /**
  873.    * writeEntry() overridden to accept a list of strings.
  874.    *
  875.    * Note: Unlike the other writeEntry() functions, the old value is
  876.    * _not_ returned here!
  877.    *
  878.    * @param pKey The key to write
  879.    * @param rValue The list to write
  880.    * @param sep  The list separator (default is ",").
  881.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  882.    *                    will not be set and thus the entry will not be
  883.    *                    written to disk at deletion time.
  884.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  885.    *                application specific config file, but to the
  886.    *                global KDE config file.
  887.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  888.    *             when writing it back.
  889.    *
  890.    * @see  writeEntry()
  891.    */
  892.   void writeEntry( const QString& pKey, const QStringList &rValue,
  893.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  894.   /**
  895.    * writeEntry() overridden to accept a list of strings.
  896.    *
  897.    * Note: Unlike the other writeEntry() functions, the old value is
  898.    * _not_ returned here!
  899.    *
  900.    * @param pKey The key to write
  901.    * @param rValue The list to write
  902.    * @param sep  The list separator (default is ",").
  903.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  904.    *                    will not be set and thus the entry will not be
  905.    *                    written to disk at deletion time.
  906.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  907.    *                application specific config file, but to the
  908.    *                global KDE config file.
  909.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  910.    *             when writing it back.
  911.    *
  912.    * @see  writeEntry()
  913.    */
  914.   void writeEntry( const char *pKey, const QStringList &rValue,
  915.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  916.  
  917.  
  918.  /**
  919.    * writeEntry() overridden to accept a list of Integers.
  920.    *
  921.    * Note: Unlike the other writeEntry() functions, the old value is
  922.    * _not_ returned here!
  923.    *
  924.    * @param pKey The key to write
  925.    * @param rValue The list to write
  926.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  927.    *                    will not be set and thus the entry will not be
  928.    *                    written to disk at deletion time.
  929.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  930.    *                application specific config file, but to the
  931.    *                global KDE config file.
  932.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  933.    *             when writing it back.
  934.    *
  935.    * @see  writeEntry()
  936.    */
  937.   void writeEntry( const QString& pKey, const QValueList<int>& rValue,
  938.            bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  939.  /**
  940.    * writeEntry() overridden to accept a list of Integers.
  941.    *
  942.    * Note: Unlike the other writeEntry() functions, the old value is
  943.    * _not_ returned here!
  944.    *
  945.    * @param pKey The key to write
  946.    * @param rValue The list to write
  947.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  948.    *                    will not be set and thus the entry will not be
  949.    *                    written to disk at deletion time.
  950.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  951.    *                application specific config file, but to the
  952.    *                global KDE config file.
  953.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  954.    *             when writing it back.
  955.    *
  956.    * @see  writeEntry()
  957.    */
  958.   void writeEntry( const char *pKey, const QValueList<int>& rValue,
  959.            bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  960.  
  961.   /**
  962.    * Write a (key/value) pair.
  963.    *
  964.    * This is stored to the most specific config file when destroying the
  965.    * config object or when calling sync().
  966.    *
  967.    *  @param pKey               The key to write.
  968.    *  @param pValue     The value to write.
  969.    *  @param bPersistent        If @p bPersistent is false, the entry's dirty
  970.    *                    flag will not be set and thus the entry will
  971.    *                    not be written to disk at deletion time.
  972.    *  @param bGlobal    If @p bGlobal is true, the pair is not saved to the
  973.    *                    application specific config file, but to the
  974.    *                    global KDE config file.
  975.    *  @param bNLS       If @p bNLS is true, the locale tag is added to the key
  976.    *                    when writing it back.
  977.    */
  978.   void writeEntry( const QString& pKey, const char *pValue,
  979.                       bool bPersistent = true, bool bGlobal = false,
  980.                       bool bNLS = false )
  981.     { writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
  982.   /**
  983.    * Write a (key/value) pair.
  984.    *
  985.    * This is stored to the most specific config file when destroying the
  986.    * config object or when calling sync().
  987.    *
  988.    *  @param pKey               The key to write.
  989.    *  @param pValue     The value to write.
  990.    *  @param bPersistent        If @p bPersistent is false, the entry's dirty
  991.    *                    flag will not be set and thus the entry will
  992.    *                    not be written to disk at deletion time.
  993.    *  @param bGlobal    If @p bGlobal is true, the pair is not saved to the
  994.    *                    application specific config file, but to the
  995.    *                    global KDE config file.
  996.    *  @param bNLS       If @p bNLS is true, the locale tag is added to the key
  997.    *                    when writing it back.
  998.    */
  999.   void writeEntry( const char *pKey, const char *pValue,
  1000.                       bool bPersistent = true, bool bGlobal = false,
  1001.                       bool bNLS = false )
  1002.     { writeEntry(pKey, QString::fromLatin1(pValue), bPersistent, bGlobal, bNLS); }
  1003.  
  1004.   /**
  1005.    * Write a (key/value) pair.
  1006.    * Same as above, but writes a numerical value.
  1007.    *
  1008.    * @param pKey The key to write.
  1009.    * @param nValue The value to write.
  1010.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1011.    * flag will not be set and thus the entry will not be written to
  1012.    * disk at deletion time.
  1013.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1014.    *                    application specific config file, but to the
  1015.    *                    global KDE config file.
  1016.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1017.    *                    when writing it back.
  1018.    */
  1019.   void writeEntry( const QString& pKey, int nValue,
  1020.                       bool bPersistent = true, bool bGlobal = false,
  1021.                       bool bNLS = false );
  1022.   /**
  1023.    * Write a (key/value) pair.
  1024.    * Same as above, but writes a numerical value.
  1025.    *
  1026.    * @param pKey The key to write.
  1027.    * @param nValue The value to write.
  1028.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1029.    * flag will not be set and thus the entry will not be written to
  1030.    * disk at deletion time.
  1031.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1032.    *                    application specific config file, but to the
  1033.    *                    global KDE config file.
  1034.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1035.    *                    when writing it back.
  1036.    */
  1037.   void writeEntry( const char *pKey, int nValue,
  1038.                       bool bPersistent = true, bool bGlobal = false,
  1039.                       bool bNLS = false );
  1040.  
  1041.   /**
  1042.    * Writes a (key/value) pair.
  1043.    * Same as above, but writes an unsigned numerical value.
  1044.    *
  1045.    * @param pKey The key to write.
  1046.    * @param nValue The value to write.
  1047.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1048.    * flag will not be set and thus the entry will not be written to
  1049.    * disk at deletion time.
  1050.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1051.    *                    application specific config file, but to the
  1052.    *                    global KDE config file.
  1053.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1054.    *                    when writing it back.
  1055.    */
  1056.   void writeEntry( const QString& pKey, unsigned int nValue,
  1057.                       bool bPersistent = true, bool bGlobal = false,
  1058.                       bool bNLS = false );
  1059.   /**
  1060.    * Writes a (key/value) pair.
  1061.    * Same as above, but writes an unsigned numerical value.
  1062.    *
  1063.    * @param pKey The key to write.
  1064.    * @param nValue The value to write.
  1065.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1066.    * flag will not be set and thus the entry will not be written to
  1067.    * disk at deletion time.
  1068.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1069.    *                    application specific config file, but to the
  1070.    *                    global KDE config file.
  1071.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1072.    *                    when writing it back.
  1073.    */
  1074.   void writeEntry( const char *pKey, unsigned int nValue,
  1075.                       bool bPersistent = true, bool bGlobal = false,
  1076.                       bool bNLS = false );
  1077.  
  1078.   /**
  1079.    * Writes a (key/value) pair.
  1080.    * Same as above, but write a long numerical value.
  1081.    *
  1082.    * @param pKey The key to write.
  1083.    * @param nValue The value to write.
  1084.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1085.    * flag will not be set and thus the entry will not be written to
  1086.    * disk at deletion time.
  1087.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1088.    *  application specific config file, but to the global KDE config file.
  1089.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1090.    *  when writing it back.
  1091.    */
  1092.   void writeEntry( const QString& pKey, long nValue,
  1093.                       bool bPersistent = true, bool bGlobal = false,
  1094.                       bool bNLS = false );
  1095.   /**
  1096.    * Writes a (key/value) pair.
  1097.    * Same as above, but write a long numerical value.
  1098.    *
  1099.    * @param pKey The key to write.
  1100.    * @param nValue The value to write.
  1101.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1102.    * flag will not be set and thus the entry will not be written to
  1103.    * disk at deletion time.
  1104.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1105.    *  application specific config file, but to the global KDE config file.
  1106.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1107.    *  when writing it back.
  1108.    */
  1109.   void writeEntry( const char *pKey, long nValue,
  1110.                       bool bPersistent = true, bool bGlobal = false,
  1111.                       bool bNLS = false );
  1112.  
  1113.   /**
  1114.    * Writes a (key/value) pair.
  1115.    * Same as above, but writes an unsigned long numerical value.
  1116.    *
  1117.    * @param pKey The key to write.
  1118.    * @param nValue The value to write.
  1119.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1120.    * flag will not be set and thus the entry will not be written to
  1121.    * disk at deletion time.
  1122.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1123.    *  application specific config file, but to the global KDE config file.
  1124.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1125.    *  when writing it back.
  1126.    */
  1127.   void writeEntry( const QString& pKey, unsigned long nValue,
  1128.                       bool bPersistent = true, bool bGlobal = false,
  1129.                       bool bNLS = false );
  1130.   /**
  1131.    * Writes a (key/value) pair.
  1132.    * Same as above, but writes an unsigned long numerical value.
  1133.    *
  1134.    * @param pKey The key to write.
  1135.    * @param nValue The value to write.
  1136.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1137.    * flag will not be set and thus the entry will not be written to
  1138.    * disk at deletion time.
  1139.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1140.    *  application specific config file, but to the global KDE config file.
  1141.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1142.    *  when writing it back.
  1143.    */
  1144.   void writeEntry( const char *pKey, unsigned long nValue,
  1145.                       bool bPersistent = true, bool bGlobal = false,
  1146.                       bool bNLS = false );
  1147.  
  1148.   /**
  1149.    * Writes a (key/value) pair.
  1150.    * Same as above, but write a 64-bit numerical value.
  1151.    *
  1152.    * @param pKey The key to write.
  1153.    * @param nValue The value to write.
  1154.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1155.    * flag will not be set and thus the entry will not be written to
  1156.    * disk at deletion time.
  1157.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1158.    *  application specific config file, but to the global KDE config file.
  1159.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1160.    *  when writing it back.
  1161.    */
  1162.   void writeEntry( const QString& pKey, Q_INT64 nValue,
  1163.                       bool bPersistent = true, bool bGlobal = false,
  1164.                       bool bNLS = false );
  1165.   /**
  1166.    * Writes a (key/value) pair.
  1167.    * Same as above, but write a long numerical value.
  1168.    *
  1169.    * @param pKey The key to write.
  1170.    * @param nValue The value to write.
  1171.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1172.    * flag will not be set and thus the entry will not be written to
  1173.    * disk at deletion time.
  1174.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1175.    *  application specific config file, but to the global KDE config file.
  1176.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1177.    *  when writing it back.
  1178.    */
  1179.   void writeEntry( const char *pKey, Q_INT64 nValue,
  1180.                       bool bPersistent = true, bool bGlobal = false,
  1181.                       bool bNLS = false );
  1182.  
  1183.   /**
  1184.    * Writes a (key/value) pair.
  1185.    * Same as above, but writes an unsigned 64-bit numerical value.
  1186.    *
  1187.    * @param pKey The key to write.
  1188.    * @param nValue The value to write.
  1189.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1190.    * flag will not be set and thus the entry will not be written to
  1191.    * disk at deletion time.
  1192.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1193.    *  application specific config file, but to the global KDE config file.
  1194.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1195.    *  when writing it back.
  1196.    */
  1197.   void writeEntry( const QString& pKey, Q_UINT64 nValue,
  1198.                       bool bPersistent = true, bool bGlobal = false,
  1199.                       bool bNLS = false );
  1200.   /**
  1201.    * Writes a (key/value) pair.
  1202.    * Same as above, but writes an unsigned 64-bit numerical value.
  1203.    *
  1204.    * @param pKey The key to write.
  1205.    * @param nValue The value to write.
  1206.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1207.    * flag will not be set and thus the entry will not be written to
  1208.    * disk at deletion time.
  1209.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1210.    *  application specific config file, but to the global KDE config file.
  1211.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1212.    *  when writing it back.
  1213.    */
  1214.   void writeEntry( const char *pKey, Q_UINT64 nValue,
  1215.                       bool bPersistent = true, bool bGlobal = false,
  1216.                       bool bNLS = false );
  1217.  
  1218.   /**
  1219.    * Writes a (key/value) pair.
  1220.    * Same as above, but writes a floating-point value.
  1221.    * @param pKey The key to write.
  1222.    * @param nValue The value to write.
  1223.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1224.    * flag will not be set and thus the entry will not be written to
  1225.    * disk at deletion time.
  1226.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1227.    *  application specific config file, but to the global KDE config file.
  1228.    * @param format      @p format determines the format to which the value
  1229.    *  is converted. Default is 'g'.
  1230.    * @param precision   @p precision sets the precision with which the
  1231.    *  value is converted. Default is 6 as in QString.
  1232.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1233.    *  when writing it back.
  1234.    */
  1235.   void writeEntry( const QString& pKey, double nValue,
  1236.                       bool bPersistent = true, bool bGlobal = false,
  1237.                       char format = 'g', int precision = 6,
  1238.                       bool bNLS = false );
  1239.   /**
  1240.    * Writes a (key/value) pair.
  1241.    * Same as above, but writes a floating-point value.
  1242.    * @param pKey The key to write.
  1243.    * @param nValue The value to write.
  1244.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1245.    * flag will not be set and thus the entry will not be written to
  1246.    * disk at deletion time.
  1247.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1248.    *  application specific config file, but to the global KDE config file.
  1249.    * @param format      @p format determines the format to which the value
  1250.    *  is converted. Default is 'g'.
  1251.    * @param precision   @p precision sets the precision with which the
  1252.    *  value is converted. Default is 6 as in QString.
  1253.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1254.    *  when writing it back.
  1255.    */
  1256.   void writeEntry( const char *pKey, double nValue,
  1257.                       bool bPersistent = true, bool bGlobal = false,
  1258.                       char format = 'g', int precision = 6,
  1259.                       bool bNLS = false );
  1260.  
  1261.   /**
  1262.    * Writes a (key/value) pair.
  1263.    * Same as above, but writes a boolean value.
  1264.    *
  1265.    * @param pKey The key to write.
  1266.    * @param bValue The value to write.
  1267.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1268.    * flag will not be set and thus the entry will not be written to
  1269.    * disk at deletion time.
  1270.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1271.    *  application specific config file, but to the global KDE config file.
  1272.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1273.    *  when writing it back.
  1274.    */
  1275.   void writeEntry( const QString& pKey, bool bValue,
  1276.                       bool bPersistent = true, bool bGlobal = false,
  1277.                       bool bNLS = false );
  1278.   /**
  1279.    * Writes a (key/value) pair.
  1280.    * Same as above, but writes a boolean value.
  1281.    *
  1282.    * @param pKey The key to write.
  1283.    * @param bValue The value to write.
  1284.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1285.    * flag will not be set and thus the entry will not be written to
  1286.    * disk at deletion time.
  1287.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1288.    *  application specific config file, but to the global KDE config file.
  1289.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1290.    *  when writing it back.
  1291.    */
  1292.   void writeEntry( const char *pKey, bool bValue,
  1293.                       bool bPersistent = true, bool bGlobal = false,
  1294.                       bool bNLS = false );
  1295.  
  1296.   /**
  1297.    * Writes a (key/value) pair.
  1298.    * Same as above, but writes a font value.
  1299.    *
  1300.    * @param pKey The key to write.
  1301.    * @param rFont The font value to write.
  1302.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1303.    * flag will not be set and thus the entry will not be written to
  1304.    * disk at deletion time.
  1305.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1306.    *  application specific config file, but to the global KDE config file.
  1307.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1308.    *  when writing it back.
  1309.    */
  1310.   void writeEntry( const QString& pKey, const QFont& rFont,
  1311.                       bool bPersistent = true, bool bGlobal = false,
  1312.                       bool bNLS = false );
  1313.   /**
  1314.    * Writes a (key/value) pair.
  1315.    * Same as above, but writes a font value.
  1316.    *
  1317.    * @param pKey The key to write.
  1318.    * @param rFont The font value to write.
  1319.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1320.    * flag will not be set and thus the entry will not be written to
  1321.    * disk at deletion time.
  1322.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1323.    *  application specific config file, but to the global KDE config file.
  1324.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1325.    *  when writing it back.
  1326.    */
  1327.   void writeEntry( const char *pKey, const QFont& rFont,
  1328.                       bool bPersistent = true, bool bGlobal = false,
  1329.                       bool bNLS = false );
  1330.  
  1331.   /**
  1332.    * Writes a (key/value) pair.
  1333.    * Same as above, but write a color entry.
  1334.    *
  1335.    * Note: Unlike the other writeEntry() functions, the old value is
  1336.    * _not_ returned here!
  1337.    *
  1338.    * @param pKey The key to write.
  1339.    * @param rColor The color value to write.
  1340.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1341.    * flag will not be set and thus the entry will not be written to
  1342.    * disk at deletion time.
  1343.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1344.    *  application specific config file, but to the global KDE config file.
  1345.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1346.    *  when writing it back.
  1347.    */
  1348.   void writeEntry( const QString& pKey, const QColor& rColor,
  1349.                    bool bPersistent = true, bool bGlobal = false,
  1350.                    bool bNLS = false );
  1351.   /**
  1352.    * Writes a (key/value) pair.
  1353.    * Same as above, but write a color entry.
  1354.    *
  1355.    * Note: Unlike the other writeEntry() functions, the old value is
  1356.    * _not_ returned here!
  1357.    *
  1358.    * @param pKey The key to write.
  1359.    * @param rColor The color value to write.
  1360.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1361.    * flag will not be set and thus the entry will not be written to
  1362.    * disk at deletion time.
  1363.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1364.    *  application specific config file, but to the global KDE config file.
  1365.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1366.    *  when writing it back.
  1367.    */
  1368.   void writeEntry( const char *pKey, const QColor& rColor,
  1369.                    bool bPersistent = true, bool bGlobal = false,
  1370.                    bool bNLS = false );
  1371.  
  1372.   /**
  1373.    * Writes a (key/value) pair.
  1374.    * Same as above, but writes a date and time entry.
  1375.    *
  1376.    * Note: Unlike the other writeEntry() functions, the old value is
  1377.    * @em not returned here!
  1378.    *
  1379.    * @param pKey The key to write.
  1380.    * @param rDateTime The date and time value to write.
  1381.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1382.    * flag will not be set and thus the entry will not be written to
  1383.    * disk at deletion time.
  1384.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1385.    *  application specific config file, but to the global KDE config file.
  1386.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1387.    *  when writing it back.
  1388.    */
  1389.   void writeEntry( const QString& pKey, const QDateTime& rDateTime,
  1390.                    bool bPersistent = true, bool bGlobal = false,
  1391.                    bool bNLS = false );
  1392.   /**
  1393.    * Writes a (key/value) pair.
  1394.    * Same as above, but writes a date and time entry.
  1395.    *
  1396.    * Note: Unlike the other writeEntry() functions, the old value is
  1397.    * @em not returned here!
  1398.    *
  1399.    * @param pKey The key to write.
  1400.    * @param rDateTime The date and time value to write.
  1401.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1402.    * flag will not be set and thus the entry will not be written to
  1403.    * disk at deletion time.
  1404.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1405.    *  application specific config file, but to the global KDE config file.
  1406.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1407.    *  when writing it back.
  1408.    */
  1409.   void writeEntry( const char *pKey, const QDateTime& rDateTime,
  1410.                    bool bPersistent = true, bool bGlobal = false,
  1411.                    bool bNLS = false );
  1412.  
  1413.  
  1414.   /**
  1415.    * Writes a (key/value) pair.
  1416.    * Same as above, but writes a rectangle.
  1417.    *
  1418.    * Note: Unlike the other writeEntry() functions, the old value is
  1419.    * _not_ returned here!
  1420.    *
  1421.    * @param pKey The key to write.
  1422.    * @param rValue The rectangle value to write.
  1423.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1424.    * flag will not be set and thus the entry will not be written to
  1425.    * disk at deletion time.
  1426.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1427.    *  application specific config file, but to the global KDE config file.
  1428.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1429.    *  when writing it back.
  1430.    */
  1431.   void writeEntry( const QString& pKey, const QRect& rValue,
  1432.                    bool bPersistent = true, bool bGlobal = false,
  1433.                    bool bNLS = false );
  1434.   /**
  1435.    * Writes a (key/value) pair.
  1436.    * Same as above, but writes a rectangle.
  1437.    *
  1438.    * Note: Unlike the other writeEntry() functions, the old value is
  1439.    * _not_ returned here!
  1440.    *
  1441.    * @param pKey The key to write.
  1442.    * @param rValue The rectangle value to write.
  1443.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1444.    * flag will not be set and thus the entry will not be written to
  1445.    * disk at deletion time.
  1446.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1447.    *  application specific config file, but to the global KDE config file.
  1448.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1449.    *  when writing it back.
  1450.    */
  1451.   void writeEntry( const char *pKey, const QRect& rValue,
  1452.                    bool bPersistent = true, bool bGlobal = false,
  1453.                    bool bNLS = false );
  1454.  
  1455.   /**
  1456.    * Writes a (key/value) pair.
  1457.    * Same as above, but writes a point.
  1458.    *
  1459.    * Note: Unlike the other writeEntry() functions, the old value is
  1460.    * _not_ returned here!
  1461.    *
  1462.    * @param pKey The key to write.
  1463.    * @param rValue The point value to write.
  1464.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1465.    * flag will not be set and thus the entry will not be written to
  1466.    * disk at deletion time.
  1467.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1468.    *  application specific config file, but to the global KDE config file.
  1469.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1470.    *  when writing it back.
  1471.    */
  1472.   void writeEntry( const QString& pKey, const QPoint& rValue,
  1473.                    bool bPersistent = true, bool bGlobal = false,
  1474.                    bool bNLS = false );
  1475.   /**
  1476.    * Writes a (key/value) pair.
  1477.    * Same as above, but writes a point.
  1478.    *
  1479.    * Note: Unlike the other writeEntry() functions, the old value is
  1480.    * _not_ returned here!
  1481.    *
  1482.    * @param pKey The key to write.
  1483.    * @param rValue The point value to write.
  1484.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1485.    * flag will not be set and thus the entry will not be written to
  1486.    * disk at deletion time.
  1487.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1488.    *  application specific config file, but to the global KDE config file.
  1489.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1490.    *  when writing it back.
  1491.    */
  1492.   void writeEntry( const char *pKey, const QPoint& rValue,
  1493.                    bool bPersistent = true, bool bGlobal = false,
  1494.                    bool bNLS = false );
  1495.  
  1496.   /**
  1497.    * Writes a (key/value) pair.
  1498.    * Same as above, but writes a size.
  1499.    *
  1500.    * Note: Unlike the other writeEntry() functions, the old value is
  1501.    * _not_ returned here!
  1502.    *
  1503.    * @param pKey The key to write.
  1504.    * @param rValue The size value to write.
  1505.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1506.    * flag will not be set and thus the entry will not be written to
  1507.    * disk at deletion time.
  1508.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1509.    *  application specific config file, but to the global KDE config file.
  1510.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1511.    *  when writing it back.
  1512.    */
  1513.   void writeEntry( const QString& pKey, const QSize& rValue,
  1514.                    bool bPersistent = true, bool bGlobal = false,
  1515.                    bool bNLS = false );
  1516.   /**
  1517.    * Writes a (key/value) pair.
  1518.    * Same as above, but writes a size.
  1519.    *
  1520.    * Note: Unlike the other writeEntry() functions, the old value is
  1521.    * _not_ returned here!
  1522.    *
  1523.    * @param pKey The key to write.
  1524.    * @param rValue The size value to write.
  1525.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1526.    * flag will not be set and thus the entry will not be written to
  1527.    * disk at deletion time.
  1528.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1529.    *  application specific config file, but to the global KDE config file.
  1530.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1531.    *  when writing it back.
  1532.    */
  1533.   void writeEntry( const char *pKey, const QSize& rValue,
  1534.                    bool bPersistent = true, bool bGlobal = false,
  1535.                    bool bNLS = false );
  1536.  
  1537.   /**
  1538.    * Writes a file path.
  1539.    *
  1540.    * It is checked whether the path is located under $HOME. If so the
  1541.    * path is written out with the user's home-directory replaced with
  1542.    * $HOME. The path should be read back with readPathEntry()
  1543.    *
  1544.    * @param pKey The key to write.
  1545.    * @param path The path to write.
  1546.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1547.    * flag will not be set and thus the entry will not be written to
  1548.    * disk at deletion time.
  1549.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1550.    *  application specific config file, but to the global KDE config file.
  1551.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1552.    *  when writing it back.
  1553.    */
  1554.   void writePathEntry( const QString& pKey, const QString & path,
  1555.                        bool bPersistent = true, bool bGlobal = false,
  1556.                        bool bNLS = false );
  1557.   /**
  1558.    * Writes a file path.
  1559.    *
  1560.    * It is checked whether the path is located under $HOME. If so the
  1561.    * path is written out with the user's home-directory replaced with
  1562.    * $HOME. The path should be read back with readPathEntry()
  1563.    *
  1564.    * @param pKey The key to write.
  1565.    * @param path The path to write.
  1566.    * @param bPersistent If @p bPersistent is false, the entry's dirty
  1567.    * flag will not be set and thus the entry will not be written to
  1568.    * disk at deletion time.
  1569.    * @param bGlobal     If @p bGlobal is true, the pair is not saved to the
  1570.    *  application specific config file, but to the global KDE config file.
  1571.    * @param bNLS        If @p bNLS is true, the locale tag is added to the key
  1572.    *  when writing it back.
  1573.    */
  1574.   void writePathEntry( const char *pKey, const QString & path,
  1575.                        bool bPersistent = true, bool bGlobal = false,
  1576.                        bool bNLS = false );
  1577.  
  1578.   /**
  1579.    * writePathEntry() overridden to accept a list of paths (strings).
  1580.    *
  1581.    * It is checked whether the paths are located under $HOME. If so each of
  1582.    * the paths are written out with the user's home-directory replaced with
  1583.    * $HOME. The paths should be read back with readPathListEntry()
  1584.    *
  1585.    * @param pKey The key to write
  1586.    * @param rValue The list to write
  1587.    * @param sep  The list separator (default is ",").
  1588.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  1589.    *                    will not be set and thus the entry will not be
  1590.    *                    written to disk at deletion time.
  1591.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  1592.    *                application specific config file, but to the
  1593.    *                global KDE config file.
  1594.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  1595.    *             when writing it back.
  1596.    *
  1597.    * @see  writePathEntry()
  1598.    * @see  readPathListEntry()
  1599.    * @since 3.1.3
  1600.    */
  1601.   void writePathEntry( const QString& pKey, const QStringList &rValue,
  1602.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  1603.   /**
  1604.    * writePathEntry() overridden to accept a list of paths (strings).
  1605.    *
  1606.    * It is checked whether the paths are located under $HOME. If so each of
  1607.    * the paths are written out with the user's home-directory replaced with
  1608.    * $HOME. The paths should be read back with readPathListEntry()
  1609.    *
  1610.    * @param pKey The key to write
  1611.    * @param rValue The list to write
  1612.    * @param sep  The list separator (default is ",").
  1613.    * @param bPersistent If @p bPersistent is false, the entry's dirty flag
  1614.    *                    will not be set and thus the entry will not be
  1615.    *                    written to disk at deletion time.
  1616.    * @param bGlobal If @p bGlobal is true, the pair is not saved to the
  1617.    *                application specific config file, but to the
  1618.    *                global KDE config file.
  1619.    * @param bNLS If @p bNLS is true, the locale tag is added to the key
  1620.    *             when writing it back.
  1621.    *
  1622.    * @see  writePathEntry()
  1623.    * @see  readPathListEntry()
  1624.    * @since 3.1.3
  1625.    */
  1626.   void writePathEntry( const char *pKey, const QStringList &rValue,
  1627.            char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false );
  1628.  
  1629.  
  1630.   /**
  1631.    * Deletes the entry specified by @p pKey in the current group.
  1632.    *
  1633.    * @param pKey The key to delete.
  1634.    * @param bGlobal     If @p bGlobal is true, the pair is not removed from the
  1635.    *  application specific config file, but to the global KDE config file.
  1636.    * @param bNLS        If @p bNLS is true, the key with the locale tag is removed.
  1637.    */
  1638.    void deleteEntry( const QString& pKey,
  1639.                    bool bNLS = false, bool bGlobal = false);
  1640.   /**
  1641.    * Deletes the entry specified by @p pKey in the current group.
  1642.    *
  1643.    * @param pKey The key to delete.
  1644.    * @param bGlobal     If @p bGlobal is true, the pair is not removed from the
  1645.    *  application specific config file, but from the global KDE config file.
  1646.    * @param bNLS        If @p bNLS is true, the key with the locale tag is removed.
  1647.    */
  1648.    void deleteEntry( const char *pKey,
  1649.                    bool bNLS = false, bool bGlobal = false);
  1650.  
  1651.   /**
  1652.    * Deletes a configuration entry group
  1653.    *
  1654.    * If the group is not empty and bDeep is false, nothing gets
  1655.    * deleted and false is returned.
  1656.    * If this group is the current group and it is deleted, the
  1657.    * current group is undefined and should be set with setGroup()
  1658.    * before the next operation on the configuration object.
  1659.    *
  1660.    * @param group The name of the group
  1661.    * @param bDeep Specify whether non-empty groups should be completely
  1662.    *        deleted (including their entries).
  1663.    * @param bGlobal     If @p bGlobal is true, the group is not removed from the
  1664.    *  application specific config file, but from the global KDE config file.
  1665.    * @return If the group is not empty and bDeep is false,
  1666.    *         deleteGroup returns false.
  1667.    */
  1668.   bool deleteGroup( const QString& group, bool bDeep = true, bool bGlobal = false );
  1669.  
  1670.  
  1671.   /**
  1672.    * Turns on or off "dollar  expansion" (see KConfigBase introduction)
  1673.    *  when reading config entries.
  1674.    * Dollar sign expansion is initially OFF.
  1675.    *
  1676.    * @param _bExpand Tf true, dollar expansion is turned on.
  1677.    */
  1678.   void setDollarExpansion( bool _bExpand = true ) { bExpand = _bExpand; }
  1679.  
  1680.   /**
  1681.    * Returns whether dollar expansion is on or off.  It is initially OFF.
  1682.    *
  1683.    * @return true if dollar expansion is on.
  1684.    */
  1685.   bool isDollarExpansion() const { return bExpand; }
  1686.  
  1687.   /**
  1688.    * Mark the config object as "clean," i.e. don't write dirty entries
  1689.    * at destruction time. If @p bDeep is false, only the global dirty
  1690.    * flag of the KConfig object gets cleared. If you then call
  1691.    * writeEntry() again, the global dirty flag is set again and all
  1692.    * dirty entries will be written at a subsequent sync() call.
  1693.    *
  1694.    * Classes that derive from KConfigBase should override this
  1695.    * method and implement storage-specific behavior, as well as
  1696.    * calling the KConfigBase::rollback() explicitly in the initializer.
  1697.    *
  1698.    * @param bDeep If true, the dirty flags of all entries are cleared,
  1699.    *        as well as the global dirty flag.
  1700.    */
  1701.   virtual void rollback( bool bDeep = true );
  1702.  
  1703.   /**
  1704.    * Flushes all changes that currently reside only in memory
  1705.    * back to disk / permanent storage. Dirty configuration entries are
  1706.    * written to the most specific file available.
  1707.    *
  1708.    * Asks the back end to flush out all pending writes, and then calls
  1709.    * rollback().  No changes are made if the object has @p readOnly
  1710.    * status.
  1711.    *
  1712.    * You should call this from your destructor in derivative classes.
  1713.    *
  1714.    * @see rollback(), #isReadOnly()
  1715.    */
  1716.   virtual void sync();
  1717.  
  1718.   /**
  1719.    * Checks whether the config file has any dirty (modified) entries.
  1720.    * @return true if the config file has any dirty (modified) entries.
  1721.    */
  1722.   bool isDirty() const { return bDirty; }
  1723.  
  1724.   /**
  1725.    * Sets the config object's read-only status.
  1726.    *
  1727.    * @param _ro If true, the config object will not write out any
  1728.    *        changes to disk even if it is destroyed or sync() is called.
  1729.    *
  1730.    */
  1731.   virtual void setReadOnly(bool _ro) { bReadOnly = _ro; }
  1732.  
  1733.    /**
  1734.     * Returns the read-only status of the config object.
  1735.     *
  1736.     * @return The read-only status.
  1737.     */
  1738.   bool isReadOnly() const { return bReadOnly; }
  1739.  
  1740.   /**
  1741.    * Checks whether the key has an entry in the currently active group.
  1742.    * Use this to determine whether a key is not specified for the current
  1743.    * group (hasKey() returns false). Keys with null data are considered
  1744.    * nonexistent.
  1745.    *
  1746.    * @param key The key to search for.
  1747.    * @return If true, the key is available.
  1748.    */
  1749.   bool hasKey( const QString& key ) const;
  1750.  
  1751.   /**
  1752.    * Returns a map (tree) of entries for all entries in a particular
  1753.    * group.  Only the actual entry string is returned, none of the
  1754.    * other internal data should be included.
  1755.    *
  1756.    * @param group A group to get keys from.
  1757.    * @return A map of entries in the group specified, indexed by key.
  1758.    *         The returned map may be empty if the group is not found.
  1759.    * @see   QMap
  1760.    */
  1761.   virtual QMap<QString, QString> entryMap(const QString &group) const = 0;
  1762.  
  1763.   /**
  1764.    * Reparses all configuration files. This is useful for programs
  1765.    * that use stand alone graphical configuration tools. The base
  1766.    * method implemented here only clears the group list and then
  1767.    * appends the default group.
  1768.    *
  1769.    * Derivative classes should clear any internal data structures and
  1770.    * then simply call parseConfigFiles() when implementing this
  1771.    * method.
  1772.    *
  1773.    * @see  parseConfigFiles()
  1774.    */
  1775.   virtual void reparseConfiguration() = 0;
  1776.  
  1777.   /**
  1778.    * Checks whether this configuration file can be modified.
  1779.    * @return whether changes may be made to this configuration file.
  1780.    */
  1781.   bool isImmutable() const;
  1782.  
  1783.   /**
  1784.    * Checks whether it is possible to change the given group.
  1785.    * @param group the group to check
  1786.    * @return whether changes may be made to @p group in this configuration
  1787.    * file.
  1788.    */
  1789.   bool groupIsImmutable(const QString &group) const;
  1790.  
  1791.   /**
  1792.    * Checks whether it is possible to change the given entry.
  1793.    * @param key the key to check
  1794.    * @return whether the entry @p key may be changed in the current group
  1795.    * in this configuration file.
  1796.    */
  1797.   bool entryIsImmutable(const QString &key) const;
  1798.  
  1799.   /**
  1800.    * Possible return values for getConfigState().
  1801.    *
  1802.    * @see  getConfigState()
  1803.    */
  1804.   enum ConfigState { NoAccess, ReadOnly, ReadWrite };
  1805.  
  1806.   /**
  1807.    * Returns the state of the app-config object.
  1808.    *
  1809.    * Possible return values
  1810.    * are NoAccess (the application-specific config file could not be
  1811.    * opened neither read-write nor read-only), ReadOnly (the
  1812.    * application-specific config file is opened read-only, but not
  1813.    * read-write) and ReadWrite (the application-specific config
  1814.    * file is opened read-write).
  1815.    *
  1816.    * @see  ConfigState()
  1817.    * @return the state of the app-config object
  1818.    */
  1819.   ConfigState getConfigState() const;
  1820.  
  1821.   /**
  1822.    * Check whether the config files are writable.
  1823.    * @param warnUser Warn the user if the configuration files are not writable.
  1824.    * @return Indicates that all of the configuration files used are writable.
  1825.    * @since 3.2
  1826.    */
  1827.   bool checkConfigFilesWritable(bool warnUser);
  1828.  
  1829.   /**
  1830.    * When set, all readEntry and readXXXEntry calls return the system
  1831.    * wide (default) values instead of the user's preference.
  1832.    * This is off by default.
  1833.    * @since 3.2
  1834.    */
  1835.   void setReadDefaults(bool b);
  1836.  
  1837.   /**
  1838.    * @returns true if all readEntry and readXXXEntry calls return the system
  1839.    * wide (default) values instead of the user's preference.
  1840.    * @since 3.2
  1841.    */
  1842.   bool readDefaults() const;
  1843.  
  1844.   /**
  1845.    * Reverts the entry with key @p key in the current group in the
  1846.    * application specific config file to either the system wide (default)
  1847.    * value or the value specified in the global KDE config file.
  1848.    *
  1849.    * To revert entries in the global KDE config file, the global KDE config
  1850.    * file should be opened explicitly in a separate config object.
  1851.    *
  1852.    * @param key The key of the entry to revert.
  1853.    * @since 3.2
  1854.    */
  1855.   void revertToDefault(const QString &key);
  1856.  
  1857.   /**
  1858.    * Returns whether a default is specified for an entry in either the
  1859.    * system wide configuration file or the global KDE config file.
  1860.    *
  1861.    * If an application computes a default value at runtime for
  1862.    * a certain entry, e.g. like:
  1863.    * \code
  1864.    * QColor computedDefault = kapp->palette().color(QPalette::Active, QColorGroup::Text)
  1865.    * QColor color = config->readEntry(key, computedDefault);
  1866.    * \encode
  1867.    *
  1868.    * Then it may wish to make the following check before
  1869.    * writing back changes:
  1870.    * \code
  1871.    * if ( (value == computedDefault) && !config->hasDefault(key) )
  1872.    *    config->revertToDefault(key)
  1873.    * else
  1874.    *    config->writeEntry(key, value)
  1875.    * \endcode
  1876.    *
  1877.    * This ensures that as long as the entry is not modified to differ from 
  1878.    * the computed default, the application will keep using the computed default
  1879.    * and will follow changes the computed default makes over time.
  1880.    * @param key The key of the entry to check.
  1881.    * @since 3.2
  1882.    */
  1883.   bool hasDefault(const QString &key) const;
  1884.  
  1885. protected:
  1886.   /**
  1887.    * Reads the locale and put in the configuration data struct.
  1888.    * Note that this should be done in the constructor, but this is not
  1889.    * possible due to some mutual dependencies in KApplication::init()
  1890.    */
  1891.   void setLocale();
  1892.  
  1893.   /**
  1894.    * Sets the global dirty flag of the config object
  1895.    *
  1896.    * @param _bDirty How to mark the object's dirty status
  1897.    */
  1898.   virtual void setDirty(bool _bDirty = true) { bDirty = _bDirty; }
  1899.  
  1900.   /**
  1901.    * Parses all configuration files for a configuration object.
  1902.    *
  1903.    * The actual parsing is done by the associated KConfigBackEnd.
  1904.    */
  1905.   virtual void parseConfigFiles();
  1906.  
  1907.   /**
  1908.    * Returns a map (tree) of the entries in the specified group.
  1909.    * This may or may not return all entries that belong to the
  1910.    * config object.  The only guarantee that you are given is that
  1911.    * any entries that are dirty (i.e. modified and not yet written back
  1912.    * to the disk) will be contained in the map.  Some derivative
  1913.    * classes may choose to return everything.
  1914.    *
  1915.    * Do not use this function, the implementation / return type are
  1916.    * subject to change.
  1917.    *
  1918.    * @param pGroup The group to provide a KEntryMap for.
  1919.    * @return The map of the entries in the group.
  1920.    * @internal
  1921.    */
  1922.   virtual KEntryMap internalEntryMap( const QString& pGroup ) const = 0;
  1923.  
  1924.   /**
  1925.    * Returns a map (tree) of the entries in the tree.
  1926.    *
  1927.    * Do not use this function, the implementation / return type are
  1928.    * subject to change.
  1929.    *
  1930.    * @return A map of the entries in the tree.
  1931.    *
  1932.    * @internal
  1933.    *
  1934.    */
  1935.   virtual KEntryMap internalEntryMap() const = 0;
  1936.  
  1937.   /**
  1938.    * Inserts a (key/value) pair into the internal storage mechanism of
  1939.    * the configuration object. Classes that derive from KConfigBase
  1940.    * will need to implement this method in a storage-specific manner.
  1941.    *
  1942.    * Do not use this function, the implementation / return type are
  1943.    * subject to change.
  1944.    *
  1945.    * @param _key The key to insert.  It contains information both on
  1946.    *        the group of the key and the key itself. If the key already
  1947.    *        exists, the old value will be replaced.
  1948.    * @param _data the KEntry that is to be stored.
  1949.    * @param _checkGroup When false, assume that the group already exists.
  1950.    * @internal
  1951.    */
  1952.   virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true) = 0;
  1953.  
  1954.   /**
  1955.    * Looks up an entry in the config object's internal structure.
  1956.    * Classes that derive from KConfigBase will need to implement this
  1957.    * method in a storage-specific manner.
  1958.    *
  1959.    * Do not use this function, the implementation and return type are
  1960.    * subject to change.
  1961.    *
  1962.    * @param _key The key to look up  It contains information both on
  1963.    *        the group of the key and the entry's key itself.
  1964.    * @return The KEntry value (data) found for the key.  @p KEntry.aValue
  1965.    * will be the null string if nothing was located.
  1966.    * @internal
  1967.    */
  1968.   virtual KEntry lookupData(const KEntryKey &_key) const = 0;
  1969.  
  1970.   virtual bool internalHasGroup(const QCString &group) const = 0;
  1971.  
  1972.   /**
  1973.    * A back end for loading/saving to disk in a particular format.
  1974.    */
  1975.   KConfigBackEnd *backEnd;
  1976. public:
  1977.   /**
  1978.    * Overloaded public methods:
  1979.    */
  1980.   void setGroup( const QCString &pGroup );
  1981.   void setGroup( const char *pGroup );
  1982.   bool hasGroup(const QCString &_pGroup) const;
  1983.   bool hasGroup(const char *_pGroup) const;
  1984.   bool hasKey( const char *pKey ) const;
  1985.  
  1986. protected:
  1987.   QCString readEntryUtf8( const char *pKey) const;
  1988.  
  1989.   /**
  1990.    * The currently selected group. */
  1991.   QCString mGroup;
  1992.  
  1993.   /**
  1994.    * The locale to retrieve keys under if possible, i.e en_US or fr.  */
  1995.   QCString aLocaleString;
  1996.  
  1997.   /**
  1998.    * Indicates whether there are any dirty entries in the config object
  1999.    * that need to be written back to disk. */
  2000.   bool bDirty;
  2001.  
  2002.   bool bLocaleInitialized;
  2003.   bool bReadOnly;           // currently only used by KSimpleConfig
  2004.   mutable bool bExpand;     // whether dollar expansion is used
  2005.  
  2006. protected:
  2007.   virtual void virtual_hook( int id, void* data );
  2008. private:
  2009.   class KConfigBasePrivate;
  2010.   KConfigBasePrivate *d;
  2011.  
  2012.   void writeEntry( const char *pKey, const QString &rValue,
  2013.     bool bPersistent, bool bGlobal, bool bNLS, bool bExpand );
  2014.   void writeEntry( const char *pKey, const QStringList &rValue,
  2015.     char sep, bool bPersistent, bool bGlobal, bool bNLS, bool bExpand );
  2016.  
  2017. };
  2018.  
  2019. class KConfigGroupSaverPrivate;
  2020.  
  2021. /**
  2022.   * Helper class to facilitate working with KConfig / KSimpleConfig
  2023.   * groups.
  2024.   *
  2025.   * Careful programmers always set the group of a
  2026.   * KConfig KSimpleConfig object to the group they want to read from
  2027.   * and set it back to the old one of afterwards. This is usually
  2028.   * written as:
  2029.   * \code
  2030.   *
  2031.   * QString oldgroup config->group();
  2032.   * config->setGroup( "TheGroupThatIWant" );
  2033.   * ...
  2034.   * config->writeEntry( "Blah", "Blubb" );
  2035.   *
  2036.   * config->setGroup( oldgroup );
  2037.   * \endcode
  2038.   *
  2039.   * In order to facilitate this task, you can use
  2040.   * KConfigGroupSaver. Simply construct such an object ON THE STACK
  2041.   * when you want to switch to a new group. Then, when the object goes
  2042.   * out of scope, the group will automatically be restored. If you
  2043.   * want to use several different groups within a function or method,
  2044.   * you can still use KConfigGroupSaver: Simply enclose all work with
  2045.   * one group (including the creation of the KConfigGroupSaver object)
  2046.   * in one block.
  2047.   *
  2048.   * @deprecated This class is deprecated and will be removed in KDE 4.
  2049.   * KConfigGroup provides similar functionality in a more object oriented
  2050.   * way.
  2051.   *
  2052.   * @author Matthias Kalle Dalheimer <kalle@kde.org>
  2053.   * @see KConfigBase, KConfig, KSimpleConfig, KConfigGroup
  2054.   * @short Helper class for easier use of KConfig/KSimpleConfig groups
  2055.   */
  2056.  
  2057. class KDECORE_EXPORT KConfigGroupSaver // KDE4 remove
  2058. {
  2059. public:
  2060.   /**
  2061.    * Constructor. You pass a pointer to the KConfigBase-derived
  2062.    * object you want to work with and a string indicating the _new_
  2063.    * group.
  2064.    *
  2065.    * @param config The KConfigBase-derived object this
  2066.    *               KConfigGroupSaver works on.
  2067.    * @param group  The new group that the config object should switch to.
  2068.    */
  2069.   KConfigGroupSaver( KConfigBase* config, QString group )
  2070.       /* KDE 4 : make the second parameter const QString & */
  2071.       : _config(config), _oldgroup(config->group())
  2072.         { _config->setGroup( group ); }
  2073.  
  2074.   KConfigGroupSaver( KConfigBase* config, const char *group )
  2075.       : _config(config), _oldgroup(config->group())
  2076.         { _config->setGroup( group ); }
  2077.  
  2078.   KConfigGroupSaver( KConfigBase* config, const QCString &group )
  2079.       : _config(config), _oldgroup(config->group())
  2080.         { _config->setGroup( group ); }
  2081.  
  2082.   ~KConfigGroupSaver() { _config->setGroup( _oldgroup ); }
  2083.  
  2084.     KConfigBase* config() { return _config; };
  2085.  
  2086. private:
  2087.   KConfigBase* _config;
  2088.   QString _oldgroup;
  2089.  
  2090.   KConfigGroupSaver(const KConfigGroupSaver&);
  2091.   KConfigGroupSaver& operator=(const KConfigGroupSaver&);
  2092.  
  2093.   KConfigGroupSaverPrivate *d;
  2094. };
  2095.  
  2096. class KConfigGroupPrivate;
  2097.  
  2098. /**
  2099.  * A KConfigBase derived class for one specific group in a KConfig object.
  2100.  */
  2101. class KDECORE_EXPORT KConfigGroup: public KConfigBase
  2102. {
  2103. public:
  2104.    /**
  2105.     * Construct a config group corresponding to @p group in @p master.
  2106.     * @p group is the group name encoded in UTF-8.
  2107.     */
  2108.    KConfigGroup(KConfigBase *master, const QCString &group);
  2109.    /**
  2110.     * This is an overloaded constructor provided for convenience.
  2111.     * It behaves essentially like the above function.
  2112.     *
  2113.     * Construct a config group corresponding to @p group in @p master
  2114.     */
  2115.    KConfigGroup(KConfigBase *master, const QString &group);
  2116.    /**
  2117.     * This is an overloaded constructor provided for convenience.
  2118.     * It behaves essentially like the above function.
  2119.     *
  2120.     * Construct a config group corresponding to @p group in @p master
  2121.     * @p group is the group name encoded in UTF-8.
  2122.     */
  2123.    KConfigGroup(KConfigBase *master, const char * group);
  2124.  
  2125.    /**
  2126.     * Delete all entries in the entire group
  2127.     * @param bGlobal     If @p bGlobal is true, the entries are not removed
  2128.     *        from the application specific config file, but from the global
  2129.     *        KDE config file.
  2130.     */
  2131.    void deleteGroup(bool bGlobal = false);
  2132.  
  2133.    /**
  2134.    * Checks whether it is possible to change this group.
  2135.    * @return whether changes may be made to this group in this configuration
  2136.    * file.
  2137.    * @since 3.4
  2138.    */
  2139.   bool groupIsImmutable() const;
  2140.  
  2141.    // The following functions are reimplemented:
  2142.    virtual void setDirty(bool _bDirty);
  2143.    virtual void putData(const KEntryKey &_key, const KEntry &_data, bool _checkGroup = true);
  2144.    virtual KEntry lookupData(const KEntryKey &_key) const;
  2145.    virtual void sync();
  2146.  
  2147. private:
  2148.    // Hide the following members:
  2149.    void setGroup() { }
  2150.    void setDesktopGroup() { }
  2151.    void group() { }
  2152.    void hasGroup() { }
  2153.    void setReadOnly(bool) { }
  2154.    void isDirty() { }
  2155.  
  2156.    // The following members are not used.
  2157.    virtual QStringList groupList() const { return QStringList(); }
  2158.    virtual void rollback(bool) { }
  2159.    virtual void reparseConfiguration() { }
  2160.    virtual QMap<QString, QString> entryMap(const QString &) const
  2161.     { return QMap<QString,QString>(); }
  2162.    virtual KEntryMap internalEntryMap( const QString&) const
  2163.     { return KEntryMap(); }
  2164.    virtual KEntryMap internalEntryMap() const
  2165.     { return KEntryMap(); }
  2166.    virtual bool internalHasGroup(const QCString &) const
  2167.     { return false; }
  2168.  
  2169.    void getConfigState() { }
  2170.  
  2171.    KConfigBase *mMaster;
  2172. protected:
  2173.    virtual void virtual_hook( int id, void* data );
  2174. private:
  2175.    KConfigGroupPrivate* d;
  2176. };
  2177.  
  2178. #endif
  2179.