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
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.
18 #ifndef MAPOBJECTPOLYLINE_H
19 #define MAPOBJECTPOLYLINE_H
21 #include "common/HereMaps_global.h"
22 #include "maps/GeoMapObject.h"
23 #include "common/GeoCoordinates.h"
24 #include <tr1/functional>
26 #ifdef TIZEN_MIGRATION
27 #include "graphic/Color.h"
28 #include "graphic/Canvas.h"
30 namespace Tizen { namespace Graphics { class Color; } }
33 HERE_MAPS_BEGIN_NAMESPACE
36 * This class encapsulates a map polyline object. A polyline is a line that
37 * connects a number of points on the map. Its properties include stroke color
42 class EXPORT_API GeoMapObjectPolyline : public GeoMapObject
47 * This method is the default constructor.
49 GeoMapObjectPolyline();
52 * This method is the (virtual) destructor.
54 virtual ~GeoMapObjectPolyline();
57 * This method sets the path of the polyline, which is a list of locations
58 * that the polyline connects.
60 * @param path A constant reference to an object containing a list of
61 * locations defined in terms of their geographic coordinates.
63 void SetPath(const GeoCoordinateList& path);
66 * This method appends the location of a new vertex to the polyline path.
68 * @param aCoord A constant reference to an object specifying the geographic
69 * coordinates of a new vertex to be added to the path.
71 void AppendToPath(const GeoCoordinates& aCoord);
74 * This method retrieves the path of the polyline, which is a list of
75 * locations that the polyline connects.
77 * @return A reference to an object containing a list of locations defined
78 * in terms of their geographic coordinates.
80 GeoCoordinateList GetPath() const;
83 * This typedef defines a function object as a type. The function object can
84 * be called when the polyline path has changed. A function object of this
85 * type returns <code>void</code> and receives a constant reference to a
86 * <code>GeoMapObject</code> as an argument.
88 typedef std::tr1::function<void (const GeoMapObject&)> PathChangedFunctor;
91 * This method sets a callback to be invoked when the polyline path has
94 * @param pathChanged A function object to be called when the path has
97 void SetPathChangedNotifier(PathChangedFunctor pathChanged);
100 * This method retrieves the current value of the polyline stroke color.
102 * @return An object encapsulating the stroke color.
104 Tizen::Maps::Color GetStrokeColor() const;
107 * This method sets the value of the polyline stroke color.
109 * @param strokeColor A constant reference to an object encapsulating the
112 void SetStrokeColor(const Tizen::Maps::Color& strokeColor);
115 * This typedef defines a function object as a type. The function object can
116 * be called when the polyline stroke color has changed. A function object
117 * of this type returns <code>void</code> and receives a constant reference
118 * to a <code>GeoMapObject</code> as an argument.
120 typedef std::tr1::function<void (const GeoMapObject&)> StrokeColorChangedFunctor;
123 * This method sets a callback to be invoked when the polyline stroke color
126 * @param strokeColorChanged A function object to be called when the polyline
127 * stroke color has changed.
129 void SetStrokeColorChangedNotifier(StrokeColorChangedFunctor strokeColorChanged);
132 * This method retrieves a value indicating the polyline stroke thickness in
135 * @return A value indicating the stroke thickness in pixels.
137 int GetStrokeThickness() const;
140 * This method sets a value indicating the polyline stroke thickness in
143 * @strokeThickness A value indicating the stroke thickness in pixels.
145 void SetStrokeThickness(int strokeThickness);
148 * This typedef defines a function object as a type. The function object can
149 * be called when the polyline stroke thickness has changed. A function
150 * object of this type returns <code>void</code> and receives a constant
151 * reference to a <code>GeoMapObject</code> as an argument.
153 typedef std::tr1::function<void (const GeoMapObject&)> StrokeThicknessChangedFunctor;
156 * This method sets a callback to be invoked when the polyline stroke
157 * thickness has changed.
159 * @param strokeThicknessChanged A function object to be called when the polyline
160 * stroke thickness has changed.
162 void SetStrokeThicknessChangedNotifier(StrokeThicknessChangedFunctor strokeThicknessChanged);
164 #ifdef TIZEN_CUSTOMIZATION
166 * This method retrieves a value indicating the polyline stroke type in
169 * @return A value indicating the stroke thickness in pixels.
171 Tizen::Maps::Canvas::LineStyleType GetStrokeType() const;
174 * This method sets a value indicating the polyline stroke type in
177 * @strokeThickness A value indicating the stroke thickness in pixels.
179 void SetStrokeType(Tizen::Maps::Canvas::LineStyleType type);
182 * This typedef defines a function object as a type. The function object can
183 * be called when the polyline stroke type has changed. A function
184 * object of this type returns <code>void</code> and receives a constant
185 * reference to a <code>GeoMapObject</code> as an argument.
187 typedef std::tr1::function<void (const GeoMapObject&)> StrokeTypeChangedFunctor;
190 * This method sets a callback to be invoked when the polyline stroke
193 * @param strokeTypeChanged A function object to be called when the polyline
194 * stroke type has changed.
196 void SetStrokeTypeChangedNotifier(StrokeTypeChangedFunctor strokeTypeChanged);
200 * This method retrieves the bounding box of the polyline.
202 * @return An object encapsulating the bounding box of the given polyline
205 GeoBoundingBox GetBoundingBox() const;
208 * This method retrieves the object type of the given polyline.
210 * @return A member of the enumerated data type indicating the type of the
211 * given polyline object.
213 Type GetType() const;
216 * This method sets a flag to indicate if the given object is visible.
218 * @return visible A Boolean, <code>true</code> if the object is visible,
219 * otherwise <code>false</code>.
221 virtual void SetVisible(bool visible);
224 * This method checks if the object was built with legal input. A valid
225 * polyline must have a path that contains of at least two vertices.
227 * @return visible A Boolean, <code>true</code> if the object is valid,
228 * otherwise <code>false</code>.
230 virtual bool IsValid() const;
233 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoMapObjectPolyline);
235 class GeoMapObjectPolylineImpl;
236 #ifdef TIZEN_CFG_CPP11_UNIQUE_PTR
237 std::unique_ptr<GeoMapObjectPolylineImpl> m_impl;
239 std::auto_ptr<GeoMapObjectPolylineImpl> m_impl;
243 HERE_MAPS_END_NAMESPACE