changed attributes of header files
[platform/core/location/maps-plugin-here.git] / inc / engine / maps / GeoProvider.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 GEOPROVIDER_P_H_
19 #define GEOPROVIDER_P_H_
20
21 #include <tr1/functional>
22
23 #include "common/HereMaps_global.h"
24 #include "common/RestItemHandle.h"
25 #include "maps/GeoTile.h"
26
27 HERE_MAPS_BEGIN_NAMESPACE
28
29 class TileKey;
30 class ErrorBase;
31 class DrawableBitmap;
32
33 /**
34  * This class is the base class for provider classes in the Maps API. An example
35  * of a derived class is <code>GeoObjectProvider</code>.
36  * 
37  * \ingroup maps
38  */
39 class GeoProvider
40 {
41 public:
42     /**
43      * This method is the default constructor.
44      */
45     GeoProvider() {}
46
47     /**
48      * This method is the (virtual) destructor.
49      */
50     virtual ~GeoProvider() {}
51
52     /**
53      * This method loads the map tile specified by the caller. The method must
54      * be implemented by the derived classes.
55      * 
56      * @param tileKey A constant reference to an object that specifies a tile
57      *        key. 
58      *
59      * @return A value representing the identifier of the tile request.
60      */
61     virtual RestItemHandle::RequestId LoadTile(const TileKey& tileKey) = 0;
62
63     /**
64      * This method aborts loading of the map tile specified by the caller. The
65      * method must be implemented by the derived classes.
66      * 
67      * @param tile The tile whose loading is to be aborted.
68      */
69     virtual void AbortTile(const TilePtr& tile) = 0;
70
71     /**
72      * This typedef defines a function as a type. The function can be called
73      * when the map tile has been loaded. A function of this type accepts a
74      * reference to a <code>TileKey</code> object, a pointer to the tile
75      * bitmap and a reference to an instance of <code>GeoProvider</code>.
76      */
77     typedef std::tr1::function<void (const TileKey&, DrawableBitmapPtr, GeoProvider&)> TileLoadedFunc;
78     
79     /**
80      * This method registers a function to be invoked when the tile has loaded.
81      * 
82      * @param signal A constant reference to a function to be invoked when the
83      *        tile has loaded; the function accepts a reference to a
84      *        <code>TileKey</code> object and a pointer to the tile bitmap.
85      */
86     virtual void TileLoaded(const TileLoadedFunc& signal) = 0;
87     
88     /**
89      * This typedef defines a function as a type. The function can be called
90      * when an attempt to load a map tile has failed. A function of this type
91      * accepts a reference to a <code>TileKey</code> object and a reference to
92      * an object containing information about the error that occurred (an
93      * instance of <code>ErrorBase</code>).
94      */
95     typedef std::tr1::function<void (const TileKey&, const ErrorBase&)> TileFailedFunc;
96
97     /**
98      * This method sets function to be invoked when an attempt to load a tile
99      * has failed.
100      *
101      * @param signal A constant reference to a function to be invoked when the
102      *        tile load has failed; the callback function accepts a reference to
103      *        a <code>TileKey</code> object and a reference to an object
104      *        encapsulating information about the error that occurred (an
105      *        instance of <code>ErrorBase</code>).
106      */
107     virtual void TileFailed(const TileFailedFunc& signal) = 0;
108
109 private:
110     HERE_MAPS_NO_COPY_NO_ASSIGN(GeoProvider);
111 };
112
113 HERE_MAPS_END_NAMESPACE
114
115 #endif /* GEOPROVIDER_P_H_ */