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)
5 // Module : Installation Wizard
6 // Copyright : 2002-2007 CEA
8 #ifndef __SALOME_ProgressView
9 #define __SALOME_ProgressView
11 #include <qlistview.h>
14 Class ProgressViewItem: Progress list view item
16 enum Status { Waiting, Processing, Completed, Aborted };
18 class ProgressViewItem : public QListViewItem
22 ProgressViewItem( ProgressView* parent,
24 const QString scriptName,
25 Status status = Waiting );
27 // sets product status
28 void setStatus( Status status );
29 // gets product status
30 Status getStatus() const { return myStatus; }
32 QString getProduct() const { return text( 0 ); }
33 // gets product script
34 QString getScript() const { return myScript; }
37 // paints cell of the item
38 void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
41 Status myStatus; // status
42 QString myScript; // alias
46 Class ProgressView: Progress list view
48 class ProgressView : public QListView
52 ProgressView( QWidget* parent );
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; }
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 );
74 // finds the item by the product name
75 ProgressViewItem* findItem( const QString product );
78 QColor myWaitingColor; // 'Waiting' color
79 QColor myProcessingColor; // 'Processing' color
80 QColor myCompletedColor; // 'Completed' color