All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AbstractPropertiesBrowser.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file PropertyBrowser.h
22 
23  \brief Manage properties variants values.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_ABSTRACT_PROPERTIES_BROWSER_H
29 #define __TERRALIB_LAYOUT_INTERNAL_ABSTRACT_PROPERTIES_BROWSER_H
30 
31 // TerraLib
32 #include "../../../core/property/Property.h"
33 #include "../../../core/Config.h"
34 
35 // STL
36 #include <string>
37 
38 // Qt
39 #include <QObject>
40 #include <QVariant>
41 #include <QString>
42 #include <QMap>
43 
44 // QtPropertyBrowser
45 #include <QtPropertyBrowser/QtVariantProperty>
46 #include <QtPropertyBrowser/QtProperty>
47 
48 class QGraphicsItem;
49 class QWidget;
50 
51 namespace te
52 {
53  namespace layout
54  {
55  class Properties;
56  class EnumType;
57 
58  /*!
59  \brief Manage properties variants values.
60 
61  \ingroup layout
62  */
64  {
65  public:
66 
67  AbstractPropertiesBrowser(QObject *parent = 0);
68 
69  virtual ~AbstractPropertiesBrowser();
70 
71  virtual QtProperty* addProperty(Property property) = 0;
72 
73  virtual bool updateProperty(Property property) = 0;
74 
75  virtual void clearAll();
76 
77  virtual Property getProperty(std::string name) = 0;
78 
79  virtual EnumType* getLayoutType(QVariant::Type type, std::string name = "") = 0;
80 
81  virtual int getVariantType(EnumType* dataType) = 0;
82 
83  virtual QVariant findPropertyValue(std::string name);
84 
85  virtual QtProperty* findProperty(std::string name);
86 
87  virtual bool removeProperty(QtProperty* prop);
88 
89  protected:
90 
91  virtual void createManager() = 0;
92 
93  virtual void addPropertyItem(QtProperty *property, const QString &id);
94 
95  virtual QVariant checkComplexType(QtVariantProperty* property);
96 
98  QMap<QtProperty*, QString> m_propertyToId;
99  QMap<QString, QtProperty*> m_idToProperty;
100  };
101  }
102 }
103 
104 #endif
105 
106 
107 
108 
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
QMap< QString, QtProperty * > m_idToProperty
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
QMap< QtProperty *, QString > m_propertyToId
Manage properties variants values.
A property acts like a attribute member of a object and stores the state of this attribute. A set of properties stores the state of an object. Any data type, not included in the convertValue method in the class te::layout::Variant, it will be by default "std::string" value.
Definition: Property.h:47