Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / ModuleBase / ModuleBase_IPrefMgr.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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef ModuleBase_IPrefMgr_H
22 #define ModuleBase_IPrefMgr_H
23
24 #include "ModuleBase.h"
25
26 #include <QString>
27 #include <SUIT_PreferenceMgr.h>
28
29 /** 
30 * \ingroup GUI
31 * An interface class which provides incapsulation of SUIT_PreferenceMgr class instance 
32 * It is used in order to make common interface to Preference manager in Salome 
33 * and this application
34 */
35 class MODULEBASE_EXPORT ModuleBase_IPrefMgr
36 {
37 public:
38   /// Default constructor
39   ModuleBase_IPrefMgr();
40   /// Virtual destructor
41   virtual ~ModuleBase_IPrefMgr();
42
43   /** 
44   * Add preference item into preference dialog box
45   * \param theLbl - label of the item
46   * \param pId - id of container item
47   * \param theType - type of the item
48   * \param theSection - resouce section name
49   * \param theName - name of the resource
50   * Returns Id of the ctreated item
51   */
52   virtual int addPreference(const QString& theLbl, int pId,
53                             SUIT_PreferenceMgr::PrefItemType theType,
54                             const QString& theSection, const QString& theName ) = 0;
55
56   /**
57   * \brief Set property of an item
58   * \param thePropName the property name
59   * \param theValue the value of the property
60   * \param theId id of the property
61   */
62   virtual void setItemProperty(const QString& thePropName,
63                                const QVariant& theValue,
64                                const int theId = -1) = 0;
65
66   /// Returns incapsulated preference manager
67   virtual SUIT_PreferenceMgr* prefMgr() const = 0;
68 };
69
70 #endif