QGpGuiTools/PropertyProxy.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpGuiTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2008-03-31
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef PROPERTYPROXY_H
00029 #define PROPERTYPROXY_H
00030 
00031 #include <QtGui>
00032 #include <QGpCoreTools.h>
00033 #include "QGpGuiToolsDLLExport.h"
00034 
00035 namespace QGpGuiTools {
00036 
00037 class PropertyTab;
00038 class PropertyCategory;
00039 class PropertyEditor;
00040 class PropertyItem;
00041 class PropertyWidget;
00042 
00043 class QGPGUITOOLS_EXPORT PropertyProxy : public QObject
00044 {
00045   Q_OBJECT
00046 public:
00047   PropertyProxy(QObject * parent=0);
00048   ~PropertyProxy();
00049 
00050   void raiseEditor();
00051   void setEditor();
00052 
00053   bool setCurrentCategory(uint category);
00054   bool setCurrentTab(uint tab);
00055   PropertyWidget * currentTabWidget() const;
00056 
00057   void addCategory(uint category, QString caption, QIcon icon);
00058   void addTab(uint tab, QString title, PropertyWidget * w, PropertyItem * item);
00059   void addReference(PropertyItem * item);
00060   bool hasReference() const;
00061   int referenceCount() const;
00062   void removeTab(uint tab, PropertyItem * item);
00063 
00064   void setTitle(QString t) {_title=t;}
00065   QString title() const {return _title;}
00066 
00067   void blockUpdates(bool b);
00068   void saveStates();
00069   void restoreStates();
00070   void setValues();
00071   void setCurrentTabValues();
00072 
00073   static uint uniqueId();
00074 private:
00075   inline bool isActive() const;
00076 
00077   QString _title;
00078   PropertyCategory * _currentCategory;
00079   PropertyTab * _currentTab;
00080   QHash<uint, PropertyCategory *> _categories;
00081   bool _blockUpdates;
00082   static uint _lastUniqueId;
00083 };
00084 
00085 } // namespace QGpGuiTools
00086 
00087 #endif // PROPERTYPROXY_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines