All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DialogPropertiesBrowser.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 DialogPropertiesBrowser.h
22 
23  \brief Manage properties dialogs values.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_DIALOG_PROPERTIES_BROWSER_H
29 #define __TERRALIB_LAYOUT_INTERNAL_DIALOG_PROPERTIES_BROWSER_H
30 
31 // TerraLib
33 #include "../../../core/property/Property.h"
34 #include "../../../core/Config.h"
35 
36 // STL
37 #include <map>
38 #include <string>
39 
40 // Qt
41 #include <QObject>
42 
43 // QtPropertyBrowser
44 #include <QtPropertyBrowser/QtStringPropertyManager>
45 #include <QtPropertyBrowser/qteditorfactory.h>
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 EnumDataType;
57  class EnumType;
58 
59  /*!
60  \brief Manage properties dialogs values.
61 
62  \ingroup layout
63  */
65  {
66  Q_OBJECT //for slots/signals
67 
68  public:
69 
70  DialogPropertiesBrowser(QObject *parent = 0);
71 
72  DialogPropertiesBrowser(QtDlgEditorFactory* factory, QtStringPropertyManager* manager, QObject *parent = 0);
73 
74  virtual ~DialogPropertiesBrowser();
75 
76  QtStringPropertyManager* getStringPropertyManager();
77 
78  QtDlgEditorFactory* getDlgEditorFactory();
79 
80  std::map<std::string, Property> getDlgProps();
81 
82  virtual void closeAllWindows();
83 
84  virtual bool changeQtPropertyValue(QtProperty* pproperty, Property property);
85 
86  virtual QtProperty* addProperty(Property property);
87 
88  virtual bool updateProperty(Property property);
89 
90  virtual bool checkDlgType(Property prop);
91 
92  virtual Property findDlgProperty(std::string name);
93 
94  virtual Property findDlgProperty(EnumType* dataType);
95 
96  virtual Property getProperty(std::string name);
97 
98  virtual EnumType* getLayoutType(QVariant::Type type, std::string name = "");
99 
100  virtual int getVariantType(EnumType* dataType);
101 
102  protected slots:
103 
104  /*
105  \brief By default it is connected with the internalDlg method of the class QtDlgEditorFactory.
106  The internalDlg method is called when an item of property browser tree is clicked.
107  */
108 
109  virtual void onSetDlg(QWidget *parent, QtProperty * prop);
110 
111  virtual void updateOutside(Property prop);
112 
113  virtual void onShowGridSettingsDlg();
114 
115  virtual void onShowImageDlg();
116 
117  virtual void onShowTextGridSettingsDlg();
118 
119  signals:
120 
121  void changeDlgProperty(Property property);
122 
123  protected:
124 
125  virtual void createManager();
126 
127  virtual void changeValueQtPropertyDlg(std::string name, QVariant variant);
128 
129  virtual QWidget* createOutside(EnumType* enumType);
130 
131  protected:
132 
133  QtStringPropertyManager* m_strDlgManager;
134  QtDlgEditorFactory* m_dlgEditorFactory;
135  std::map<std::string, Property> m_dlgProps;
137  };
138  }
139 }
140 
141 #endif
142 
143 
144 
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
Manage properties dialogs values.
std::map< std::string, Property > m_dlgProps
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
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