1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
25 #include <qlistview.h>
27 class SUIT_DataObject;
30 base template class for ListViewItems and CheckListItems
33 template<class T> class ListItemF
36 ListItemF( T*, SUIT_DataObject* );
37 /*ListItem( SUIT_DataObject*, QListView* );
38 ListItem( SUIT_DataObject*, QListViewItem* );
39 ListItem( SUIT_DataObject*, QListView*, QListViewItem* );
40 ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem* );
42 ListItem( SUIT_DataObject*, QListView*, int );
43 ListItem( SUIT_DataObject*, QListViewItem*, int );
44 ListItem( SUIT_DataObject*, QListView*, QListViewItem*, int );
45 ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem*, int );*/
47 void setSel( bool s );
48 inline SUIT_DataObject* dataObject() const { return myObject; }
49 void paintFoc( QPainter* p, QColorGroup& cg, const QRect& r );
50 void paintC( QPainter* p, QColorGroup& cg, int c, int w, int align );
56 SUIT_DataObject* myObject;
64 class OB_EXPORT OB_ListItem : public ListItemF<QListViewItem>, public QListViewItem
67 OB_ListItem( SUIT_DataObject*, QListView* );
68 OB_ListItem( SUIT_DataObject*, QListViewItem* );
69 OB_ListItem( SUIT_DataObject*, QListView*, QListViewItem* );
70 OB_ListItem( SUIT_DataObject*, QListViewItem*, QListViewItem* );
72 virtual ~OB_ListItem();
74 virtual void setSelected( bool s );
75 virtual void paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r );
76 virtual void paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align );
78 virtual void setText ( int column, const QString & text );
80 virtual int rtti() const;
89 class OB_EXPORT OB_CheckListItem : public ListItemF<QCheckListItem>, public QCheckListItem
92 OB_CheckListItem( SUIT_DataObject*, QListView*, Type = CheckBox );
93 OB_CheckListItem( SUIT_DataObject*, QListViewItem*, Type = CheckBox );
94 OB_CheckListItem( SUIT_DataObject*, QListView*, QListViewItem*, Type = CheckBox );
95 OB_CheckListItem( SUIT_DataObject*, QListViewItem*, QListViewItem*, Type = CheckBox );
97 virtual ~OB_CheckListItem();
99 virtual void setSelected( bool s );
100 virtual void paintFocus( QPainter* p, const QColorGroup& cg, const QRect& r );
101 virtual void paintCell( QPainter* p, const QColorGroup& cg, int c, int w, int align );
104 virtual int rtti() const;
109 void stateChange( bool );