Salome HOME
3cbe49ee99402ae56676168d0cd55ea9eab7c615
[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, Open CASCADE SAS (vadim.sandler@opencascade.com)
4 //  Project   : SALOME
5 //  Module    : Installation Wizard
6 //  Copyright : 2002-2006 CEA
7
8 #ifndef __SALOME_ProductsView
9 #define __SALOME_ProductsView
10
11 #include <qlistview.h> 
12
13 /*! 
14   Class ProductsViewItem: to define custom products list view item
15 */
16 class ProductsView;
17 class ProductsViewItem : public QCheckListItem 
18 {
19  public:
20   // constructor
21   ProductsViewItem( ProductsView* parent, const QString& text, Type tt );
22   // other constructor
23   ProductsViewItem( QCheckListItem* parent, const QString& text, Type tt );
24
25  protected:
26   // called when users switches item on/off
27   void stateChange( bool on );
28 };
29
30 /*! 
31   Class ProductsView : Products list view
32 */
33 class ProductsView : public QListView 
34 {
35   Q_OBJECT
36   
37 public:
38   // constructor
39   ProductsView( QWidget* parent );
40
41   // event filter - prevents collapsing/expanding of items
42   bool eventFilter( QObject* o, QEvent* e );
43
44   // adds product item(s) into the list
45   QCheckListItem* addItem( const QString& name, 
46                            const QString& version, 
47                            const QString& install, 
48                            const QStringList& supported, 
49                            const QString& script );
50
51   // emits signal when checkbox or radiobutton is switched
52   void itemActivated( QCheckListItem* item );
53
54   // returns true if "install binaries" is on for the item
55   bool isBinaries( QCheckListItem* item ) const;
56   // returns true if "install sources" is on for the item
57   bool isSources( QCheckListItem* item ) const;
58   // returns true if "use native" is on for the item
59   bool isNative( QCheckListItem* item ) const;
60   // returns true if "not install" is on for the item
61   bool isNone(  QCheckListItem* item ) const;
62
63   // sets "install binaries" on for the item; if "binaries" item is absent, set "install sources" on if it is present 
64   void setBinaries( QCheckListItem* item );
65   // sets "install sources" on for the item; if "sources" item is absent, set "install binaries" on if it is present 
66   void setSources( QCheckListItem* item );
67   // sets "use native" on for the item; if "sources" item is absent, set "install binaries" on if it is present 
68   void setNative( QCheckListItem* item );
69   // sets "not install" on for the item
70   void setNone( QCheckListItem* item );
71
72   // returns true if product supports "binaries" installation mode
73   bool hasBinaries( QCheckListItem* item ) const;
74   // returns true if product supports "sources" installation mode
75   bool hasSources( QCheckListItem* item ) const;
76   // returns true if product supports "native" installation mode
77   bool hasNative( QCheckListItem* item ) const;
78
79 signals:
80   // emitted when checkbox or radiobutton is switched
81   void itemToggled( QCheckListItem* item );
82 };
83
84 #endif