krootprop.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1997 Mark Donohoe (donohoe@kde.org) 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 #ifndef _KROOTPROP_H 00020 #define _KROOTPROP_H 00021 00022 typedef unsigned long Atom; 00023 00024 #include <qcolor.h> 00025 #include <qfont.h> 00026 #include <qmap.h> 00027 #include <qstringlist.h> 00028 00029 #include <kdelibs_export.h> 00030 00031 class KRootPropPrivate; 00032 00047 class KDECORE_EXPORT KRootProp 00048 { 00049 private: 00050 Atom atom; 00051 QMap<QString,QString> propDict; 00052 QString property_; 00053 bool dirty; 00054 KRootPropPrivate *d; 00055 00056 public: 00063 KRootProp( const QString& rProp = QString::null ); 00069 ~KRootProp(); 00070 00075 void setProp(const QString& rProp=QString()); 00080 QString prop() const; 00081 00088 void destroy(); 00089 00098 QString readEntry( const QString& rKey, 00099 const QString& pDefault = QString::null ) const ; 00100 00111 int readNumEntry( const QString& rKey, int nDefault = 0 ) const; 00112 00123 QFont readFontEntry( const QString& rKey, 00124 const QFont* pDefault = 0 ) const; 00125 00137 QColor readColorEntry( const QString& rKey, 00138 const QColor* pDefault = 0 ) const; 00139 00140 00153 QString writeEntry( const QString& rKey, const QString& rValue ); 00154 00163 QString writeEntry( const QString& rKey, int nValue ); 00164 00173 QString writeEntry( const QString& rKey, const QFont& rFont ); 00174 00183 QString writeEntry( const QString& rKey, const QColor& rColor ); 00184 00191 QString removeEntry(const QString& rKey); 00192 00197 QStringList listEntries() const; 00198 00204 void sync(); 00205 }; 00206 00207 #endif