diff options
Diffstat (limited to 'python/pykde/sip/kfile/kfiletreebranch.sip')
-rw-r--r-- | python/pykde/sip/kfile/kfiletreebranch.sip | 235 |
1 files changed, 235 insertions, 0 deletions
diff --git a/python/pykde/sip/kfile/kfiletreebranch.sip b/python/pykde/sip/kfile/kfiletreebranch.sip new file mode 100644 index 00000000..03f59af0 --- /dev/null +++ b/python/pykde/sip/kfile/kfiletreebranch.sip @@ -0,0 +1,235 @@ +// +// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com> +// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson +// may also apply + + +// Generated by preSip +// module kfile 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., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +class KFileTreeBranch : KDirLister +{ +%TypeHeaderCode +#include <kfiletreebranch.h> +%End + + +public: + KFileTreeBranch (KFileTreeView*, const KURL&, const QString&, const QPixmap&, bool = 0, KFileTreeViewItem* = 0); + KURL rootUrl () const; + virtual void setRoot (KFileTreeViewItem*); + KFileTreeViewItem* root (); + QString name () const; + virtual void setName (const QString); + const QPixmap& pixmap (); + const QPixmap& openPixmap (); + 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); + void setOpenPixmap (const QPixmap&); + +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 + +typedef QPtrList<KFileTreeBranch> KFileTreeBranchList; +//ig typedef QPtrListIterator<KFileTreeBranch> KFileTreeBranchIterator; + + +%MappedType QPtrList<KFileTreeViewItem> +//converts a Python list of KFileTreeViewItem +{ +%TypeHeaderCode +#include <kfiletreeviewitem.h> +typedef QPtrList<KFileTreeViewItem> KFileTreeViewItemList; +#include <sipkfileKFileTreeViewItem.h> +%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. + + QPtrList<KFileTreeViewItem> *cList = (QPtrList<KFileTreeViewItem> *)sipCpp; + 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); + + QPtrList<KFileTreeViewItem> *cList = new QPtrList<KFileTreeViewItem>; + + PyObject *elem; + int iserr = 0; + KFileTreeViewItem *ftvi; + + for (int i = 0; i < PyList_Size (sipPy); i++) + { + elem = PyList_GET_ITEM (sipPy, i); + ftvi = (KFileTreeViewItem *)sipForceConvertTo_KFileTreeViewItem (elem, &iserr); + + if (iserr) + { + *sipIsErr = 1; + delete cList; + return 0; + } + + cList->append (ftvi); + } + + *sipCppPtr = cList; + + return 1; +%End +}; + + +%MappedType QPtrList<KFileTreeBranch> +//converts a Python list of KFileTreeBranch +{ +%TypeHeaderCode +#include <kfiletreebranch.h> +#include <sipkfileKFileTreeBranch.h> +//typedef QPtrList<KFileTreeBranch> KFileTreeBList; +%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. + + QPtrList<KFileTreeBranch> *cList = (QPtrList<KFileTreeBranch> *)sipCpp; + 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); + + QPtrList<KFileTreeBranch> *cList = new QPtrList<KFileTreeBranch>; + + PyObject *elem; + int iserr = 0; + KFileTreeBranch *ftb; + + for (int i = 0; i < PyList_Size (sipPy); i++) + { + elem = PyList_GET_ITEM (sipPy, i); + ftb = (KFileTreeBranch *)sipForceConvertTo_KFileTreeBranch (elem, &iserr); + + if (iserr) + { + *sipIsErr = 1; + delete cList; + return 0; + } + + cList->append (ftb); + } + + *sipCppPtr = cList; + + return 1; +%End +}; + + |