Salome HOME
Fix regression in ParaView installation script: invalid path to the patch
[tools/install.git] / src / SALOME_ProgressView.hxx
1 //  File      : SALOME_ProgressView.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-2014 CEA
7
8 #ifndef __SALOME_ProgressView
9 #define __SALOME_ProgressView
10
11 #include <qlistview.h> 
12
13 /*!
14   Class ProgressViewItem: Progress list view item
15 */
16 enum Status { Waiting, Processing, Completed, Aborted };
17 class ProgressView;
18 class ProgressViewItem : public QListViewItem
19 {
20 public:
21   // constructor
22   ProgressViewItem( ProgressView* parent, 
23                     QString       productName, 
24                     const QString scriptName, 
25                     Status        status = Waiting );
26   
27   // sets product status
28   void    setStatus( Status status );
29   // gets product status
30   Status  getStatus()  const { return myStatus; }
31   // gets product name
32   QString getProduct() const { return text( 0 ); }
33   // gets product script
34   QString getScript()   const { return myScript; }
35
36 protected:
37   // paints cell of the item
38   void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
39
40 private:
41   Status  myStatus;       // status
42   QString myScript;       // alias
43 };
44
45 /*!
46   Class ProgressView: Progress list view
47 */
48 class ProgressView : public QListView
49 {
50 public:
51   // constructor
52   ProgressView( QWidget* parent );
53
54   // sets/gets status colors
55   void    setColors( QColor wColor, QColor pColor, QColor cColor );
56   QColor  getWaitingColor()     { return myWaitingColor;    }
57   QColor  getProcessingColor()  { return myProcessingColor; }
58   QColor  getCompletedColor()   { return myCompletedColor;  }
59
60   // adds product item
61   ProgressViewItem* addProduct( const QString smbName, const QString product );
62   // finds the first item with given status
63   QString findStatus( Status status );
64   // sets new status for the product item
65   void    setStatus( const QString product, Status status );
66   // scrolls the view to make item visible if necessary
67   void    ensureVisible( const QString product );
68   // gets the product script
69   QString getScript( const QString product );
70   // gets the item's visibility status
71   bool isVisible( const QString product );
72
73 protected:
74   // finds the item by the product name
75   ProgressViewItem* findItem( const QString product );
76
77 private:
78   QColor myWaitingColor;     // 'Waiting' color
79   QColor myProcessingColor;  // 'Processing' color
80   QColor myCompletedColor;   // 'Completed' color
81 };
82
83 #endif