[toolchain upgrade] fixed build errors and warnings in gcc6x mode
[platform/core/location/maps-plugin-here.git] / inc / engine / maps / GeoMapObjectPolyline.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 MAPOBJECTPOLYLINE_H
19 #define MAPOBJECTPOLYLINE_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 #include "graphic/Canvas.h"
29 #else
30 namespace Tizen { namespace Graphics { class Color; } }
31 #endif
32
33 HERE_MAPS_BEGIN_NAMESPACE
34
35 /**
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
38  * and thickness.
39  *
40  * \ingroup maps
41  */
42 class EXPORT_API GeoMapObjectPolyline : public GeoMapObject
43 {
44 public:
45
46     /**
47      * This method is the default constructor.
48      */
49     GeoMapObjectPolyline();
50
51     /**
52      * This method is the (virtual) destructor.
53      */
54     virtual ~GeoMapObjectPolyline();
55
56     /**
57      * This method sets the path of the polyline, which is a list of locations
58      * that the polyline connects. 
59      * 
60      * @param path A constant reference to an object containing a list of
61      *        locations defined in terms of their geographic coordinates.
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      * @param aCoord A constant reference to an object specifying the geographic
69      *        coordinates of a new vertex to be added to the path.
70      */
71     void AppendToPath(const GeoCoordinates& aCoord);
72
73     /**
74      * This method retrieves the path of the polyline, which is a list of
75      * locations that the polyline connects.
76      * 
77      * @return A reference to an object containing a list of locations defined
78      *        in terms of their geographic coordinates.
79      */
80     GeoCoordinateList GetPath() const;
81
82     /**
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.
87      */
88     typedef std::tr1::function<void (const GeoMapObject&)> PathChangedFunctor;
89
90     /**
91      * This method sets a callback to be invoked when the polyline path has
92      * changed. 
93      * 
94      * @param pathChanged A function object to be called when the path has
95      *        changed. 
96      */
97     void SetPathChangedNotifier(PathChangedFunctor pathChanged);
98
99     /**
100      * This method retrieves the current value of the polyline stroke color.
101      * 
102      * @return An object encapsulating the stroke color.
103      */
104     Tizen::Maps::Color GetStrokeColor() const;
105
106     /**
107      * This method sets the value of the polyline stroke color.
108      * 
109      * @param strokeColor A constant reference to an object encapsulating the
110      *        stroke color. 
111      */
112     void SetStrokeColor(const Tizen::Maps::Color& strokeColor);
113
114     /**
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.
119      */
120     typedef std::tr1::function<void (const GeoMapObject&)> StrokeColorChangedFunctor;
121
122     /**
123      * This method sets a callback to be invoked when the polyline stroke color
124      * has changed.
125      * 
126      * @param strokeColorChanged A function object to be called when the polyline
127      *        stroke color has changed.
128      */
129     void SetStrokeColorChangedNotifier(StrokeColorChangedFunctor strokeColorChanged);
130     
131     /**
132      * This method retrieves a value indicating the polyline stroke thickness in
133      * pixels.
134      * 
135      * @return A value indicating the stroke thickness in pixels.
136      */
137     int GetStrokeThickness() const;
138     
139     /**
140      * This method sets a value indicating the polyline stroke thickness in
141      * pixels.
142      * 
143      * @strokeThickness A value indicating the stroke thickness in pixels.
144      */
145     void SetStrokeThickness(int strokeThickness);
146
147     /**
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.
152      */
153     typedef std::tr1::function<void (const GeoMapObject&)> StrokeThicknessChangedFunctor;
154
155     /**
156      * This method sets a callback to be invoked when the polyline stroke
157      * thickness has changed.
158      * 
159      * @param strokeThicknessChanged A function object to be called when the polyline
160      *        stroke thickness has changed.
161      */
162     void SetStrokeThicknessChangedNotifier(StrokeThicknessChangedFunctor strokeThicknessChanged);
163
164 #ifdef TIZEN_CUSTOMIZATION
165     /**
166      * This method retrieves a value indicating the polyline stroke type in
167      * pixels.
168      *
169      * @return A value indicating the stroke thickness in pixels.
170      */
171     Tizen::Maps::Canvas::LineStyleType GetStrokeType() const;
172
173     /**
174      * This method sets a value indicating the polyline stroke type in
175      * pixels.
176      *
177      * @strokeThickness A value indicating the stroke thickness in pixels.
178      */
179     void SetStrokeType(Tizen::Maps::Canvas::LineStyleType type);
180
181     /**
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.
186      */
187     typedef std::tr1::function<void (const GeoMapObject&)> StrokeTypeChangedFunctor;
188
189     /**
190      * This method sets a callback to be invoked when the polyline stroke
191      * type has changed.
192      *
193      * @param strokeTypeChanged A function object to be called when the polyline
194      *        stroke type has changed.
195      */
196     void SetStrokeTypeChangedNotifier(StrokeTypeChangedFunctor strokeTypeChanged);
197 #endif
198
199     /**
200      * This method retrieves the bounding box of the polyline.
201      *
202      * @return An object encapsulating the bounding box of the given polyline
203      *        object. 
204      */
205     GeoBoundingBox GetBoundingBox() const;
206
207     /**
208      * This method retrieves the object type of the given polyline.
209      *
210      * @return A member of the enumerated data type indicating the type of the
211      *        given polyline object.
212      */
213     Type GetType() const;
214
215     /**
216      * This method sets a flag to indicate if the given object is visible.
217      *
218      * @return visible A Boolean, <code>true</code> if the object is visible,
219      *        otherwise <code>false</code>.
220      */
221    virtual void SetVisible(bool visible);
222
223    /**
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.
226     *
227     * @return visible A Boolean, <code>true</code> if the object is valid,
228     *        otherwise <code>false</code>.
229     */
230     virtual bool IsValid() const;
231
232 private:
233     HERE_MAPS_NO_COPY_NO_ASSIGN(GeoMapObjectPolyline);
234
235     class GeoMapObjectPolylineImpl;
236 #ifdef TIZEN_CFG_CPP11_UNIQUE_PTR
237     std::unique_ptr<GeoMapObjectPolylineImpl> m_impl;
238 #else
239     std::auto_ptr<GeoMapObjectPolylineImpl> m_impl;
240 #endif
241 };
242
243 HERE_MAPS_END_NAMESPACE
244
245 #endif