Salome HOME
a8131dd9ae0b56487927687c71c62e6bdf850ffa
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI_Resource.hxx
1 // Copyright (C) 2009-2023  CEA, EDF
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
18 //
19
20 #ifndef _HEXABLOCKGUI_RESOURCE_HXX_
21 #define _HEXABLOCKGUI_RESOURCE_HXX_
22
23 #include <QColor>
24 #include <QFont>
25 #include <QString>
26
27 #include "HEXABLOCKGUI_Export.hxx"
28
29 class HEXABLOCKGUI;
30 class SUIT_ResourceMgr;
31
32 class HEXABLOCK_EXPORT HEXABLOCKGUI_Resource 
33 {
34   public:
35     HEXABLOCKGUI_Resource(SUIT_ResourceMgr* r);
36     virtual void createPreferences(HEXABLOCKGUI* swm);
37     virtual void preferencesChanged( const QString& sect, const QString& name );
38     virtual void preferencesChanged();
39
40   protected:
41     int     integerValue( const QString& name, const int     def = 0          ) const;
42     double  doubleValue ( const QString& name, const double  def = 0          ) const;
43     bool    booleanValue( const QString& name, const bool    def = false      ) const;
44     QFont   fontValue   ( const QString& name, const QFont&  def = QFont()    ) const;
45     QColor  colorValue  ( const QString& name, const QColor& def = QColor()   ) const;
46     QColor  colorValue  ( const QString& name, const Qt::GlobalColor c        ) const;
47     QColor  colorValue  ( const QString& name, const int h, const int s, const int v ) const;
48     QString stringValue ( const QString& name, const QString& def = QString() ) const;
49
50     void setValue( const QString& name, const int      val );
51     void setValue( const QString& name, const double   val );
52     void setValue( const QString& name, const bool     val );
53     void setValue( const QString& name, const QFont&   val );
54     void setValue( const QString& name, const QColor&  val );
55     void setValue( const QString& name, const QString& val );
56
57   protected:
58     SUIT_ResourceMgr* _resource;
59 };
60
61
62 #endif
63