All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OutsideObserver.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 OutsideObserver.h
22 
23  \brief Abstract class to represent an observer. "View" part of MVC widget. All classes representing the graphics widget must inherit from this class.
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_OUTSIDE_OBSERVER_H
29 #define __TERRALIB_LAYOUT_INTERNAL_OUTSIDE_OBSERVER_H
30 
31 // TerraLib
32 #include "Observer.h"
33 #include "../../property/Properties.h"
34 #include "../../ContextItem.h"
35 #include "../../../../geometry/Coord2D.h"
36 #include "../../Config.h"
37 
38 namespace te
39 {
40  namespace layout
41  {
42  class OutsideController;
43  class Observable;
44 
45  /*!
46  \brief Abstract class to represent an observer. "View" part of MVC widget. All classes representing the graphics component must inherit from this class.
47 
48  \ingroup layout
49 
50  \sa te::layout::Observer
51  */
53  {
54  public:
55 
56  /*!
57  \brief Constructor
58 
59  \param controller "Controller" part of MVC widget
60  \param o "Model" part of MVC widget
61  */
63 
64  /*!
65  \brief Destructor
66  */
67  virtual ~OutsideObserver();
68 
69  /*!
70  \brief Reimplemented from Observer
71  */
72  virtual void updateObserver(ContextItem context) = 0;
73 
74  /*!
75  \brief Change coordinate llx,lly of the MVC widget.
76  Reimplement this function in a ItemController subclass to provide the controller's create implementation.
77 
78  \param x llx
79  \param y lly
80  */
81  virtual void setPosition(const double& x, const double& y) = 0;
82 
83  /*!
84  \brief Method that returns the position llx, lly
85  Reimplement this function in a ItemObserver subclass to provide the item's getPosition implementation.
86 
87  \return coordinate
88  */
89  virtual te::gm::Coord2D getPosition() = 0;
90 
91  /*!
92  \brief Updated model state.
93 
94  \param true if refresh the current position, false otherwise
95  */
96  virtual void refresh();
97 
98  /*!
99  \brief Reimplemented from Observer
100  */
101  virtual Properties* getProperties() const;
102 
103  /*!
104  \brief Returns the "Controller" part of the MVC.
105 
106  \return controller
107  */
108  virtual OutsideController* getController();
109 
110  /*!
111  \brief Returns the "Model" part of the MVC.
112 
113  \return model
114  */
115  virtual Observable* getModel();
116 
117  protected:
118 
119  OutsideController* m_controller; //!< "Controller" part of MVC widget.
120  Observable* m_model; //!< "Model" part of MVC widget.
121  };
122  }
123 }
124 
125 #endif
Abstract class to represent an observable. "Model" part of MVC component.
Definition: Observable.h:56
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
#define TELAYOUTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:99
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
Abstract class to represent an observer. "View" part of MVC component.
The Properties class represents a persistent set of properties. The Properties can be saved to a file...
Definition: Properties.h:52
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
Abstract class to represent an observer. "View" part of MVC component.
Definition: Observer.h:48
Observable * m_model
"Model" part of MVC widget.
Abstract class to represent a controller. "Controller" part of MVC widget. All classes representing t...
OutsideController * m_controller
"Controller" part of MVC widget.