Salome HOME
479203df1c8b011eea6fa342f03447a92da1a7ca
[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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 #include "SUPERVGUI_Def.h"
32 #include <qdialog.h>
33 #include <qlist.h>
34 #include <qcheckbox.h>
35 #include <qlineedit.h>
36 #include <qpushbutton.h>
37 #include <qvbox.h>
38
39 class SUPERVGUI_Main;
40 class SUPERVGUI_CanvasNode;
41 class SUPERVGUI_NotifWidget;
42
43 class SUPERVGUI_Notification: public QDialog 
44 {
45   Q_OBJECT
46
47 public:
48   SUPERVGUI_Notification(SUPERVGUI_Main* m);
49   ~SUPERVGUI_Notification();
50
51   bool    getLogged();
52   void    setLogged( bool on, QString logFile = QString::null );
53   QString getLogFile();
54   bool    getFiltered();
55   void    setFiltered( bool on );
56   bool    getWarning();
57   void    setWarning( bool on );
58   bool    getStep();
59   void    setStep( bool on );
60   bool    getTrace();
61   void    setTrace( bool on );
62   bool    getVerbose();
63   void    setVerbose( bool on );
64   
65 private slots:
66   void    accept();
67   void    reject();
68   void    loggedClicked();
69   void    browseClicked();
70
71 private:
72   SUPERVGUI_Main*              myMain;
73   QScrollView*                 myView;
74   QVBox*                       myBox;
75   QPushButton*                 myOkBtn;
76   QPushButton*                 myCancelBtn;
77   QCheckBox*                   myLogCheck;
78   QCheckBox*                   myFilterCheck;
79   QLineEdit*                   myFileEdit;
80   QPushButton*                 myBrowseBtn;
81   SUPERVGUI_NotifWidget*       myMainNotif;
82   QList<SUPERVGUI_NotifWidget> myNotifList;
83 };
84
85 class SUPERVGUI_NotifWidget : public QWidget 
86 {
87 public:
88   SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_CanvasNode* n );
89   SUPERVGUI_NotifWidget( QWidget* parent, QString title );
90   ~SUPERVGUI_NotifWidget();
91
92   SUPERVGUI_CanvasNode* getNode() { return myNode; }
93
94   bool getWarning() { return myWarningCheck->isChecked(); }
95   bool getStep()    { return myStepCheck->isChecked();    }
96   bool getTrace()   { return myTraceCheck->isChecked();   }
97   bool getVerbose() { return myVerboseCheck->isChecked(); }
98   
99   void setWarning( bool on ) { myWarningCheck->setChecked( on ); }
100   void setStep( bool on )    { myStepCheck->setChecked( on );    }
101   void setTrace( bool on )   { myTraceCheck->setChecked( on );   }
102   void setVerbose( bool on ) { myVerboseCheck->setChecked( on ); }
103
104 private:
105   void init();
106   
107 private:
108   QString         myTitle;
109   SUPERVGUI_CanvasNode* myNode;
110   QCheckBox*      myWarningCheck;
111   QCheckBox*      myStepCheck;
112   QCheckBox*      myTraceCheck;
113   QCheckBox*      myVerboseCheck;
114 };
115
116 #endif
117
118
119
120
121
122
123