[toolchain upgrade] fixed build errors and warnings in gcc6x mode
[platform/core/location/maps-plugin-here.git] / inc / engine / maps / GeoObjectProvider.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 GEOOBJECTPROVIDER_H
19 #define GEOOBJECTPROVIDER_H
20
21 #include "common/HereMaps_global.h"
22 #include "maps/GeoProvider.h"
23 #ifdef TIZEN_MIGRATION
24 #include "graphic/Dimension.h"
25 #include "graphic/Point.h"
26 #endif
27
28 HERE_MAPS_BEGIN_NAMESPACE
29
30 class GeoMapObject;
31 class GeoProjection;
32
33 /**
34  * This class encapsulates a map object provider which manages all the objects
35  * to be displayed in any of the tiles that make up the visible map. The
36  * provider object can load tiles, add and remove objects to them, and retrieve
37  * objects from a specific pixel location.
38  *
39  * \ingroup maps
40  */
41 class GeoObjectProvider: public GeoProvider
42 {
43 public:
44     
45     /**
46      * This method is a constructor.
47      * 
48      * @param projection A Pointer to the projection to use.
49      * 
50      * @param tileSize a value indicating the size of the map tile to use. 
51      */
52     GeoObjectProvider(GeoProjection* projection, int tileSize);
53
54     /**
55      * This method is the (virtual) destructor.
56      */
57     virtual ~GeoObjectProvider();
58
59     /**
60      * This method loads the tile specified by the caller.
61      * 
62      * @param tileKey A constant reference to an object that specifies a tile
63      *        key. 
64      *
65      * @return A value representing the identifier of the issued request.
66      */
67     RestItemHandle::RequestId LoadTile(const TileKey& tileKey);
68
69     /**
70      * This method aborts loading of the tile specified by the caller.
71      * 
72      * @param tile A constant reference to an object encapsulating the tile
73      *        whose loading is to be aborted.
74      */
75     void AbortTile(const TilePtr& tile);
76     
77     /**
78      * This method sets a function to be invoked when the tile has loaded.
79      * 
80      * @param signal A constant reference to a function to be invoked when the
81      *        tile has loaded; the function accepts a reference to a
82      *        <code>TileKey</code> object and a pointer to the tile bitmap (see
83      *        also <code>GeoProvider</code>).
84      */
85     void TileLoaded(const TileLoadedFunc& signal);
86
87     /**
88      * This method sets function to be invoked when loading the tile failed.
89      *
90      * @param signal A constant reference to a function to be invoked when the
91      *        tile load failed; the function accepts a reference to the
92      *        corresponding <code>ErrorBase</code> object
93      *        <code>GeoProvider</code>). 
94      */
95     void TileFailed(const TileFailedFunc& signal);
96
97     /**
98      * This method adds an object specified by the caller.
99      * 
100      * @param obj A pointer to the object to add. 
101      */
102     void AddObject(GeoMapObject* obj, bool transferOwnership);
103
104     /**
105      * This method removes an object specified by the caller. The objects
106      * are also deleted if we have ownership (see AddObject)
107      * 
108      * @param obj A pointer to the object to remove. 
109      * @return Boolean value indicating if the removal of the object was successful
110      */
111     bool RemoveObject(GeoMapObject* obj);
112
113     /**
114      * This method removes all objects specified by the caller. The objects
115      * are also deleted if we have ownership (see AddObject)
116      *
117      * @param obj A pointer to the object to remove.
118      * @return Boolean value indicating if the removal of the object was successful
119      */
120     bool RemoveAllObjects();
121
122     /**
123      * This method retrieves an object at the screen position specified by the
124      * caller. 
125      * 
126      * @param point A constant reference to an object specifying the screen
127      *        coordinates of a location from which to retrieve an object.
128      */
129     GeoMapObject* GetObjectAtScreenPosition(const Tizen::Maps::Point& point);
130
131 private:
132     HERE_MAPS_NO_COPY_NO_ASSIGN(GeoObjectProvider);
133
134     class GeoObjectProviderImpl;
135 #ifdef TIZEN_CFG_CPP11_UNIQUE_PTR
136     std::unique_ptr<GeoObjectProviderImpl> m_impl;
137 #else
138     std::auto_ptr<GeoObjectProviderImpl> m_impl;
139 #endif
140 };
141
142 HERE_MAPS_END_NAMESPACE
143
144 #endif // GEOOBJECTPROVIDER_H