summaryrefslogtreecommitdiff
path: root/test/poi-service/poi-common/poi-common-types.h
blob: fa442e94c7acb68cf66e4006465eb3a0105ffdc7 (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
/**
 * @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>

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

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

struct poiCategoryAndReason_t
{ //(qq)
    ushort id;
    ushort reason;
};

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

struct results_t
{ //(qb)
    ushort id;
    bool status;
};

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

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

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

struct poiSearch_t
{ //(qu)
    ushort id;
    uint radius;
};

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

struct poiAttribute_t
{ //(sqv)
    std::string name;
    ushort type;
    QDBusVariant value;
};

struct poiAttributeFull_t
{ //(sqqvqb)
    std::string name;
    ushort poiCategory; //Category unique id
    ushort type;
    QDBusVariant value;
    ushort id; //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
{ //(uuqa(sqv))
    uint id;
    uint distance;
    ushort route_status;
    QList<poiAttribute_t> attributes;
};

struct detailsPOISearch_t
{ //(usddi)
    uint id;
    QString name; //need to be a QString for UTF8
    double latitude;
    double longitude;
    int altitude;
};

struct resultSearchDetails_t
{ //((usddi)aqa(sqv))
    detailsPOISearch_t details;
    QList<ushort> categories;
    QList<poiAttribute_t> attributes;
};

struct categoryDetails_t
{ //(qaqvsbsv)
    ushort id; //Category unique id
    QList<ushort> parents_id; //list of parent categories unique id
    QDBusVariant 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)
    QDBusVariant media; //media associated (html web site, audio, video, ...) (optional)
};

struct categoryOperator_t
{ //(qs)
    ushort id; //enum(INVALID,MORE_THAN,LESS_THAN,EQUAL, ....)
    std::string name; //attribute operator name
};

struct categoryAttribute_t
{ //(sqa(qs))
    std::string name; //attribute unique name
    ushort type; //enum(INVALID,STRING,INTEGER,COORDINATES ...)
    QList<categoryOperator_t> oper;
};

struct categorySortOption_t
{ //(qs)
    ushort 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
{ //((qaqvsbsv)a(sqa(qs))a(qs))
    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
{ //(usq(ddi)qa(sqv))
    uint source_id;
    std::string name;
    ushort category;
    geoCoordinate3D_t location;
    ushort distance;
    QList<poiAttribute_t> attributes;
};

struct resultCamSearchDetails_t
{ //((usddi)aqa(sqv))
    detailsPOISearch_t details;
    QList<ushort> categories;
    QList<poiAttribute_t> attributes;
};

struct detailsCamCategory_t
{ //(aqvssv)
    QList<ushort> parents_id;
    QDBusVariant icons;
    std::string name;
    std::string short_desc;
    QDBusVariant media;
};

struct poiCategoryCamAdd_t
{ //((aqvssv)a(sqa(qs))a(qs))
    detailsCamCategory_t details;
    QList<categoryAttribute_t> attributes;
    QList<categorySortOption_t> sortOptions;
};

struct poiCategoryCamUpdate_t
{ //(qa(sqa(qs))a(qs))
   ushort unique_id;
   QList<categoryAttribute_t> attributes;
   QList<categorySortOption_t> sortOptions;
};

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;
};

#endif // POIPOCCOMMONTYPES_H