Salome HOME
Merge akl/tests_update: update tests
[modules/paravis.git] / src / PVGUI / PVGUI_ParaViewSettingsPane.h
1 // PARAVIS : ParaView wrapper SALOME module
2 //
3 // Copyright (C) 2010-2014  CEA/DEN, EDF R&D
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 //
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 // File   : PVGUI_ParaViewSettingsPane.h
22 // Author : Vitaly Smetannikov
23 //
24
25
26 #ifndef PVGUI_ParaViewSettingsPane_H
27 #define PVGUI_ParaViewSettingsPane_H
28
29 #include <QtxPagePrefMgr.h>
30
31 #include <QWidget>
32
33 #include "vtkPVConfig.h"
34
35 class pqOptionsContainer;
36 class OptionsDialogForm;
37 class pqOptionsPage;
38 class QString;
39
40
41 class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent
42 {
43   Q_OBJECT
44
45 public:
46   PVGUI_ParaViewSettingsPane(QWidget *parent=0);
47   virtual ~PVGUI_ParaViewSettingsPane();
48
49   /// \brief
50   ///   Gets whether or not there are changes to apply.
51   /// \return
52   ///   True if there are changes to apply.
53   //bool isApplyNeeded() const;
54
55   /// \brief
56   ///   Sets whether or not there are changes to apply.
57   /// \param applyNeeded True if there are changes to apply.
58   //void setApplyNeeded(bool applyNeeded);
59
60   /// \brief
61   ///   Adds a page to the options dialog.
62   ///
63   /// When the options object is a page container, the path parameter
64   /// becomes the path prefix for the container pages.
65   ///
66   /// \param path The name hierarchy for the options page.
67   /// \param options The options page.
68   void addOptions(const QString &path, pqOptionsPage *options);
69
70   /// \brief
71   ///   Adds a container to the options dialog.
72   ///
73   /// Each page listed for the container is added to the root of the
74   /// selection tree.
75   ///
76   /// \param options The options container to add.
77   void addOptions(pqOptionsContainer *options);
78
79   /// \brief
80   ///   Removes the options page from the options dialog.
81   ///
82   /// The page name is removed from the selection tree. If the page
83   /// is an options container, all the names are removed.
84   ///
85   /// \param options The options page/container to remove.
86   void removeOptions(pqOptionsPage *options);
87
88   /// Implementation of QtxUserDefinedContent interface
89   virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
90   virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref);
91
92
93 public slots:
94   /// \brief
95   ///   Sets the current options page.
96   /// \param path The name of the options page to show.
97   void setCurrentPage(const QString &path);
98
99   /// Calls each page to apply any changes.
100   void applyChanges();
101
102   /// Calls each page to reset any changes.
103   void resetChanges();
104
105 signals:
106   /// Emitted before the option changes are applied.
107   void aboutToApplyChanges();
108
109   /// Emitted after the option changes have been applied.
110   void appliedChanges();
111
112 protected slots:
113   void pluginLoaded(QObject* plugin_interface);
114
115 private slots:
116   /// Changes the current page to match the user selection.
117   void changeCurrentPage();
118
119 private:
120   OptionsDialogForm *Form; /// Stores the form and class data.
121 };
122
123 #endif