summaryrefslogtreecommitdiffstats
path: root/kjsembed/bindings/tdeconfig_imp.h
blob: 75bf3bfd8e548a5abf861ff9a0538224dedaa56f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// -*- 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

#include <tqdatetime.h>
#include <tqfont.h>
#include <tqvariant.h>
#include <tqpoint.h>
#include <tqrect.h>
#include <tqsize.h>
#include <tqcolor.h>
#include <tqstringlist.h>

#include "bindingobject.h"

#ifndef QT_ONLY
class TDEConfig;
#else
class TQSettings;
#endif

namespace KJSEmbed {
namespace Bindings {

class Config : public BindingObject
{
    Q_OBJECT
    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 )

public:
    Config( TQObject *parent=0, const char *name=0);
    /*
    Config( TQObject *parent, const char *name,  const TQString& confName );
    */
    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();
    void setGroup(const TQString&);
    TQString group();
    TQStringList groupList();
    TQString locale();

    void rollback( bool bDeep  );
    void sync();
    bool hasKey( const TQString& key ) const;
    bool entryIsImmutable(const TQString &key) const;
    void revertToDefault(const TQString &key);
    bool hasDefault(const TQString &key) const;

    void setFileWriteMode(int mode);
    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  );

private:
#ifndef QT_ONLY
    TDEConfig *m_config;
#else
    TQSettings *m_config;
    TQString m_name;
    bool m_forceGlobal;
#endif
};
}
}

#endif