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 GEOPROVIDER_P_H_
19 #define GEOPROVIDER_P_H_
21 #include <tr1/functional>
23 #include "common/HereMaps_global.h"
24 #include "common/RestItemHandle.h"
25 #include "maps/GeoTile.h"
27 HERE_MAPS_BEGIN_NAMESPACE
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>.
43 * This method is the default constructor.
48 * This method is the (virtual) destructor.
50 virtual ~GeoProvider() {}
53 * This method loads the map tile specified by the caller. The method must
54 * be implemented by the derived classes.
56 * @param tileKey A constant reference to an object that specifies a tile
59 * @return A value representing the identifier of the tile request.
61 virtual RestItemHandle::RequestId LoadTile(const TileKey& tileKey) = 0;
64 * This method aborts loading of the map tile specified by the caller. The
65 * method must be implemented by the derived classes.
67 * @param tile The tile whose loading is to be aborted.
69 virtual void AbortTile(const TilePtr& tile) = 0;
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>.
77 typedef std::tr1::function<void (const TileKey&, DrawableBitmapPtr, GeoProvider&)> TileLoadedFunc;
80 * This method registers a function to be invoked when the tile has loaded.
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.
86 virtual void TileLoaded(const TileLoadedFunc& signal) = 0;
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>).
95 typedef std::tr1::function<void (const TileKey&, const ErrorBase&)> TileFailedFunc;
98 * This method sets function to be invoked when an attempt to load a tile
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>).
107 virtual void TileFailed(const TileFailedFunc& signal) = 0;
110 HERE_MAPS_NO_COPY_NO_ASSIGN(GeoProvider);
113 HERE_MAPS_END_NAMESPACE
115 #endif /* GEOPROVIDER_P_H_ */