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.
22 #include "common/HereMaps_global.h"
24 #ifndef TIZEN_MIGRATION
25 #include <FGraphics.h>
26 #include <FGraphicsOpengl2.h>
29 #include "common/RestItemHandle.h"
30 #include "maps/DrawableBitmap.h"
32 HERE_MAPS_BEGIN_NAMESPACE
34 class GeoProviderManager;
36 #if 0 //note: this class has been moved to a separate file
38 * This class encapsulates a bitmap that can be drawn in a graphics context (on
39 * the map, whether the bitmap can represent a tile).
41 * A map tile supports two layers, the map tile layer and a map objects layer,
42 * (which overlays the map tile layer). The latter may be
43 * <code>NULL</code> if no objects have been added to the map.
51 * This typedef defines a render handle as a type.
53 typedef UInt RenderHandle;
57 * This method is a constructor. It initiates a new instance using the
58 * bitmap pointer supplied by the caller.
60 * @param bitmap A pointer to a bitmap object.
62 DrawableBitmap(std::auto_ptr<Tizen::Graphics::Bitmap>& bitmap)
69 * This method is the destructor. It destroys the given instance and rests
78 * This method resets the render handle for the given bitmap instance.
80 void ResetRenderHandle()
84 Tizen::Graphics::Opengl::glDeleteTextures(1, &m_renderHandle);
90 * This method obtains a pointer to the bitmap.
92 * @return A pointer to the bitmap.
94 Tizen::Graphics::Bitmap* GetBitmap() const
96 return m_bitmap.get();
100 * This method sets the render handle for the given bitmap instance to the
101 * value provided by the caller.
103 * @param aRenderHandle A new value for the render handle.
105 void SetRenderHandle(RenderHandle aRenderHandle)
107 m_renderHandle = aRenderHandle;
111 * This method retrieves the current render handle.
113 * @return A unsigned integer representing the render handle.
115 RenderHandle GetRenderHandle() const
117 return m_renderHandle;
121 std::auto_ptr<Tizen::Graphics::Bitmap> m_bitmap;
122 RenderHandle m_renderHandle;
125 //-----------------------------------------------------------------------------
127 typedef std::tr1::shared_ptr<DrawableBitmap> DrawableBitmapPtr;
135 * This class encapsulates a map tile. A map tile is a square bitmap that is
136 * fetched from a grid representing the normalized Mercator projection. The
137 * position of the tile in this grid depends on the map zoom level and is
138 * defined by the x and y coordinates. At the lowest zoom level, there is only
139 * one tile. At the next higher zoom level, the grid is 2 x 2. With each zoom
140 * level above that, the x-size and the y-size of the grid increase by a power
150 * This enumeration defines identifiers for event types.
154 ET_OnTileFetcherReply = 0, ///< Indicates an event fired when a reply to
155 /// a tile fetch request arrives.
156 ET_OnFailure ///< Indicates an event fired on failure.
161 * This property holds a value representing the tile size.
166 * This method is a contructor. It initializes a new instance of the class
167 * using the manager reference and the tile key provided by the caller.
169 * @param rKey A constant reference to a key object that identifies the tile.
171 GeoTile(const TileKey& rKey);
174 * This method is the (virtual) destructor.
179 * This method retrieves the tile key.
181 * @return A constant reference to the tile key object for the given tile.
183 const TileKey& GetKey() const;
186 * This method sets a flag to indicate whether the given map tile has been
187 * requested for display.
189 * @param b A Boolean indcating if the given map tile has been requested
190 *( <code>true</code>) or not (<code>false</code>).
192 void SetMarked(bool b);
195 * This method checks whether the given map tile has been
196 * requested for display.
198 * @return A Boolean indcating if the given map tile has been requested
199 *( <code>true</code>) or not (<code>false</code>).
201 bool IsMarked() const;
204 * This method retrieves a point to the tile image.
206 * @return A pointer to the tile image.
208 DrawableBitmapPtr GetImage() const;
211 * This method sets the tile image.
213 * @param image A pointer to the tile image.
215 void SetImage(DrawableBitmapPtr image);
218 * This method retrieves an object that represents a pending tile request to
221 * @return A value representing the identifier of the issued request.
223 const RestItemHandle::RequestId GetPendingRequest() const;
226 * This method marks a tile request to the REST server as pending.
228 * @aRequestId An identifier representing a tile request.
230 void SetPendingRequest(RestItemHandle::RequestId aRequestId);
233 * This method sets/creates the map object layer.
235 * A tile supports two layers, the map tile layer on which the tile is
236 * drawn, and a layer superimposed on top of the map tile layer, which
237 * contains the map objects that may have been added/created. If no objects
238 * have been added/created, the map object layer is <code>NULL</code>.
240 * @param layer A pointer to an instance of <code>DrawableBitmap</code> that
241 * constitutes the object layer.
243 void SetMapObjectLayer(DrawableBitmapPtr layer);
246 * This method retrieves a pointer to the map object layer.
248 * A tile supports two layers, the map tile layer on which the tile is
249 * drawn, and a layer superimposed on top of the map tile layer, which
250 * contains the map objects that may have been added/created. If no objects
251 * have been added/created, the map object layer is <code>NULL</code>.
253 * @return A pointer to an instance of <code>DrawableBitmap</code> that
254 * constitutes the object layer.
256 DrawableBitmapPtr GetMapObjectLayer() const;
259 * This method removes the map object layer.
261 * A tile supports two layers, the map tile layer on which the tile is
262 * drawn, and a layer superimposed on top of the map tile layer, which
263 * contains the map objects that may have been added/created. If no objects
264 * have been added/created, the map object layer is <code>NULL</code>.
266 void RemoveMapObjectLayer();
269 * This methods aborts loading of the given tile.
273 #ifdef TIZEN_SUPPORT_LIMIT_RETRYING_FETCHING_TILES
274 int GetTryCount() const;
276 int SetTryCount(int count);
280 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoTile);
283 GeoTileImpl* m_pImpl;
286 typedef std::tr1::shared_ptr<GeoTile> TilePtr;
288 HERE_MAPS_END_NAMESPACE