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 GEOOBJECTPROVIDER_H
19 #define GEOOBJECTPROVIDER_H
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"
28 HERE_MAPS_BEGIN_NAMESPACE
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.
41 class GeoObjectProvider: public GeoProvider
46 * This method is a constructor.
48 * @param projection A Pointer to the projection to use.
50 * @param tileSize a value indicating the size of the map tile to use.
52 GeoObjectProvider(GeoProjection* projection, int tileSize);
55 * This method is the (virtual) destructor.
57 virtual ~GeoObjectProvider();
60 * This method loads the tile specified by the caller.
62 * @param tileKey A constant reference to an object that specifies a tile
65 * @return A value representing the identifier of the issued request.
67 RestItemHandle::RequestId LoadTile(const TileKey& tileKey);
70 * This method aborts loading of the tile specified by the caller.
72 * @param tile A constant reference to an object encapsulating the tile
73 * whose loading is to be aborted.
75 void AbortTile(const TilePtr& tile);
78 * This method sets a function to be invoked when the tile has loaded.
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>).
85 void TileLoaded(const TileLoadedFunc& signal);
88 * This method sets function to be invoked when loading the tile failed.
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>).
95 void TileFailed(const TileFailedFunc& signal);
98 * This method adds an object specified by the caller.
100 * @param obj A pointer to the object to add.
102 void AddObject(GeoMapObject* obj, bool transferOwnership);
105 * This method removes an object specified by the caller. The objects
106 * are also deleted if we have ownership (see AddObject)
108 * @param obj A pointer to the object to remove.
109 * @return Boolean value indicating if the removal of the object was successful
111 bool RemoveObject(GeoMapObject* obj);
114 * This method removes all objects specified by the caller. The objects
115 * are also deleted if we have ownership (see AddObject)
117 * @param obj A pointer to the object to remove.
118 * @return Boolean value indicating if the removal of the object was successful
120 bool RemoveAllObjects();
123 * This method retrieves an object at the screen position specified by the
126 * @param point A constant reference to an object specifying the screen
127 * coordinates of a location from which to retrieve an object.
129 GeoMapObject* GetObjectAtScreenPosition(const Tizen::Maps::Point& point);
132 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoObjectProvider);
134 class GeoObjectProviderImpl;
135 std::auto_ptr<GeoObjectProviderImpl> m_impl;
138 HERE_MAPS_END_NAMESPACE
140 #endif // GEOOBJECTPROVIDER_H