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 PROPERTYTAB_H 00029 #define PROPERTYTAB_H 00030 00031 #include <QtGui> 00032 00033 namespace QGpGuiTools { 00034 00035 class PropertyItem; 00036 class PropertyWidget; 00037 00038 class PropertyTab : public QObject 00039 { 00040 Q_OBJECT 00041 public: 00042 PropertyTab(); 00043 ~PropertyTab(); 00044 00045 void setTitle(QString t) {_title=t;} 00046 QString title() const {return _title;} 00047 00048 void setWidget(PropertyWidget * w); 00049 PropertyWidget * widget() const {return _widget;} 00050 00051 void addReference(PropertyItem * item); 00052 void removeReference(PropertyItem * item); 00053 bool hasReference() const {return !_references.isEmpty();} 00054 int referenceCount() const {return _references.count();} 00055 bool contains(PropertyItem * item); 00056 public slots: 00057 void setValues(); 00058 private slots: 00059 void setProperty(int id, QVariant val); 00060 private: 00061 QString _title; 00062 PropertyWidget * _widget; 00063 QSet<PropertyItem *> _references; 00064 PropertyItem * _currentItem; 00065 }; 00066 00067 } // namespace QGpGuiTools 00068 00069 #endif // PROPERTYTAB_H