3b5b6987ab76332ab78be34e2daabc52ea8d0021
[platform/core/location/maps-plugin-here.git] / inc / engine / common / HereMaps_global.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 HEREMAPS_GLOBAL_H
19 #define HEREMAPS_GLOBAL_H
20
21 #define TIZEN_MIGRATION
22
23 #ifdef TIZEN_MIGRATION
24 /* enhancement for updated HERE APIs */
25 #define TIZEN_CUSTOMIZATION
26
27 /* sub-features */
28 #define TIZEN_SUPPORT_LIMIT_RETRYING_FETCHING_TILES     /* limit the number of retrying when failed fetching tiles */
29 #define TIZEN_SUPPORT_TILE_FILE_CACHE
30 #define TIZEN_SUPPORT_POST_METHOD
31 #define TIZEN_SUPPORT_CRYPTO_LOCK                       /* mutex locking system for SSL */
32 #define TIZEN_SUPPORT_OPTIMIZATION_OF_REDRAWING
33
34 /* configuration */
35 #define TIZEN_CFG_CURL_TIMEOUT          20      /* seconds */
36 #define TIZEN_CFG_CURL_MULTITHREADS     8       /* the limit of multi-threads for CURL */
37
38 /* for debugging */
39 //#define TIZEN_PROFILING_CURL_TIME
40 //#define TIZEN_PROFILING_MEMLEAK
41 #endif
42
43
44
45 #ifdef TIZEN_MIGRATION
46 #include <string>
47
48 typedef unsigned long result;
49 typedef std::string String;
50 typedef std::string Uri;
51 typedef std::wstring WString;
52
53 typedef unsigned char byte;
54 #ifndef null
55 #define null    0
56 #endif // null
57 #endif
58
59
60
61 /*
62  * Note: DEBUG variable should be set from the outside.
63  * Currently done in CMAKE file
64  */
65
66 #define HERE_MAPS_BEGIN_NAMESPACE  namespace Here { namespace Maps {
67 #define HERE_MAPS_END_NAMESPACE    }}
68 #define HERE_MAPS_NAMESPACE_PREFIX Here::Maps
69
70 #define TIZEN_MAPS_BEGIN_NAMESPACE  namespace Tizen { namespace Maps {
71 #define TIZEN_MAPS_END_NAMESPACE    }}
72 #define TIZEN_MAPS_NAMESPACE_PREFIX Tizen::Maps
73
74 #include <memory>
75 #include <dlog.h>
76
77 //logging macro prototypes
78 #ifdef LOG_TAG
79 #undef LOG_TAG
80 #endif
81 #define LOG_TAG "HERE_PLUGIN"
82
83 #define HERE_MAPS_LOG_DBG_INFO(fmt,args...)  LOGD(fmt, ##args);
84 #define HERE_MAPS_LOG_ERROR(fmt,args...)     LOGE(fmt, ##args);
85 #define HERE_MAPS_LOG_WARNING(fmt,args...)   LOGW(fmt, ##args);
86
87 #define HERE_MAPS_RETURN_RESULT(cond,ret,fmt,args...)\
88         if (!cond) {\
89                 LOGE(fmt, ##args);\
90                 return ret;\
91         }
92
93 #define HERE_MAPS_TRY_CATCH(cond,catch,fmt,args...)\
94         if (!cond) {\
95                 LOGE(fmt, ##args);\
96                 catch;\
97                 goto CATCH;\
98         }
99
100 // Error severities
101 #define E_SUCCESS                       0
102 #define E_FAILURE                       -1
103 #define E_SYSTEM                        -2
104 #define E_INVALID_STATE                 -3
105 #define E_OUT_OF_MEMORY                 -4
106
107 #ifndef INFINITE
108 #define INFINITE    0xFFFFFFFF
109 #endif // INFINITE
110
111 //assertions
112 #include <assert.h>
113 #if DEBUG
114 #define HERE_MAPS_ASSERT(x) assert(x);
115 #else
116 #define HERE_MAPS_ASSERT(x)
117 #endif
118
119 typedef unsigned char Byte;
120 typedef unsigned int UInt;
121
122
123
124 #define HERE_MAPS_NO_COPY_NO_ASSIGN(ClassName) \
125   private:                                     \
126   ClassName(const ClassName&);                 \
127   ClassName& operator=(const ClassName&)
128
129
130 HERE_MAPS_BEGIN_NAMESPACE
131 extern void Stopwatch_Start(int aIndex);
132 extern void Stopwatch_Stop(int aIndex);
133 extern void Stopwatch_Show(int aIndex);
134 extern void Stopwatch_Reset(int aIndex);
135 HERE_MAPS_END_NAMESPACE
136
137 #endif // HEREMAPS_GLOBAL_H