Back to index

salome-gui  6.5.0
SUIT_PreferenceMgr.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      SUIT_PreferenceMgr.h
00021 // Author:    Sergey TELKOV
00022 //
00023 #ifndef SUIT_PREFERENCEMGR_H
00024 #define SUIT_PREFERENCEMGR_H
00025 
00026 // This class is obsoleted.
00027 // It was created for backward compatibility with ResourceEdit from Salome version 3.x.x
00028 
00029 #include "SUIT.h"
00030 
00031 #include "QtxPagePrefMgr.h"
00032 
00033 class SUIT_EXPORT SUIT_PreferenceMgr : public QtxPagePrefMgr
00034 {
00035   Q_OBJECT
00036 
00037 public:
00038   typedef enum { Auto, Space, Bool, Color, String, Selector,
00039                  DblSpin, IntSpin, Double, Integer,
00040                  GroupBox, Tab, Frame, Font, DirList, File,
00041                Slider, Shortcut, ShortcutTree, BiColor, Background,           
00042                  UserDefined = 1000 } PrefItemType;
00043 
00044 public:
00045   SUIT_PreferenceMgr( QtxResourceMgr*, QWidget* = 0 );
00046   virtual ~SUIT_PreferenceMgr();
00047 
00048   QIcon              itemIcon( const int ) const;
00049   void               setItemIcon( const int, const QIcon& );
00050 
00051   QVariant           itemProperty( const QString&, const int = -1 ) const;
00052   void               setItemProperty( const QString&, const QVariant&, const int = -1 );
00053 
00054   int                addItem( const QString&, const int pId = -1, const PrefItemType = Auto,
00055                               const QString& = QString(), const QString& = QString() );
00056 
00057 protected:
00058   virtual QVariant   optionValue( const QString& ) const;
00059   virtual void       setOptionValue( const QString&, const QVariant& );
00060 
00061 private:
00062   QtxPreferenceItem* myRoot;
00063 };
00064 
00065 #endif