summaryrefslogtreecommitdiffstats
path: root/sip/khtml/khtml_settings.sip
blob: e3661271a229e60c50398418ab26b573b9886fd9 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
//
//     Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
//     may also apply


//                 Generated by preSip
//            module khtml  version KDE 3.5.3


// This software is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This software 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this library; see the file COPYING.
// If not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


class KHTMLSettings
{
%TypeHeaderCode
#include <khtml_settings.h>
%End


public:

    enum KJavaScriptAdvice
    {
        KJavaScriptDunno, 
        KJavaScriptAccept, 
        KJavaScriptReject
    };


    enum KAnimationAdvice
    {
        KAnimationDisabled, 
        KAnimationLoopOnce, 
        KAnimationEnabled
    };


%If ( KDE_3_2_0 -  )

    enum KJSWindowOpenPolicy
    {
        KJSWindowOpenAllow, 
        KJSWindowOpenAsk, 
        KJSWindowOpenDeny, 
        KJSWindowOpenSmart
    };


    enum KJSWindowStatusPolicy
    {
        KJSWindowStatusAllow, 
        KJSWindowStatusIgnore
    };


    enum KJSWindowMovePolicy
    {
        KJSWindowMoveAllow, 
        KJSWindowMoveIgnore
    };


    enum KJSWindowResizePolicy
    {
        KJSWindowResizeAllow, 
        KJSWindowResizeIgnore
    };


    enum KJSWindowFocusPolicy
    {
        KJSWindowFocusAllow, 
        KJSWindowFocusIgnore
    };

%End

                         KHTMLSettings ();
                         KHTMLSettings (const KHTMLSettings&);
    void                 init ();
    void                 init (KConfig*, bool = 1);
    bool                 changeCursor ();
    bool                 underlineLink ();
    bool                 hoverLink ();

%If ( KDE_3_4_0 -  )
    bool                 allowTabulation () const;
    bool                 autoSpellCheck () const;
%End

    KHTMLSettings::KAnimationAdvice showAnimations () const;
    TQString              stdFontName () const;
    TQString              fixedFontName () const;
    TQString              serifFontName () const;
    TQString              sansSerifFontName () const;
    TQString              cursiveFontName () const;
    TQString              fantasyFontName () const;
    void                 setStdFontName (const TQString&);
    void                 setFixedFontName (const TQString&);
    int                  minFontSize () const;
    int                  mediumFontSize () const;

%If ( KDE_3_2_0 -  )
    bool                 jsErrorsEnabled () const;
    void                 setJSErrorsEnabled (bool);
%End

    const TQString&       encoding () const;

%If ( KDE_3_4_0 -  )
    bool                 followSystemColors () const;
%End

    const TQColor&        textColor ();

%If ( KDE_3_4_0 -  )
    const TQColor&        baseColor () const;
%End

    const TQColor&        linkColor ();
    const TQColor&        vLinkColor ();
    bool                 autoLoadImages ();

%If ( KDE_3_4_0 -  )
    bool                 unfinishedImageFrame () const;
%End


%If ( KDE_3_3_0 -  )
    bool                 isOpenMiddleClickEnabled ();
%End


%If ( KDE_3_1_0 -  )
    bool                 isBackRightClickEnabled ();
%End

    bool                 isJavaEnabled (const TQString& = TQString ::null );
    bool                 isJavaScriptEnabled (const TQString& = TQString ::null );
    bool                 isJavaScriptDebugEnabled (const TQString& = TQString ::null );

%If ( KDE_3_2_0 -  )
    bool                 isJavaScriptErrorReportingEnabled (const TQString& = TQString ::null ) const;
%End

    bool                 isPluginsEnabled (const TQString& = TQString ::null );

%If ( KDE_3_5_0 -  )
    bool                 isAdFiltered (const TQString&) const;
    bool                 isAdFilterEnabled () const;
    bool                 isHideAdsEnabled () const;
    void                 addAdFilter (const TQString&);
    bool                 accessKeysEnabled () const;
%End


%If ( KDE_3_2_0 -  )
    KHTMLSettings::KJSWindowOpenPolicy windowOpenPolicy (const TQString& = TQString ::null ) const;
    KHTMLSettings::KJSWindowMovePolicy windowMovePolicy (const TQString& = TQString ::null ) const;
    KHTMLSettings::KJSWindowResizePolicy windowResizePolicy (const TQString& = TQString ::null ) const;
    KHTMLSettings::KJSWindowStatusPolicy windowStatusPolicy (const TQString& = TQString ::null ) const;
    KHTMLSettings::KJSWindowFocusPolicy windowFocusPolicy (const TQString& = TQString ::null ) const;
%End

