Salome HOME
bade8b3388bebdeaedd60a4d7a9d9b0c31d6f700
[tools/install.git] / src / SALOME_ProductsView.hxx
1 //  File      : SALOME_ProductsView.hxx
2 //  Created   : Thu Dec 18 12:01:00 2002
3 //  Author    : Vadim SANDLER
4 //  Project   : PAL/SALOME
5 //  Module    : InstallWizard
6 //  Copyright : 2004 CEA
7 //  $Header$ 
8
9 #ifndef __SALOME_ProductsView
10 #define __SALOME_ProductsView
11
12 #include <qlistview.h> 
13
14 /*! 
15   Class ProductsViewItem: to define custom products list view item
16 */
17 class ProductsView;
18 class ProductsViewItem : public QCheckListItem 
19 {
20  public:
21   // constructor
22   ProductsViewItem( ProductsView* parent, const QString& text, Type tt );
23   // other constructor
24   ProductsViewItem( QCheckListItem* parent, const QString& text, Type tt );
25
26  protected:
27   // called when users switches item on/off
28   void stateChange( bool on );
29 };
30
31 /*! 
32   Class ProductsView : Products list view
33 */
34 class ProductsView : public QListView 
35 {
36   Q_OBJECT
37   
38 public:
39   // constructor
40   ProductsView( QWidget* parent );
41
42   // event filter - prevents collapsing/expanding of items
43   bool eventFilter( QObject* o, QEvent* e );
44
45   // adds product item(s) into the list
46   QCheckListItem* addItem( const QString& name, 
47                            const QString& version, 
48                            const QString& install, 
49                            const QStringList& supported, 
50                            const QString& script );
51
52   // emits signal when checkbox or radiobutton is switched
53   void itemActivated( QCheckListItem* item );
54
55   // returns true if "install binaries" is on for the item
56   bool isBinaries( QCheckListItem* item );
57   // returns true if "install sources" is on for the item
58   bool isSources( QCheckListItem* item );
59   // returns true if "use native" is on for the item
60   bool isNative( QCheckListItem* item );
61   // returns true if "not install" is on for the item
62   bool isNone(  QCheckListItem* item );
63
64   // sets "install binaries" on for the item; if "binaries" item is absent, set "install sources" on if it is present 
65   void setBinaries( QCheckListItem* item );
66   // sets "install sources" on for the item; if "sources" item is absent, set "install binaries" on if it is present 
67   void setSources( QCheckListItem* item );
68   // sets "use native" on for the item; if "sources" item is absent, set "install binaries" on if it is present 
69   void setNative( QCheckListItem* item );
70   // sets "not install" on for the item
71   void setNone( QCheckListItem* item );
72
73 signals:
74   // emitted when checkbox or radiobutton is switched
75   void itemToggled( QCheckListItem* item );
76 };
77
78 #endif