// // Copyright 2006 Jim Bublitz // 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 %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 selectedItems () const; %If ( KDE_3_4_0 - ) TQPtrList 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 (TDEConfig*, const TQString&) const; void restoreLayout (TDEConfig*, 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&, TQPtrList&, TQPtrList&); 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 %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 //converts a Python list of TQListViewItem { %TypeHeaderCode #include #include typedef TQPtrList 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 *cpplist = (TQPtrList *)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 *cpplist = new TQPtrList; 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 };