summaryrefslogtreecommitdiffstats
path: root/sip/tdeui/klistview.sip
blob: 8c6863987b187d52d7860f47e65d4d8d186cce09 (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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
//
//     Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
//     may also apply


//                 Generated by preSip
//            module tdeui  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 KListView : TQListView
{
%TypeHeaderCode
#include <klistview.h>
%End


public:

    enum SelectionModeExt
    {
        Single, 
        Multi, 
        Extended, 
        NoSelection, 
        FileManager
    };

                         KListView (TQWidget* /TransferThis/ = 0, const char* = 0);
    virtual void         setAcceptDrops (bool);
    virtual bool         isExecuteArea (const TQPoint&);
    bool                 isExecuteArea (int);
    TQPtrList<TQListViewItem> selectedItems () const;

%If ( KDE_3_4_0 -  )
    TQPtrList<TQListViewItem> selectedItems (bool) const;
%End

    void                 moveItem (TQListViewItem*, TQListViewItem* /Transfer/, TQListViewItem*);
    TQListViewItem*       lastItem () const;
    TQListViewItem*       lastChild () const;

%If ( KDE_3_1_0 -  )
    KLineEdit*           renameLineEdit () const;
%End

    bool                 itemsMovable () const;
    bool                 itemsRenameable () const;
    bool                 dragEnabled () const;
    bool                 autoOpen () const;
    bool                 isRenameable (int) const;
    bool                 dropVisualizer () const;
    int                  tooltipColumn () const;
    bool                 createChildren () const;
    bool                 dropHighlighter () const;
    int                  dropVisualizerWidth () const;
    SelectionModeExt     selectionModeExt () const;
    int                  itemIndex (const TQListViewItem*) const;
    TQListViewItem*       itemAtIndex (int);
    void                 setFullWidth ();
    void                 setFullWidth (bool);
    bool                 fullWidth () const;

%If ( KDE_3_0_1 -  )
    virtual int          addColumn (const TQString&, int = -1);
    virtual int          addColumn (const TQIconSet&, const TQString&, int = -1);
    virtual void         removeColumn (int);
%End

    void                 setAlternateBackground (const TQColor&);
    const TQColor&        alternateBackground () const;
    void                 saveLayout (KConfig*, const TQString&) const;
    void                 restoreLayout (KConfig*, const TQString&);
    virtual void         setSorting (int, bool = 1);
    int                  columnSorted () const;
    bool                 ascendingSort () const;

%If ( KDE_3_2_0 -  )
    virtual void         takeItem (TQListViewItem*);

%If ( KDE_3_4_0 -  )
    void                 setShadeSortColumn (bool);
    bool                 shadeSortColumn () const;
%End

%End


signals:
    void                 executed (TQListViewItem*);
    void                 executed (TQListViewItem*, const TQPoint&, int);
    void                 dropped (TQDropEvent*, TQListViewItem*);
    void                 dropped (KListView*, TQDropEvent*, TQListViewItem*);
    void                 dropped (KListView*, TQDropEvent*, TQListViewItem* /Transfer/, TQListViewItem*);
    void                 dropped (TQDropEvent*, TQListViewItem* /Transfer/, TQListViewItem*);
    void                 moved ();
    void                 aboutToMove ();
    void                 moved (TQListViewItem*, TQListViewItem*, TQListViewItem*);
    void                 moved (TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&, TQPtrList<TQListViewItem>&);
    void                 itemRenamed (TQListViewItem*, const TQString&, int);
    void                 itemRenamed (TQListViewItem*);
    void                 menuShortCutPressed (KListView*, TQListViewItem*);
    void                 contextMenu (KListView*, TQListViewItem*, const TQPoint&);

%If ( KDE_3_3_0 -  )
    void                 itemAdded (TQListViewItem*);
    void                 itemRemoved (TQListViewItem*);
%End


public slots:
    virtual void         rename (TQListViewItem*, int);
    void                 setRenameable (int, bool = 1);
    virtual void         setItemsMovable (bool);
    virtual void         setItemsRenameable (bool);
    virtual void         setDragEnabled (bool);
    virtual void         setAutoOpen (bool);
    virtual void         setDropVisualizer (bool);
    void                 setDropVisualizerWidth (int);
    virtual void         setTooltipColumn (int);
    virtual void         setDropHighlighter (bool);
    virtual void         setCreateChildren (bool);
    void                 setSelectionModeExt (KListView::SelectionModeExt);

%If ( KDE_3_1_0 -  )
    void                 setTabOrderedRenaming (bool);
    bool                 tabOrderedRenaming () const;
%End


protected:
    bool                 below (const TQRect&, const TQPoint&);
    bool                 below (TQListViewItem*, const TQPoint&);
    virtual bool         event (TQEvent*);
    void                 emitExecute (TQListViewItem*, const TQPoint&, int);
    virtual void         focusInEvent (TQFocusEvent*);
    virtual void         focusOutEvent (TQFocusEvent*);
    virtual void         leaveEvent (TQEvent*);
    virtual TQString      tooltip (TQListViewItem*, int) const;
    virtual bool         showTooltip (TQListViewItem*, const TQPoint&, int) const;
    virtual void         contentsDragMoveEvent (TQDragMoveEvent*);
    virtual void         contentsMousePressEvent (TQMouseEvent*);
    virtual void         contentsMouseMoveEvent (TQMouseEvent*);
    virtual void         contentsMouseDoubleClickEvent (TQMouseEvent*);
    virtual void         contentsDragLeaveEvent (TQDragLeaveEvent*);
    virtual void         contentsMouseReleaseEvent (TQMouseEvent*);
    virtual void         contentsDropEvent (TQDropEvent*);
    virtual void         contentsDragEnterEvent (TQDragEnterEvent*);
//ig     virtual TQDragObject* dragObject () const;
    virtual bool         acceptDrag (TQDropEvent*) const;
    virtual TQRect        drawDropVisualizer (TQPainter*, TQListViewItem* /Transfer/, TQListViewItem*);
    virtual TQRect        drawItemHighlighter (TQPainter*, TQListViewItem*);
    virtual void         startDrag ();
    virtual void         keyPressEvent (TQKeyEvent*);
    virtual void         viewportPaintEvent (TQPaintEvent*);
    void                 activateAutomaticSelection ();
    void                 deactivateAutomaticSelection ();
    bool                 automaticSelection () const;
    virtual void         viewportResizeEvent (TQResizeEvent*);

%If ( KDE_3_2_0 -  )
    void                 disableAutoSelection ();
    void                 resetAutoSelection ();

%If ( KDE_3_3_0 -  )
    void                 doubleClicked (TQListViewItem*, const TQPoint&, int);
%End

%End


protected slots:
    void                 slotSettingsChanged (int);
    void                 slotMouseButtonClicked (int, TQListViewItem*, const TQPoint&, int);
    void                 doneEditing (TQListViewItem*, int);
    void                 cleanDropVisualizer ();
    void                 cleanItemHighlighter ();
    void                 emitContextMenu (TQListViewItem*, const TQPoint&, int);
    void                 emitContextMenu (KListView*, TQListViewItem*);
    void                 slotOnItem (TQListViewItem*);
    void                 slotOnViewport ();
    void                 slotAutoSelect ();

%If ( KDE_3_2_0 -  )
    void                 slotDragExpand ();
%End

    void                 slotHeaderChanged ();

protected:
    virtual void         movableDropEvent (TQListViewItem*, TQListViewItem*);
    virtual void         findDrop (const TQPoint&, TQListViewItem*&, TQListViewItem*&);
    void                 fileManagerKeyPressEvent (TQKeyEvent*);
    int                  depthToPixels (int);

protected:
//igx     virtual void         virtual_hook (int, void*);

signals:

%If (  - KDE_3_3_0 )
    void                 doubleClicked (TQListViewItem*, const TQPoint&, int);
%End


protected:
//force
    virtual TQDragObject* dragObject ();
//end

};  // class KListView


class KListViewItem : TQListViewItem
{
%TypeHeaderCode
#include <klistview.h>
%End


public:
                         KListViewItem (TQListView* /TransferThis/);
                         KListViewItem (TQListViewItem* /TransferThis/);
                         KListViewItem (TQListView* /TransferThis/, TQListViewItem*);
                         KListViewItem (TQListViewItem* /TransferThis/, TQListViewItem*);
                         KListViewItem (TQListView* /TransferThis/, TQString, TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null );
                         KListViewItem (TQListViewItem* /TransferThis/, TQString, TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null );
                         KListViewItem (TQListView* /TransferThis/, TQListViewItem*, TQString, TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null );
                         KListViewItem (TQListViewItem* /TransferThis/, TQListViewItem*, TQString, TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null , TQString = TQString ::null );

%If ( KDE_3_3_0 -  )
    virtual void         insertItem (TQListViewItem*);
    virtual void         takeItem (TQListViewItem*);
%End

    bool                 isAlternate ();
    const TQColor&        backgroundColor ();

%If ( KDE_3_4_0 -  )
    TQColor               backgroundColor (int);
%End

    virtual void         paintCell (TQPainter*, const TQColorGroup&, int, int, int);

};  // class KListViewItem



%MappedType TQPtrList<TQListViewItem>
//converts a Python list of TQListViewItem
{
%TypeHeaderCode
#include <qptrlist.h>
#include <qlistview.h>
typedef TQPtrList<TQListViewItem> ListViewItems;
%End

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

    PyObject *pylist;

    // Create the list

    if ((pylist = PyList_New(0)) == NULL)
        return NULL;

    // Get it.

    TQPtrList<TQListViewItem> *cpplist = (TQPtrList<TQListViewItem> *)sipCpp;
    TQListViewItem *cpp;
    PyObject *inst;

    // the loop depends on the type of iterator the  template makes available
    for(cpp = cpplist->first (); cpp != 0; cpp = cpplist->next () )
    {
        if (((inst = sipConvertFromInstance (cpp, sipClass_TQListViewItem, sipTransferObj)) == NULL)
            || PyList_Append (pylist, inst) < 0)
        {
            Py_DECREF (pylist);
            return NULL;
        }
    }

    return pylist;
%End

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

    TQPtrList<TQListViewItem> *cpplist = new TQPtrList<TQListViewItem>;

    PyObject *elem;
    TQListViewItem *cpp;
    int iserr = 0;

    for (int i = 0; i < PyList_Size (sipPy); i++)
    {
        elem = PyList_GET_ITEM (sipPy, i);
        cpp = (TQListViewItem *)sipForceConvertToType(elem, sipType_TQListViewItem, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);

        if (iserr)
        {
            *sipIsErr = 1;
            delete cpplist;
            return 0;
        }

        cpplist->append (cpp);
    }

    *sipCppPtr = cpplist;

    return 1;
%End
};