Loading...
Searching...
No Matches
SimplePropertyWidgetFactory.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 terralib/qt/widget/property/SimplePropertyWidgetFactory.h
22
23 \brief A factory to build widget objects.
24*/
25
26#ifndef __TERRALIB_QT_WIDGETS_PROPERTY_INTERNAL_SIMPLEPROPERTYWIDGETFACTORY_H
27#define __TERRALIB_QT_WIDGETS_PROPERTY_INTERNAL_SIMPLEPROPERTYWIDGETFACTORY_H
28
29// TerraLib
30#include "../../../common/AbstractFactory.h"
31#include "../../../datatype/Enums.h"
32#include "../Config.h"
34
35// QT
36#include <QWidget>
37
38namespace te
39{
40 namespace qt
41 {
42 namespace widgets
43 {
44 /*!
45 \class SimplePropertyWidgetFactory
46
47 \brief A factory to build widget objects.
48 */
49 class TEQTWIDGETSEXPORT SimplePropertyWidgetFactory : public te::common::AbstractFactory<te::qt::widgets::SimplePropertyWidget, int>
50 {
51 public:
52
54
55 static te::qt::widgets::SimplePropertyWidget* make(const int& type, QWidget* parent = 0);
56
57 /*!
58 \brief Virtual destructor.
59
60 \note It will automatically unregister the factory from the dictionary.
61 */
63
64 /*!
65 \brief It returns the type of component widget that the factory knows how to create.
66
67 \return The type of component widget that the factory knows how to create.
68 */
69 virtual int getType() const = 0;
70
71 protected:
72
73 /*!
74 \brief It creates the factory.
75
76 The key of a ComponentWidgetFactory is a string.
77
78 \param factoryKey The key that identifies the factory.
79 */
80 SimplePropertyWidgetFactory(const int& factoryKey);
81
82 virtual te::qt::widgets::SimplePropertyWidget* create(QWidget* Parent = 0) = 0;
83
84 };
85 } // end namespace widgets
86 } // end namespace qt
87} // end namespace te
88
89#endif // __TERRALIB_QT_WIDGETS_PROPERTY_INTERNAL_SIMPLEPROPERTYWIDGETFACTORY_H
A base widget for simple properties.
This class defines the interface of abstract factories without initializing parameters.
virtual te::qt::widgets::SimplePropertyWidget * create(QWidget *Parent=0)=0
virtual int getType() const =0
It returns the type of component widget that the factory knows how to create.
static te::qt::widgets::SimplePropertyWidget * make(const int &type, QWidget *parent=0)
SimplePropertyWidgetFactory(const int &factoryKey)
It creates the factory.
static te::qt::widgets::SimplePropertyWidget * make(const int &type)
virtual ~SimplePropertyWidgetFactory()
Virtual destructor.
A base widget for simple properties.
TerraLib.
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:63