summaryrefslogtreecommitdiff
path: root/test/poi-service/poi-common/poi-common-types.h
blob: 65523a8ea04f60765e81d349d231d1503ecd0718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/**
 * @licence app begin@
 * Copyright (C) 2011-2012  PCA Peugeot Citroën
 *
 * This file is part of GENIVI Project POISearch Proof Of Concept [POIPOCClient].
 *
 * Contributions are licensed to the GENIVI Alliance under one or more
 * Contribution License Agreements.
 *
 * \copyright
 * This Source Code Form is subject to the terms of the
 * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed with
 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * \author Philippe Colliot <philippe.colliot@mpsa.com
 *
 * \file POIPOCCommonTypes.h
 * For further information see http://www.genivi.org/.
 * @licence end@
 */
#ifndef POIPOCCOMMONTYPES_H
#define POIPOCCOMMONTYPES_H

#include <QtCore/QString>
#include <QDBusArgument>

typedef uint poiId_t;
typedef uint categoryId_t;
typedef uint resourceId_t;
typedef uint attributeId_t;
typedef uint handleId_t;
typedef uchar camId_t;

struct DBusCommonAPIVariant_t //(yv)
{
    uchar index;
    QDBusVariant value;
};

struct geoCoordinate2D_t //(dd)
{
    double latitude;
    double longitude;
};

struct geoCoordinate3D_t //(ddd)
{
    double latitude;
    double longitude;
    double altitude;
};

struct poiCategoryAndReason_t //(uq)
{
    categoryId_t id;
    ushort reason;
};

struct boundingBox_t //(dd)(dd)
{
    geoCoordinate2D_t topLeftCorner;
    geoCoordinate2D_t bottomRightCorner;
};

struct results_t //(ub)
{
    categoryId_t id;
    bool status;
};

struct sessions_t //(ys)
{
   uchar sessionHandle;
   std::string client;
};

struct poiCategory_t //(ub)
{
    categoryId_t id;
    bool top_level; //false if predefined, true if created by plugin
};

struct poiCategoryFull_t //(usb)
{
    categoryId_t id;
    std::string name;
    bool top_level; //false if predefined, true if created by plugin
};

struct poiSearch_t //(uu)
{
    categoryId_t id;
    uint radius;
};

struct version_t //(qqqs)
{
    ushort major;
    ushort minor;
    ushort micro;
    std::string date;
};

struct poiAttribute_t //(ui(yv))
{
    attributeId_t id;
    int type;
    DBusCommonAPIVariant_t value;
};

struct poiAttributeFull_t //(uui(yv)ib)
{
    attributeId_t id;
    categoryId_t poiCategory; //Category unique id
    int type;
    DBusCommonAPIVariant_t value;
    int oper; //enum(INVALID,MORE_THAN,LESS_THAN,EQUAL, ....)
    bool mandatory; //true if the attribute is mandatory for the search and false for optional
};

struct resultSearch_t //(uuia(ui(yv)))
{
    uint id;
    uint distance;
    int route_status;
    QList<poiAttribute_t> attributes;
};

struct detailsPOISearch_t //(us(ddd))
{
    poiId_t id;
    QString name; //need to be a QString for UTF8
    geoCoordinate3D_t location;
};

struct resultSearchDetails_t //((us(ddd))aua(ui(yv)))
{
    detailsPOISearch_t details;
    QList<categoryId_t> categories;
    QList<poiAttribute_t> attributes;
};

struct categoryDetails_t //(uiau(yv)sbs(yv))
{
    categoryId_t id; //Category unique id
    int standardCategoryId; //standard Category Id
    QList<categoryId_t> parents_id; //list of parent categories unique id
    DBusCommonAPIVariant_t icons; //visual icons set
    QString name; //need to be a QString for UTF8
    bool top_level; //false if predefined, true if created by plugin
    std::string description; //short category description (optional)
    DBusCommonAPIVariant_t media; //media associated (html web site, audio, video, ...) (optional)
};

struct categoryOperator_t //(is(yv))
{
    int type; //enum(INVALID,MORE_THAN,LESS_THAN,EQUAL, ....)
    std::string name; //attribute operator name
    DBusCommonAPIVariant_t value; //attribute operator value
};

struct categoryAttribute_t //(usia(is(yv)))
{
    attributeId_t id; //attribute unique id
    std::string name; //attribute unique name
    int type; //enum(INVALID,STRING,INTEGER,COORDINATES ...)
    QList<categoryOperator_t> oper;
};

struct categorySortOption_t //(us)
{
    uint id; //enum(GENIVI_POISERVICE_SORT_DEFAULT,GENIVI_POISERVICE_SORT_BY_DISTANCE,GENIVI_POISERVICE_SORT_BY_TIME ... )
    std::string name; //name to be displayed by application
};

struct categoryDetailsList_t //((uiau(yv)sbs(yv)) a(usia(is(yv))) a(us))
{
    categoryDetails_t details;
    QList<categoryAttribute_t> attributes;
    QList<categorySortOption_t> sortOptions;
};

typedef QMap<ushort,QDBusVariant> tupleUshortVariant;

typedef QMap<qulonglong,QDBusVariant> tupleUlongVariant;

typedef QMap<ushort,ushort> tupleUshortUshort;

struct resultCamSearch_t //(usu(ddd)qa(ui(yv)))
{
    poiId_t source_id;
    std::string name;
    categoryId_t category;
    geoCoordinate3D_t location;
    ushort distance;
    QList<poiAttribute_t> attributes;
};

struct resultCamSearchDetails_t //((us(ddd))aua(ui(yv)))
{
    detailsPOISearch_t details;
    QList<categoryId_t> categories;
    QList<poiAttribute_t> attributes;
};

struct detailsCamCategory_t //(au(yv)ss(yv))
{
    QList<categoryId_t> parents_id;
    QDBusVariant icons;
    std::string name;
    std::string short_desc;
    DBusCommonAPIVariant_t media;
};

struct poiCategoryCamAdd_t //((au(yv)ss(yv))a(usia(is(yv)))a(us))
{
    detailsCamCategory_t details;
    QList<categoryAttribute_t> attributes;
    QList<categorySortOption_t> sortOptions;
};

struct poiCategoryCamUpdate_t //(ua(usia(is(yv)))a(us))
{
   categoryId_t unique_id;
   QList<categoryAttribute_t> attributes;
   QList<categorySortOption_t> sortOptions;
};

struct poiCamAdd_t //(s(ddd)a(ui(yv)))
{
   std::string name;
   geoCoordinate3D_t location;
   QList<poiAttribute_t> attributes;
};

struct satelliteInfo_t //(qqqqqb)
{
    ushort system;
    ushort satelliteId;
    ushort azimuth;
    ushort elevation;
    ushort snr;
    bool inUse;
};

struct route_vector_t //(dd)(dd)
{
    geoCoordinate2D_t startPoint;
    geoCoordinate2D_t endPoint;
};

struct configurationLocale_t //(sss)
{
    std::string languageCode;
    std::string countryCode;
    std::string scriptCode;
};

#endif // POIPOCCOMMONTYPES_H