1 // File : SALOME_ProgressView.hxx
2 // Created : Thu Dec 18 12:01:00 2002
3 // Author : Vadim SANDLER
5 // Module : Installation Wizard
6 // Copyright : 2004-2005 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 installType,
25 const QString scriptName,
26 Status status = Waiting );
28 // sets product status
29 void setStatus( Status status );
30 // gets product status
31 Status getStatus() const { return myStatus; }
33 QString getProduct() const { return text( 0 ); }
34 // gets product script
35 QString getScript() const { return myScript; }
36 // gets type of the installation: 'binaries', 'source', 'native' or 'not install'
37 QString getInstallType() const { return text( 1 ); }
40 // paints cell of the item
41 void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
44 Status myStatus; // status
45 QString myScript; // alias
49 Class ProgressView: Progress list view
51 class ProgressView : public QListView
55 ProgressView( QWidget* parent );
57 // sets/gets status colors
58 void setColors( QColor wColor, QColor pColor, QColor cColor );
59 QColor getWaitingColor() { return myWaitingColor; }
60 QColor getProcessingColor() { return myProcessingColor; }
61 QColor getCompletedColor() { return myCompletedColor; }
64 void addProduct( const QString smbName, const QString type, const QString product );
65 // finds the first item with given status
66 QString findStatus( Status status );
67 // sets new status for the product item
68 void setStatus( const QString product, Status status );
69 // scrolls the view to make item visible if necessary
70 void ensureVisible( const QString product );
71 // gets the product script
72 QString getScript( const QString product );
75 // finds the item by the product name
76 ProgressViewItem* findItem( const QString product );
79 QColor myWaitingColor; // 'Waiting' color
80 QColor myProcessingColor; // 'Processing' color
81 QColor myCompletedColor; // 'Completed' color