All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ItemObserver.h
Go to the documentation of this file.
1 /* Copyright (C) 2001-2014 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 ItemObserver.h
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 #ifndef __TERRALIB_LAYOUT_INTERNAL_ITEM_OBSERVER_H
29 #define __TERRALIB_LAYOUT_INTERNAL_ITEM_OBSERVER_H
30 
31 // TerraLib
32 #include "Observer.h"
33 #include "ContextItem.h"
34 #include "../../../../../geometry/Coord2D.h"
35 
36 // Boost
37 #include <boost/property_tree/ptree.hpp>
38 
39 namespace te
40 {
41  namespace layout
42  {
43  class Observable;
44  class ItemController;
45  class Properties;
46 
48  {
49  public:
50  ItemObserver(ItemController* controller = 0, Observable* o = 0);
51  virtual ~ItemObserver();
52 
53  virtual void updateObserver(ContextItem context) = 0;
54  /*
55  return coordinates llx, ury
56  */
57  virtual te::gm::Coord2D getPosition() = 0;
58 
59  virtual std::string getName();
60 
61  virtual te::layout::Properties* getProperties() const;
62  virtual void updateProperties(te::layout::Properties* properties);
63  virtual void redraw(const double& scaleFactor = 1.);
64 
65  virtual void setPPI(const double& ppi);
66 
67  virtual void setPrintable(bool print);
68  virtual bool isPrintable();
69 
70  virtual ItemController* getController();
71  virtual Observable* getModel();
72 
73  virtual void refresh();
74 
75  protected:
76 
77  virtual void setZValueItem(int z);
78 
79  virtual int getZValueItem() = 0;
80 
83  double m_ppi;
85  };
86  }
87 }
88 
89 #endif
te::layout::Observable * m_model
Definition: ItemObserver.h:82
virtual void setPrintable(bool print)
te::layout::ItemController * m_controller
Definition: ItemObserver.h:81
virtual void setZValueItem(int z)
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual bool isPrintable()
virtual void updateObserver(ContextItem context)=0
ItemObserver(ItemController *controller=0, Observable *o=0)
virtual te::gm::Coord2D getPosition()=0
virtual ItemController * getController()
virtual Observable * getModel()
virtual int getZValueItem()=0
virtual void redraw(const double &scaleFactor=1.)
virtual te::layout::Properties * getProperties() const
virtual void setPPI(const double &ppi)
virtual std::string getName()
virtual void updateProperties(te::layout::Properties *properties)