Salome HOME
Modify default icon for the module
[modules/gui.git] / src / Plot2d / Plot2d_ViewWindow.h
1 #ifndef PLOT2D_VIEWWINDOW_H
2 #define PLOT2D_VIEWWINDOW_H
3
4 #include "Plot2d.h"
5
6 #include "Plot2d_ViewModel.h"
7 #include "Plot2d_ViewFrame.h"
8
9 #include <SUIT_Desktop.h>
10 #include <SUIT_ViewWindow.h>
11 #include <SUIT_ToolButton.h>
12
13 #include <QtxAction.h>
14
15 #include <qstring.h>
16 #include <qstring.h>
17 #include <qtoolbar.h>
18 #include <qpopupmenu.h>
19
20 #ifdef WIN32
21 #pragma warning( disable:4251 )
22 #endif
23
24 class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow  
25 {
26   Q_OBJECT
27
28 public:
29   Plot2d_ViewWindow( SUIT_Desktop* theDesktop, Plot2d_Viewer* theModel );
30   virtual ~Plot2d_ViewWindow();
31
32   Plot2d_Viewer*    getModel() { return myModel; }
33   void              putInfo(QString theMsg);
34   Plot2d_ViewFrame* getViewFrame() { return myViewFrame; };
35   QToolBar*         getToolBar() { return myToolBar; };
36   void              contextMenuPopup( QPopupMenu* thePopup );
37
38 protected:
39   QImage dumpView();
40
41 private:
42   bool eventFilter(QObject* watched, QEvent* e);
43
44   void createActions();
45   void createToolBar();
46
47 public slots:
48   void onChangeHorMode();
49   void onChangeVerMode();
50   void onChangeCurveMode();
51   void onChangeLegendMode();
52   
53   void onFitAll();
54   void onFitRect();
55   void onZoom();
56   void onPanning();
57   void onGlobalPanning();
58   void onViewHorMode();
59   void onViewVerMode();
60   void onLegend();
61   void onCurves();
62
63   void onDumpView();
64
65 signals:
66   void cloneView();
67
68 protected:
69   enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, HorId,
70          VerId, LegendId, CurvPointsId, CurvLinesId, CurvSplinesId, CurvSettingsId, CloneId,
71          PModeXLinearId, PModeXLogarithmicId, PModeYLinearId, PModeYLogarithmicId };
72   typedef QMap<int, QtxAction*> ActionsMap;
73   ActionsMap        myActionsMap;
74
75 private:
76   Plot2d_Viewer*    myModel;
77   Plot2d_ViewFrame* myViewFrame;
78   QToolBar*         myToolBar;
79
80   SUIT_ToolButton*  myCurveBtn;
81 };
82
83 #ifdef WIN32
84 #pragma warning( default:4251 )
85 #endif
86
87 #endif