b3531feaf2960e6601a697246abd2bc8c4eb5953
[platform/core/location/maps-plugin-here.git] / inc / engine / maps / GeoTileProvider.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 GEOTILEPROVIDER_H
19 #define GEOTILEPROVIDER_H
20
21 #include "common/HereMaps_global.h"
22 #include "maps/GeoProvider.h"
23
24 HERE_MAPS_BEGIN_NAMESPACE
25
26 class DrawableBitmap;
27 class TileKey;
28
29 /**
30  * This class encapsulates a map tile provider which is responsible
31  * for loading map tiles.
32  *
33  * \ingroup maps
34  */
35 class GeoTileProvider : public GeoProvider
36 {
37 public:
38     /**
39      * This method is the default constructor.
40      */
41     GeoTileProvider();
42
43     /**
44      * This method is the (virtual) destructor.
45      */
46     virtual ~GeoTileProvider();
47
48     /**
49      * This method loads the map tile specified by the caller.
50      * 
51      * @param tileKey A constant reference to an object that specifies a tile
52      *        key. 
53      *
54      * @return A value representing the identifier of request to load the tile.
55      */
56     RestItemHandle::RequestId LoadTile(const TileKey& tileKey);
57
58     /**
59      * This method aborts loading of the map tile specified by the caller. 
60      * 
61      * @param tile A constant reference to an object representing the tile whose
62      *        loading is to be aborted.
63      */
64     void AbortTile(const TilePtr& tile);
65     
66     /**
67      * This method registers a callback function to be invoked when the tile has loaded.
68      * 
69      * @param signal A constant reference to a function to be invoked when the
70      *        tile has loaded; the function accepts a reference to a
71      *        <code>TileKey</code> object and a pointer to the tile bitmap (see
72      *        also \ref GeoProvider).
73      */
74     void TileLoaded(const TileLoadedFunc &signal);
75
76     /**
77      * This method registers a callback function to be invoked when an attempt
78      * to load a map tile has failed.
79      * 
80      * @param signal A constant reference to a function to be invoked when an
81      *        attempt to load a tile has failed; the function accepts a
82      *        reference to a <code>TileKey</code> object and a reference to an
83      *        object containing information about the error that occurred (an
84      *        instance of <code>ErrorBase</code>).
85      */
86     void TileFailed(const TileFailedFunc& signal);
87
88 private:
89     class GeoTileProviderImpl;
90     std::auto_ptr<GeoTileProviderImpl> m_impl;
91 };
92
93 HERE_MAPS_END_NAMESPACE
94
95 #endif // GEOTILEPROVIDER_H