Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / Qtx / QtxResourceMgr.h
index 7b0855d08a110c8561c76ee7f83f8b836d308891..bcaa4ebf564ade0318fd15e1a757b6c46646aa00 100644 (file)
@@ -1,3 +1,21 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
 #ifndef QTX_RESOURCEMGR_H
 #define QTX_RESOURCEMGR_H
 
@@ -50,8 +68,14 @@ public:
   bool            checkExisting() const;
   virtual void    setCheckExisting( const bool );
 
+  bool            isPixmapCached() const;
+  void            setIsPixmapCached( const bool );
+
   void            clear();
 
+  void            setIgnoreUserValues( const bool = true );
+  bool            ignoreUserValues() const;
+
   bool            value( const QString&, const QString&, int& ) const;
   bool            value( const QString&, const QString&, double& ) const;
   bool            value( const QString&, const QString&, bool& ) const;
@@ -109,6 +133,7 @@ public:
   QString         path( const QString&, const QString&, const QString& ) const;
 
   bool            load();
+  bool            import( const QString& );
   bool            save();
 
   QStringList     sections() const;
@@ -120,7 +145,7 @@ protected:
   virtual void    setDirList( const QStringList& );
   virtual void    setResource( const QString&, const QString&, const QString& );
 
-  virtual QString userFileName( const QString& ) const;
+  virtual QString userFileName( const QString&, const bool = true ) const;
   virtual QString globalFileName( const QString& ) const;
 
 private:
@@ -147,6 +172,9 @@ private:
   bool            myCheckExist;
   TransListMap    myTranslator;
   QPixmap         myDefaultPix;
+  bool            myIsPixmapCached;
+
+  bool            myIsIgnoreUserValues;
 };
 
 /*!
@@ -184,7 +212,7 @@ private:
 class QtxResourceMgr::Resources
 {
 public:
-  Resources( const QString& );
+  Resources( const QtxResourceMgr*, const QString& );
   virtual ~Resources();
 
   QString                file() const;
@@ -212,6 +240,9 @@ public:
 
   QString                path( const QString&, const QString&, const QString& ) const;
 
+protected:
+  QtxResourceMgr*        resMgr() const;
+
 private:
   Section&               section( const QString& );
   const Section&         section( const QString& ) const;
@@ -224,6 +255,8 @@ private:
 private:
   SectionMap             mySections;
   QString                myFileName;
+  QMap<QString,QPixmap>  myPixmapCache;
+  QtxResourceMgr*        myMgr;
 
   friend class QtxResourceMgr::Format;
 };