Salome HOME
Bug fix: don't set "Loading" state for MacroNodes in InitialState() function (called...
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_Notification.h
1 //  SUPERV SUPERVGUI : GUI for Supervisor component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SUPERVGUI_Notification.h
25 //  Author : Francis KLOSS
26 //  Module : SUPERV
27
28 #ifndef SUPERVGUI_Notification_H
29 #define SUPERVGUI_Notification_H
30
31 using namespace std;
32 #include "SUPERVGUI_Def.h"
33 #include <qdialog.h>
34 #include <qlist.h>
35 #include <qcheckbox.h>
36 #include <qlineedit.h>
37 #include <qpushbutton.h>
38 #include <qvbox.h>
39
40 class SUPERVGUI_Main;
41 class SUPERVGUI_CanvasNode;
42 class SUPERVGUI_NotifWidget;
43
44 class SUPERVGUI_Notification: public QDialog 
45 {
46   Q_OBJECT
47
48 public:
49   SUPERVGUI_Notification(SUPERVGUI_Main* m);
50   ~SUPERVGUI_Notification();
51
52   bool    getLogged();
53   void    setLogged( bool on, QString logFile = QString::null );
54   QString getLogFile();
55   bool    getFiltered();
56   void    setFiltered( bool on );
57   bool    getWarning();
58   void    setWarning( bool on );
59   bool    getStep();
60   void    setStep( bool on );
61   bool    getTrace();
62   void    setTrace( bool on );
63   bool    getVerbose();
64   void    setVerbose( bool on );
65   
66 private slots:
67   void    accept();
68   void    reject();
69   void    loggedClicked();
70   void    browseClicked();
71
72 private:
73   SUPERVGUI_Main*              myMain;
74   QScrollView*                 myView;
75   QVBox*                       myBox;
76   QPushButton*                 myOkBtn;
77   QPushButton*                 myCancelBtn;
78   QCheckBox*                   myLogCheck;
79   QCheckBox*                   myFilterCheck;
80   QLineEdit*                   myFileEdit;
81   QPushButton*                 myBrowseBtn;
82   SUPERVGUI_NotifWidget*       myMainNotif;
83   QList<SUPERVGUI_NotifWidget> myNotifList;
84 };
85
86 class SUPERVGUI_NotifWidget : public QWidget 
87 {
88 public:
89   SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_CanvasNode* n );
90   SUPERVGUI_NotifWidget( QWidget* parent, QString title );
91   ~SUPERVGUI_NotifWidget();
92
93   SUPERVGUI_CanvasNode* getNode() { return myNode; }
94
95   bool getWarning() { return myWarningCheck->isChecked(); }
96   bool getStep()    { return myStepCheck->isChecked();    }
97   bool getTrace()   { return myTraceCheck->isChecked();   }
98   bool getVerbose() { return myVerboseCheck->isChecked(); }
99   
100   void setWarning( bool on ) { myWarningCheck->setChecked( on ); }
101   void setStep( bool on )    { myStepCheck->setChecked( on );    }
102   void setTrace( bool on )   { myTraceCheck->setChecked( on );   }
103   void setVerbose( bool on ) { myVerboseCheck->setChecked( on ); }
104
105 private:
106   void init();
107   
108 private:
109   QString         myTitle;
110   SUPERVGUI_CanvasNode* myNode;
111   QCheckBox*      myWarningCheck;
112   QCheckBox*      myStepCheck;
113   QCheckBox*      myTraceCheck;
114   QCheckBox*      myVerboseCheck;
115 };
116
117 #endif
118
119
120
121
122
123
124