    static KJavaScriptAdvice strToAdvice (const TQString&);
//ig     static void          splitDomainAdvice (const TQString&, TQString&, KHTMLSettings::KJavaScriptAdvice&, KHTMLSettings::KJavaScriptAdvice&);
    static const char*   adviceToStr (KHTMLSettings::KJavaScriptAdvice);

%If ( KDE_3_2_0 -  )
//ig     void                 readDomainSettings (KConfig*, bool, bool, KPerDomainSettings&);
%End

    TQString              settingsToCSS () const;
    static const TQString& availableFamilies ();
    TQString              userStyleSheet () const;
    bool                 isFormCompletionEnabled () const;
    int                  maxFormCompletionItems () const;

%If ( KDE_3_1_1 -  )
    bool                 isAutoDelayedActionsEnabled () const;

%If ( KDE_3_5_0 -  )
    TQValueList<TQPair<TQString,TQChar>> fallbackAccessKeysAssignments () const;
    void                 setJSPopupBlockerPassivePopup (bool);
    bool                 jsPopupBlockerPassivePopup () const;
%End

%End


};  // class KHTMLSettings



%If (KDE_3_5_0 - )
%MappedType TQValueList<TQPair<TQString,TQChar>>
//converts a Python list of tuples (TQString,TQChar)
{
%TypeHeaderCode
#include <qvaluelist.h>
#include <qstring.h>
#include <khtml_settings.h>
typedef TQPair<TQString,TQChar> AssignPair;
%End

%ConvertFromTypeCode
    if (!sipCpp)
        return PyList_New(0);

    // Create the list
    PyObject *pylist;
    if ((pylist = PyList_New(0)) == NULL)
        return NULL;

    TQValueList<AssignPair> *cpplist = (TQValueList<AssignPair> *)sipCpp;

    // Get it.
    TQValueList<AssignPair>::Iterator it;
    for( it = cpplist->begin(); it != cpplist->end(); ++it )
    {
        PyObject *inst = NULL;
        TQString s = (*it).first;
        TQChar c  = (*it).second;
        PyObject *pys = sipConvertFromNewType(new TQString(s), sipType_TQString, sipTransferObj);
        PyObject *pyc = sipConvertFromNewType(new TQChar(c), sipType_TQChar, sipTransferObj);
        if ((pys == NULL) || ((inst = Py_BuildValue ("NN", pys, pyc)) == NULL)
            || PyList_Append (pylist, inst) < 0)
        {
            Py_XDECREF (inst);
            Py_XDECREF (pys);
            Py_XDECREF (pyc);
            Py_DECREF (pylist);
            return NULL;
        }
    }

    return pylist;
%End


%ConvertToTypeCode
    if (sipIsErr == NULL)
        return PyList_Check(sipPy);

    TQValueList<AssignPair> *cpplist = new TQValueList<AssignPair>;

    TQString *p1;
    TQChar *p2;
    int iserr = 0;

    for (int i = 0; i < PyList_Size (sipPy); i++)
    {
        int p1_state, p2_state;

        PyObject *elem = PyList_GET_ITEM (sipPy, i);
        PyObject *pyp1 = PyTuple_GET_ITEM (elem, 0);
        PyObject *pyp2 = PyTuple_GET_ITEM (elem, 1);
        p1 = (TQString *)sipForceConvertToType(pyp1, sipType_TQString, sipTransferObj, SIP_NOT_NONE, &p1_state, &iserr);
        p2 = (TQChar *)sipForceConvertToType(pyp2, sipType_TQChar, sipTransferObj, SIP_NOT_NONE, &p2_state, &iserr);

        if (iserr)
        {
            if (p1)
                sipReleaseType(p1, sipType_TQString, p1_state);

            *sipIsErr = 1;
            delete cpplist;
            return 0;
        }

        cpplist->append (AssignPair (*p1, *p2));

        sipReleaseType(p1, sipType_TQString, p1_state);
        sipReleaseType(p2, sipType_TQChar, p2_state);
    }

    *sipCppPtr = cpplist;

    return 1;
%End
};
%End