changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / maps / GeoMapObjectPolygon.h
1 /*
2  * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3  * This software, including documentation, is protected by copyright controlled by
4  * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5  * storing, adapting or translating, any or all of this material requires the prior
6  * written consent of HERE Global B.V. You may use this
7  * Software in accordance with the terms and conditions defined in the
8  * HERE Location Platform Services Terms and Conditions, available at
9  * http://developer.here.com/terms-conditions-base
10  *
11  * As an additional permission to the above, you may distribute Software,
12  * in object code format as part of an Application, according to, and subject to, terms and
13  * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14  * You may distribute such object code format Application under terms of your choice,
15  * provided that the header and source files of the Software have not been modified.
16  */
17
18 #ifndef MAPOBJECTPOLYGON_H
19 #define MAPOBJECTPOLYGON_H
20
21 #include "common/HereMaps_global.h"
22 #include "maps/GeoMapObject.h"
23 #include "common/GeoCoordinates.h"
24 #include <tr1/functional>
25
26 #ifdef TIZEN_MIGRATION
27 #include "graphic/Color.h"
28 #else
29 namespace Tizen { namespace Graphics { class Color; } }
30 #endif
31
32 HERE_MAPS_BEGIN_NAMESPACE
33
34 /**
35  * This class encapsulates a map polygon object. A polygon is a closed polyline,
36  * therefore, in addition to a polyline, its properties include a fill color.
37  *
38  * \ingroup maps
39  */
40 class EXPORT_API GeoMapObjectPolygon : public GeoMapObject
41 {
42 public:
43
44     /**
45      * This method is the default constructor.
46      */
47     GeoMapObjectPolygon();
48
49     /**
50      * This method is the (virtual) destructor.
51      */
52     virtual ~GeoMapObjectPolygon();
53
54     /**
55      * This method sets the path of the polygon, which is a list of locations
56      * that the path (line) connects. 
57      * 
58      * @param path A constant reference to an object containing a list of
59      *        locations defined in terms of their geographic coordinates.
60      *        Paths representing self-intersecting polygons are not supported.
61      *        Such paths are not rendered on the map.
62      */
63     void SetPath(const GeoCoordinateList& path);
64
65     /**
66      * This method appends the location of a new vertex to the polyline path.
67      *
68      * Note that self-intersecting polygons are not supported, therefore, if the
69      * given polygon should become self-intersecting as a result of this
70      * operation, it cannot be rendered on the map.
71      * 
72      * @param rCoord A constant reference to an object specifying the geographic
73      *        coordinates of a new vertex to be added to the path.
74      */
75     void AppendToPath(const GeoCoordinates& rCoord);
76
77     /**
78      * This method retrieves the path of the polygon, which is a list of
79      * objects containing the geographic coordinates of its vertices.
80      * 
81      * @return A reference to an object containing a list of vertices defined
82      *        in terms of their geographic coordinates.
83      */
84     GeoCoordinateList GetPath() const;
85
86     /**
87      * This typedef defines a function object as a type. The function object can
88      * be called when the path of the polygon has changed. A function object of
89      * this type returns <code>void</code> and receives a constant reference to
90      * a <code>GeoMapObject</code> as an argument.
91      */
92     typedef std::tr1::function<void (const GeoMapObject&)> PathChangedFunctor;
93
94     /**
95      * This method sets a callback to be invoked when the polygon path has
96      * changed. 
97      * 
98      * @param pathChanged A function object to be called when the path has
99      *        changed. 
100      */
101     void SetPathChangedNotifier(PathChangedFunctor pathChanged);
102
103     /**
104      * This method retrieves the bounding box of the polygon.
105      * 
106      * @return An object encapsulating the bounding box of the given polygon
107      *        object. 
108      */
109     GeoBoundingBox GetBoundingBox() const;
110
111     /**
112      * This method retrieves the current value of the polygon fill color.
113      * 
114      * @return An object encapsulating the fill color.
115      */
116     Tizen::Maps::Color GetFillColor() const;
117
118     /**
119      * This method sets the current value of the polygon fill color.
120      * 
121      * @param fillColor An object encapsulating the fill color.
122      */
123     void SetFillColor(const Tizen::Maps::Color& fillColor);
124
125     /**
126      * This typedef defines a fill-color-changed function object as a
127      * type. The function object can be called when the polygon fill color
128      * has changed. A function object of this type returns <code>void</code> and
129      * receives a constant reference to a <code>GeoMapObject</code> as an
130      * argument.
131      */
132     typedef std::tr1::function<void (const GeoMapObject&)> FillColorChangedFunctor;
133
134     /**
135      * This method sets a callback to be invoked when the polygon fill color
136      * has changed.
137      * 
138      * @param fillColorChanged A function object to be called when the polygon
139      *        fill color has changed.
140      */
141     void SetFillColorChangedNotifier(FillColorChangedFunctor fillColorChanged);
142
143     /**
144      * This method retrieves the object type of the given polygon.
145      * 
146      * @return A member of the enumerated data type indicating the type of the
147      *        given polygon object.
148      */
149     Type GetType() const;
150
151     /**
152      * This method sets a flag to indicate if the given object is visible.
153      *
154      * @return visible A Boolean, <code>true</code> if the object is visible,
155      *        otherwise <code>false</code>.
156      */
157    virtual void SetVisible(bool visible);
158
159    /**
160     * This method checks if the object can be rendered on the map.
161     *
162     * @return A Boolean, <code>true</code> if the object can be rendered,
163     *        otherwise <code>false</code>.
164     */
165    virtual bool IsValid() const;
166
167 private:
168     HERE_MAPS_NO_COPY_NO_ASSIGN(GeoMapObjectPolygon);
169
170     class GeoMapObjectPolygonImpl;
171     GeoMapObjectPolygonImpl* m_impl;
172 };
173
174 HERE_MAPS_END_NAMESPACE
175
176 #endif