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.
234 lines
5.9 KiB
234 lines
5.9 KiB
13 years ago
|
//
|
||
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
||
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
||
|
// may also apply
|
||
|
|
||
|
|
||
|
// Generated by preSip
|
||
12 years ago
|
// module tdefile version KDE 3.5.3
|
||
13 years ago
|
|
||
|
|
||
|
// 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 KFileTreeBranch : KDirLister
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
12 years ago
|
#include <tdefiletreebranch.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
13 years ago
|
KFileTreeBranch (KFileTreeView*, const KURL&, const TQString&, const TQPixmap&, bool = 0, KFileTreeViewItem* = 0);
|
||
13 years ago
|
KURL rootUrl () const;
|
||
|
virtual void setRoot (KFileTreeViewItem*);
|
||
|
KFileTreeViewItem* root ();
|
||
13 years ago
|
TQString name () const;
|
||
|
virtual void setName (const TQString);
|
||
|
const TQPixmap& pixmap ();
|
||
|
const TQPixmap& openPixmap ();
|
||
13 years ago
|
bool showExtensions () const;
|
||
|
void setOpen (bool = 1);
|
||
|
void setChildRecurse (bool = 1);
|
||
|
bool childRecurse ();
|
||
|
|
||
|
public slots:
|
||
|
virtual bool populate (const KURL&, KFileTreeViewItem*);
|
||
|
virtual void setShowExtensions (bool = 1);
|
||
13 years ago
|
void setOpenPixmap (const TQPixmap&);
|
||
13 years ago
|
|
||
|
protected:
|
||
|
virtual KFileTreeViewItem* createTreeViewItem (KFileTreeViewItem* /Transfer/, KFileItem*);
|
||
|
|
||
|
public:
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
|
virtual KFileTreeViewItem* findTVIByURL (const KURL&);
|
||
|
%End
|
||
|
|
||
|
|
||
|
signals:
|
||
|
void populateFinished (KFileTreeViewItem*);
|
||
|
void newTreeViewItems (KFileTreeBranch*, KFileTreeViewItemList&);
|
||
|
void directoryChildCount (KFileTreeViewItem*, int);
|
||
|
|
||
|
protected:
|
||
|
//igx virtual void virtual_hook (int, void*);
|
||
|
|
||
|
protected:
|
||
|
|
||
|
%If ( - KDE_3_1_0 )
|
||
|
virtual KFileTreeViewItem* findTVIByURL (const KURL&);
|
||
|
%End
|
||
|
|
||
|
|
||
|
}; // class KFileTreeBranch
|
||
|
|
||
13 years ago
|
typedef TQPtrList<KFileTreeBranch> KFileTreeBranchList;
|
||
|
//ig typedef TQPtrListIterator<KFileTreeBranch> KFileTreeBranchIterator;
|
||
13 years ago
|
|
||
|
|
||
13 years ago
|
%MappedType TQPtrList<KFileTreeViewItem>
|
||
13 years ago
|
//converts a Python list of KFileTreeViewItem
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
12 years ago
|
#include <tdefiletreeviewitem.h>
|
||
13 years ago
|
typedef TQPtrList<KFileTreeViewItem> KFileTreeViewItemList;
|
||
13 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python list of KFileTreeViewItem
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
PyObject *ftvilist;
|
||
|
|
||
|
// Create the list
|
||
|
|
||
|
if ((ftvilist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
TQPtrList<KFileTreeViewItem> *cList = (TQPtrList<KFileTreeViewItem> *)sipCpp;
|
||
13 years ago
|
PyObject *item;
|
||
|
KFileTreeViewItem *ftvi;
|
||
|
|
||
|
for( ftvi = cList->first(); ftvi; ftvi = cList->next ())
|
||
|
{
|
||
|
item = sipConvertFromInstance (ftvi, sipClass_KFileTreeViewItem, sipTransferObj);
|
||
|
if ((item == NULL) || (PyList_Append (ftvilist, item) < 0))
|
||
|
{
|
||
|
Py_XDECREF (item);
|
||
|
Py_DECREF (ftvilist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return ftvilist;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python list to a KFileTreeViewItemList on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQPtrList<KFileTreeViewItem> *cList = new TQPtrList<KFileTreeViewItem>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
|
int iserr = 0;
|
||
|
KFileTreeViewItem *ftvi;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
ftvi = (KFileTreeViewItem *)sipForceConvertToType(elem, sipType_KFileTreeViewItem, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cList;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cList->append (ftvi);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cList;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|
||
13 years ago
|
%MappedType TQPtrList<KFileTreeBranch>
|
||
13 years ago
|
//converts a Python list of KFileTreeBranch
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
12 years ago
|
#include <tdefiletreebranch.h>
|
||
13 years ago
|
//typedef TQPtrList<KFileTreeBranch> KFileTreeBList;
|
||
13 years ago
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
// Convert to a Python list of KFileTreeBranch
|
||
|
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
PyObject *ftblist;
|
||
|
|
||
|
// Create the list
|
||
|
|
||
|
if ((ftblist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
|
// Get it.
|
||
|
|
||
13 years ago
|
TQPtrList<KFileTreeBranch> *cList = (TQPtrList<KFileTreeBranch> *)sipCpp;
|
||
13 years ago
|
PyObject *item;
|
||
|
KFileTreeBranch *ftb;
|
||
|
|
||
|
for( ftb = cList->first(); ftb; ftb = cList->next ())
|
||
|
{
|
||
|
item = sipConvertFromInstance (ftb, sipClass_KFileTreeBranch, sipTransferObj);
|
||
|
if ((item == NULL) || (PyList_Append (ftblist, item) < 0))
|
||
|
{
|
||
|
Py_XDECREF (item);
|
||
|
Py_DECREF (ftblist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return ftblist;
|
||
|
%End
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
// Convert a Python list to a KFileTreeBranchList on the heap.
|
||
|
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
13 years ago
|
TQPtrList<KFileTreeBranch> *cList = new TQPtrList<KFileTreeBranch>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
|
int iserr = 0;
|
||
|
KFileTreeBranch *ftb;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
|
ftb = (KFileTreeBranch *)sipForceConvertToType(elem, sipType_KFileTreeBranch, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cList;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cList->append (ftb);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cList;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|