Eneboo - Documentación para desarrolladores
src/qt/src/tools/qsettings.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qsettings.h   3.3.8   edited Jan 11 14:46 $
00003 **
00004 ** Definition of QSettings class
00005 **
00006 ** Created : 000626
00007 **
00008 ** Copyright (C) 2000-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the tools module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QSETTINGS_H
00039 #define QSETTINGS_H
00040 
00041 #ifndef QT_H
00042 #include "qdatetime.h"
00043 #include "qstringlist.h"
00044 #endif // QT_H
00045 
00046 #ifndef QT_NO_SETTINGS
00047 
00048 class QSettingsPrivate;
00049 
00050 
00051 class Q_EXPORT QSettings
00052 {
00053 public:
00054     enum Format {
00055         Native = 0,
00056         Ini
00057     };
00058     enum System {
00059         Unix = 0,
00060         Windows,
00061         Mac
00062     };
00063     enum Scope {
00064         User,
00065         Global
00066     };
00067 
00068     QSettings();
00069     QSettings( Format format );
00070 
00071     ~QSettings();
00072 
00073 #if !defined(Q_NO_BOOL_TYPE)
00074     bool        writeEntry( const QString &, bool );
00075 #endif
00076     bool        writeEntry( const QString &, double );
00077     bool        writeEntry( const QString &, int );
00078     bool        writeEntry( const QString &, const char * );
00079     bool        writeEntry( const QString &, const QString & );
00080     bool        writeEntry( const QString &, const QStringList & );
00081     bool        writeEntry( const QString &, const QStringList &, const QChar& sep );
00082 
00083     QStringList entryList(const QString &) const;
00084     QStringList subkeyList(const QString &) const;
00085 
00086     //### remove non const versions in 4.0
00087     QStringList readListEntry( const QString &, bool * = 0 );
00088     QStringList readListEntry( const QString &, const QChar& sep, bool * = 0 );
00089     QString     readEntry( const QString &, const QString &def = QString::null, bool * = 0 );
00090     int         readNumEntry( const QString &, int def = 0, bool * = 0 );
00091     double      readDoubleEntry( const QString &, double def = 0, bool * = 0 );
00092     bool        readBoolEntry( const QString &, bool def = FALSE, bool * = 0 );
00093 
00094     //### make those non-inlined in 4.0
00095     QStringList readListEntry( const QString &key, bool *ok = 0 ) const
00096     {
00097         QSettings *that = (QSettings*)this;
00098         return that->readListEntry( key, ok );
00099     }
00100     QStringList readListEntry( const QString &key, const QChar& sep, bool *ok = 0 ) const
00101     {
00102         QSettings *that = (QSettings*)this;
00103         return that->readListEntry( key, sep, ok );
00104     }
00105     QString     readEntry( const QString &key, const QString &def = QString::null,
00106                            bool *ok = 0 ) const
00107     {
00108         QSettings *that = (QSettings*)this;
00109         return that->readEntry( key, def, ok );
00110     }
00111     int         readNumEntry( const QString &key, int def = 0, bool *ok = 0 ) const
00112     {
00113         QSettings *that = (QSettings*)this;
00114         return that->readNumEntry( key, def, ok );
00115     }
00116 
00117     double      readDoubleEntry( const QString &key, double def = 0, bool *ok = 0 ) const
00118     {
00119         QSettings *that = (QSettings*)this;
00120         return that->readDoubleEntry( key, def, ok );
00121     }
00122     bool        readBoolEntry( const QString &key, bool def = FALSE, bool *ok = 0 ) const
00123     {
00124         QSettings *that = (QSettings*)this;
00125         return that->readBoolEntry( key, def, ok );
00126     }
00127 
00128     bool        removeEntry( const QString & );
00129 
00130     void insertSearchPath( System, const QString & );
00131     void removeSearchPath( System, const QString & );
00132 
00133     void setPath( const QString &domain, const QString &product, Scope = Global );
00134 
00135     void beginGroup( const QString &group );
00136     void endGroup();
00137     void resetGroup();
00138     QString group() const;
00139 
00140     bool sync();
00141 
00142 private:
00143     QSettingsPrivate *d;
00144 
00145 #if defined(Q_DISABLE_COPY)
00146     QSettings(const QSettings &);
00147     QSettings &operator=(const QSettings &);
00148 #endif
00149 
00150     QDateTime lastModificationTime( const QString & );
00151 
00152     friend class QApplication;
00153 };
00154 
00155 #endif // QT_NO_SETTINGS
00156 #endif // QSETTINGS_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'