Eneboo - Documentación para desarrolladores
src/qt/include/private/qsettings_p.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qsettings_p.h   3.3.8   edited Jan 11 14:46 $
00003 **
00004 ** Definition of QSettings related classes
00005 **
00006 ** Created : 990124
00007 **
00008 ** Copyright (C) 1999-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the kernel 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_P_H
00039 #define QSETTINGS_P_H
00040 
00041 //
00042 //  W A R N I N G
00043 //  -------------
00044 //
00045 // This file is not part of the Qt API.  It exists for the convenience
00046 // of QSettings. This header file may change from version to 
00047 // version without notice, or even be removed.
00048 //
00049 // We mean it.
00050 //
00051 //
00052 
00053 #ifndef QT_H
00054 #include "qstringlist.h"
00055 #include "qmap.h"
00056 #include "qvaluestack.h"
00057 #endif // QT_H
00058 
00059 #ifndef QT_NO_SETTINGS
00060 class QSettingsSysPrivate;
00061 
00062 // QSettingsGroup is a map of key/value pairs
00063 class QSettingsGroup : public QMap<QString,QString>
00064 {
00065 public:
00066     QSettingsGroup();
00067 
00068     bool modified;
00069 };
00070 
00071 // QSettingsHeading is a map of heading/group pairs
00072 class QSettingsHeading : public QMap<QString,QSettingsGroup>
00073 {
00074 public:
00075     QSettingsHeading::Iterator git;
00076     void read(const QString &);
00077     void parseLine(QTextStream &);
00078 };
00079 
00080 
00081 class QSettingsPrivate
00082 {
00083 public:
00084     QSettingsPrivate( QSettings::Format format );
00085     ~QSettingsPrivate();
00086 
00087     QSettingsGroup readGroup();
00088     void removeGroup(const QString &);
00089     void writeGroup(const QString &, const QString &);
00090     QDateTime modificationTime();
00091 
00092     QStringList searchPaths;
00093     QMap<QString,QSettingsHeading> headings;
00094     QString group;
00095     QString heading;
00096 
00097     /*### static data brings threading trouble
00098     static QString *defProduct;
00099     static QString *defDomain;
00100     */
00101     QValueStack<QString> groupStack;
00102     QString groupPrefix;
00103 
00104     bool groupDirty :1;
00105     bool modified :1;
00106     bool globalScope :1;
00107 
00108 #if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC))
00109     // system dependent implementations to use the 
00110     // system specific setting database (ie. registry on Windows)
00111 
00112     QSettingsSysPrivate *sysd;
00113     void        sysInit();
00114     void        sysClear();
00115 
00116 #if !defined(Q_NO_BOOL_TYPE)
00117     bool        sysWriteEntry( const QString &, bool );
00118 #endif
00119     bool        sysWriteEntry( const QString &, double );
00120     bool        sysWriteEntry( const QString &, int );
00121     bool        sysWriteEntry( const QString &, const QString & );
00122     bool        sysWriteEntry( const QString &, const QStringList & );
00123     bool        sysWriteEntry( const QString &, const QStringList &, const QChar& sep );
00124 
00125     QStringList sysEntryList(const QString &) const;
00126     QStringList sysSubkeyList(const QString &) const;
00127 
00128     QStringList sysReadListEntry( const QString &, bool * = 0 ) const;
00129     QStringList sysReadListEntry( const QString &, const QChar& sep, bool * = 0 ) const;
00130     QString     sysReadEntry( const QString &, const QString &def = QString::null, bool * = 0 ) const;
00131     int         sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const;
00132     double      sysReadDoubleEntry( const QString &, double def = 0, bool * = 0 ) const;
00133     bool        sysReadBoolEntry( const QString &, bool def = 0, bool * = 0 ) const;
00134 
00135     bool        sysRemoveEntry( const QString & );
00136 
00137     bool        sysSync();
00138 
00139     void        sysInsertSearchPath( QSettings::System, const QString & );
00140     void        sysRemoveSearchPath( QSettings::System, const QString & );
00141 #endif
00142 
00143 };
00144 #endif //QT_NO_SETTINGS
00145 #endif // QSETTINGS_P_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'