summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oconfig.h
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore/oconfig.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oconfig.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h
index becf70d..29c1f86 100644
--- a/libopie2/opiecore/oconfig.h
+++ b/libopie2/opiecore/oconfig.h
@@ -31,56 +31,64 @@
#ifndef OCONFIG_H
#define OCONFIG_H
//FIXME: Implement for X11 or reuse libqpe/Config there also?
//FIXME: Or rather use QSettings also for libqpe?
#include <qpe/config.h>
class QColor;
class QFont;
+namespace Opie {
+namespace Core {
+
/**
* A Configuration class based on the Qtopia @ref Config class
* featuring additional handling of color and font entries
*/
class OConfig : public Config
{
public:
/**
* Constructs a OConfig object with a @a name.
*/
OConfig( const QString &name, Domain domain = User );
/**
* Destructs the OConfig object.
*
* Writes back any dirty configuration entries, and destroys
* dynamically created objects.
*/
virtual ~OConfig();
/**
* @returns the name of the current group.
* The current group is used for searching keys and accessing entries.
+ * @todo make const
*/
const QString& group() { return git.key(); };
/**
* @returns a @ref QColor entry or a @a default value if the key is not found.
*/
QColor readColorEntry( const QString& key, const QColor* pDefault ) const;
/**
* @returns a @ref QFont value or a @a default value if the key is not found.
*/
QFont readFontEntry( const QString& key, const QFont* pDefault ) const;
+
+private:
+ class Private;
+ Private *d;
};
/**
* @brief Helper class for easier use of OConfig groups.
*
* Careful programmers always set the group of a
* @ref OConfig object to the group they want to read from
* and set it back to the old one of afterwards. This is usually
* written as:
* <pre>
*
* QString oldgroup config()->group();
@@ -127,15 +135,20 @@ class OConfigGroupSaver
* @todo make it not inline for bc reasons. See KDE BC guide
*/
~OConfigGroupSaver() { _config->setGroup( _oldgroup ); }
OConfig* config() { return _config; };
private:
OConfig* _config;
QString _oldgroup;
OConfigGroupSaver( const OConfigGroupSaver& );
OConfigGroupSaver& operator=( const OConfigGroupSaver& );
+
+ class Private;
+ Private *d;
};
+}
+}
#endif // OCONFIG_H