You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
136 lines
5.2 KiB
136 lines
5.2 KiB
15 years ago
|
// -*- c++ -*-
|
||
|
|
||
|
/*
|
||
|
* Copyright (C) 2003, Ian Reinhart Geiser <geiseri@kde.org>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2 of the License, or (at your option) any later version.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KJSEMBED_CONFIG_IMP_H
|
||
|
#define KJSEMBED_CONFIG_IMP_H
|
||
|
|
||
15 years ago
|
#include <tqdatetime.h>
|
||
|
#include <tqfont.h>
|
||
|
#include <tqvariant.h>
|
||
|
#include <tqpoint.h>
|
||
|
#include <tqrect.h>
|
||
|
#include <tqsize.h>
|
||
|
#include <tqcolor.h>
|
||
|
#include <tqstringlist.h>
|
||
15 years ago
|
|
||
|
#include "bindingobject.h"
|
||
|
|
||
|
#ifndef QT_ONLY
|
||
12 years ago
|
class TDEConfig;
|
||
15 years ago
|
#else
|
||
13 years ago
|
class TQSettings;
|
||
15 years ago
|
#endif
|
||
|
|
||
|
namespace KJSEmbed {
|
||
|
namespace Bindings {
|
||
|
|
||
|
class Config : public BindingObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
12 years ago
|
TQ_PROPERTY( bool forceGlobal READ forceGlobal WRITE setForceGlobal )
|
||
|
TQ_PROPERTY( bool dollarExpansion READ isDollarExpansion WRITE setDollarExpansion )
|
||
|
TQ_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
|
||
|
TQ_PROPERTY( bool readDefaults READ readDefaults WRITE setReadDefaults )
|
||
15 years ago
|
|
||
|
public:
|
||
13 years ago
|
Config( TQObject *parent=0, const char *name=0);
|
||
15 years ago
|
/*
|
||
13 years ago
|
Config( TQObject *parent, const char *name, const TQString& confName );
|
||
15 years ago
|
*/
|
||
|
virtual ~Config();
|
||
|
|
||
|
void setForceGlobal( bool force );
|
||
|
bool forceGlobal() const;
|
||
|
void setDollarExpansion( bool _bExpand );
|
||
|
bool isDollarExpansion() const;
|
||
|
void setReadOnly(bool _ro);
|
||
|
bool isReadOnly() const;
|
||
|
void setReadDefaults(bool b);
|
||
|
bool readDefaults() const;
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
// Group
|
||
|
void setDesktopGroup();
|
||
13 years ago
|
void setGroup(const TQString&);
|
||
|
TQString group();
|
||
|
TQStringList groupList();
|
||
|
TQString locale();
|
||
15 years ago
|
|
||
|
void rollback( bool bDeep );
|
||
|
void sync();
|
||
13 years ago
|
bool hasKey( const TQString& key ) const;
|
||
|
bool entryIsImmutable(const TQString &key) const;
|
||
|
void revertToDefault(const TQString &key);
|
||
|
bool hasDefault(const TQString &key) const;
|
||
15 years ago
|
|
||
|
void setFileWriteMode(int mode);
|
||
13 years ago
|
TQString readEntry(const TQString& pKey, const TQString& aDefault ) const;
|
||
|
TQVariant readPropertyEntry( const TQString& pKey, const TQVariant &var) const;
|
||
|
TQStringList readListEntry( const TQString& pKey ) const;
|
||
|
TQString readPathEntry( const TQString& pKey, const TQString & aDefault) const;
|
||
|
TQStringList readPathListEntry( const TQString& pKey ) const;
|
||
|
int readNumEntry( const TQString& pKey, int nDefault ) const;
|
||
|
uint readUnsignedNumEntry( const TQString& pKey, uint nDefault ) const;
|
||
|
long readLongNumEntry( const TQString& pKey, long nDefault ) const;
|
||
|
double readDoubleNumEntry( const TQString& pKey, double nDefault ) const;
|
||
|
TQFont readFontEntry( const TQString& pKey, const TQFont* pDefault) const;
|
||
|
bool readBoolEntry( const TQString& pKey, const bool bDefault ) const;
|
||
|
TQRect readRectEntry( const TQString& pKey, const TQRect* pDefault) const;
|
||
|
TQPoint readPointEntry( const TQString& pKey, const TQPoint* pDefault) const;
|
||
|
TQSize readSizeEntry( const TQString& pKey, const TQSize* pDefault) const;
|
||
|
TQColor readColorEntry( const TQString& pKey, const TQColor* pDefault) const;
|
||
|
TQDateTime readDateTimeEntry( const TQString& pKey, const TQDateTime* pDefault) const;
|
||
|
TQString readEntryUntranslated( const TQString& pKey, const TQString& aDefault ) const;
|
||
|
|
||
|
void writeEntry( const TQString& pKey, const TQString& pValue );
|
||
|
void writePropertyEntry( const TQString& pKey, const TQVariant& pValue );
|
||
|
void writeListEntry( const TQString& pKey, const TQStringList &rValue );
|
||
|
void writeNumEntry( const TQString& pKey, int nValue );
|
||
|
void writeUnsignedNumEntry( const TQString& pKey, uint nValue );
|
||
|
void writeLongNumEntry( const TQString& pKey, unsigned long nValue );
|
||
|
void writeDoubleNumEntry( const TQString& pKey, double nValue );
|
||
|
void writeBoolEntry( const TQString& pKey, bool bValue );
|
||
|
void writeFontEntry( const TQString& pKey, const TQFont& rFont );
|
||
|
void writeColorEntry( const TQString& pKey, const TQColor& rColor );
|
||
|
void writeDateTimeEntry( const TQString& pKey, const TQDateTime& rDateTime );
|
||
|
void writeRectEntry( const TQString& pKey, const TQRect& rValue );
|
||
|
void writePointEntry( const TQString& pKey, const TQPoint& rValue );
|
||
|
void writeSizeEntry( const TQString& pKey, const TQSize& rValue );
|
||
|
void writePathEntry( const TQString& pKey, const TQString & path );
|
||
|
void writePathListEntry( const TQString& pKey, const TQStringList &rValue);
|
||
|
void deleteEntry( const TQString& pKey, bool bNLS , bool bGlobal );
|
||
|
bool deleteGroup( const TQString& group, bool bDeep , bool bGlobal );
|
||
15 years ago
|
|
||
|
private:
|
||
|
#ifndef QT_ONLY
|
||
12 years ago
|
TDEConfig *m_config;
|
||
15 years ago
|
#else
|
||
13 years ago
|
TQSettings *m_config;
|
||
|
TQString m_name;
|
||
15 years ago
|
bool m_forceGlobal;
|
||
|
#endif
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|