All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VariantPropertiesBrowser.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_VARIANT_PROPERTIES_BROWSER_H
29 #define __TERRALIB_LAYOUT_INTERNAL_VARIANT_PROPERTIES_BROWSER_H
30 
31 // TerraLib
33 #include "../../../core/property/Property.h"
34 #include "../../../core/Config.h"
35 
36 // Qt
37 #include <QObject>
38 
39 // QtPropertyBrowser
40 #include <QtPropertyBrowser/QtProperty>
41 #include <QtPropertyBrowser/QtVariantPropertyManager>
42 #include <QtPropertyBrowser/QtVariantEditorFactory>
43 #include <QtPropertyBrowser/QtVariantProperty>
44 
45 namespace te
46 {
47  namespace layout
48  {
49  class Properties;
50  class EnumType;
51 
52  /*!
53  \brief Manage properties variants values.
54 
55  \ingroup layout
56  */
58  {
59  Q_OBJECT //for slots/signals
60 
61  public:
62 
63  VariantPropertiesBrowser(QObject *parent = 0);
64 
65  virtual ~VariantPropertiesBrowser();
66 
67  virtual QtVariantProperty* addProperty(Property property);
68 
69  virtual bool updateProperty(Property property);
70 
71  virtual Property getProperty(std::string name);
72 
73  virtual EnumType* getLayoutType(QVariant::Type type, std::string name = "");
74 
75  virtual int getVariantType(EnumType* dataType);
76 
77  virtual bool changeQtVariantPropertyValue(QtVariantProperty* vproperty, Property property);
78 
79  QtVariantPropertyManager* getVariantPropertyManager();
80 
81  QtVariantEditorFactory* getVariantEditorFactory();
82 
83  protected:
84 
85  virtual void createManager();
86 
87  virtual void addAttribute(QtVariantProperty* vproperty, Property property);
88 
89  QtVariantPropertyManager* m_variantPropertyEditorManager;
90  QtVariantEditorFactory* m_variantPropertyEditorFactory;
91  };
92  }
93 }
94 
95 #endif
96 
97 
Manage properties variants values.
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
QtVariantEditorFactory * m_variantPropertyEditorFactory
QtVariantPropertyManager * m_variantPropertyEditorManager
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