Salome HOME
73662b987336b7d2f0fd7c124ef89520c321e815
[modules/shaper.git] / src / PartSet / PartSet_WidgetFileSelector.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
18 //
19
20 /*
21  * PartSet_WidgetFileSelector.h
22  *
23  *  Created on: May 18, 2015
24  *      Author: spo
25  */
26
27 #ifndef PARTSET_WIDGETFILESELECTOR_H_
28 #define PARTSET_WIDGETFILESELECTOR_H_
29
30 #include "PartSet.h"
31
32 #include <ModuleBase_WidgetFileSelector.h>
33
34 class ModuleBase_IWorkshop;
35
36 /**
37 * \ingroup Modules
38 * Customization of ModuleBase_WidgetFileSelector in order to write
39 * format of exported file.
40 */
41 class PARTSET_EXPORT PartSet_WidgetFileSelector : public ModuleBase_WidgetFileSelector
42 {
43   Q_OBJECT
44 public:
45   /// Constructor
46   /// \param theParent the parent object
47   /// \param theWorkshop instance of workshop interface
48   /// \param theData the widget configuration. The attribute of the model widget is obtained from
49   PartSet_WidgetFileSelector(QWidget* theParent,
50                              ModuleBase_IWorkshop* theWorkshop,
51                              const Config_WidgetAPI* theData);
52
53   virtual ~PartSet_WidgetFileSelector() {}
54
55 protected:
56   /// Reimplemented from ModuleBase_WidgetFileSelector::storeValueCustom()
57   virtual bool storeValueCustom();
58
59   /// Reimplemented from ModuleBase_WidgetFileSelector::restoreValue()
60   virtual bool restoreValueCustom();
61
62   /// Returns a full format string for the short format
63   QString shortFormatToFullFormat( const QString & theShortFormat ) const;
64
65 private:
66   ModuleBase_IWorkshop* myWorkshop; // the current workshop
67 };
68
69 #endif /* PARTSET_WIDGETFILESELECTOR_H_ */