1 // File : SALOME_ProgressView.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
9 #ifndef __SALOME_ProgressView
10 #define __SALOME_ProgressView
12 #include <qlistview.h>
15 Class ProgressViewItem: Progress list view item
17 enum Status { Waiting, Processing, Completed, Aborted };
19 class ProgressViewItem : public QListViewItem
23 ProgressViewItem( ProgressView* parent,
25 const QString installType,
26 const QString scriptName,
27 Status status = Waiting );
29 // sets product status
30 void setStatus( Status status );
31 // gets product status
32 Status getStatus() const { return myStatus; }
34 QString getProduct() const { return text( 0 ); }
35 // gets product script
36 QString getScript() const { return myScript; }
37 // gets type of the installation: 'binaries', 'source', 'native' or 'not install'
38 QString getInstallType() const { return text( 1 ); }
41 // paints cell of the item
42 void paintCell( QPainter* painter, const QColorGroup& cg, int column, int width, int align );
45 Status myStatus; // status
46 QString myScript; // alias
50 Class ProgressView: Progress list view
52 class ProgressView : public QListView
56 ProgressView( QWidget* parent );
58 // sets/gets status colors
59 void setColors( QColor wColor, QColor pColor, QColor cColor );
60 QColor getWaitingColor() { return myWaitingColor; }
61 QColor getProcessingColor() { return myProcessingColor; }
62 QColor getCompletedColor() { return myCompletedColor; }
65 void addProduct( const QString smbName, const QString type, const QString product );
66 // finds the first item with given status
67 QString findStatus( Status status );
68 // sets new status for the product item
69 void setStatus( const QString product, Status status );
70 // scrolls the view to make item visible if necessary
71 void ensureVisible( const QString product );
72 // gets the product script
73 QString getScript( const QString product );
76 // finds the item by the product name
77 ProgressViewItem* findItem( const QString product );
80 QColor myWaitingColor; // 'Waiting' color
81 QColor myProcessingColor; // 'Processing' color
82 QColor myCompletedColor; // 'Completed' color