• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef BLUETOOTH_PARCEL_MAP_MCE_PARAMETER_H
17 #define BLUETOOTH_PARCEL_MAP_MCE_PARAMETER_H
18 
19 #include "map_mce_parameter.h"
20 #include "parcel.h"
21 
22 namespace OHOS {
23 namespace Bluetooth {
24 class BluetoothIProfileMapAction : public Parcelable, public bluetooth::IProfileMapAction {
25 public:
26     bool Marshalling(Parcel &parcel) const override;
27 
28     static BluetoothIProfileMapAction *Unmarshalling(Parcel &parcel);
29     /**
30      * @brief Write IProfileMapAction values to parcel.
31      *
32      * @param parcel Parcel which store IProfileMapAction values.
33      * @return Operation result.
34      * @since 1.0
35      * @version 1.0
36      */
37     bool WriteToParcel(Parcel &parcel);
38 
39     /**
40      * @brief Read IProfileMapAction values from parcel.
41      *
42      * @param parcel Parcel which bring IProfileMapAction values.
43      * @return Operation result.
44      * @since 1.0
45      * @version 1.0
46      */
47     bool ReadFromParcel(Parcel &parcel);
48 };
49 
50 /**
51  * @brief MasInstanceInfo Parameters
52  *
53  * @since 1.0
54  * @version 1.0
55  */
56 class BluetoothIProfileMasInstanceInfoList : public Parcelable, public bluetooth::IProfileMasInstanceInfoList {
57 public:
58     bool Marshalling(Parcel &parcel) const override;
59 
60     static BluetoothIProfileMasInstanceInfoList *Unmarshalling(Parcel &parcel);
61     /*
62      * @brief Write IProfileMasInstanceInfo values to parcel.
63      *
64      * @param parcel Parcel which store IProfileMasInstanceInfo values.
65      * @return Operation result.
66      * @since 1.0
67      * @version 1.0
68      */
69     bool WriteToParcel(Parcel &parcel);
70 
71     /**
72      * @brief Read IProfileMasInstanceInfo values from parcel.
73      *
74      * @param parcel Parcel which bring IProfileMasInstanceInfo values.
75      * @return Operation result.
76      * @since 1.0
77      * @version 1.0
78      */
79     bool ReadFromParcel(Parcel &parcel);
80 };
81 
82 /**
83  * @brief Map SendMessage Parameters
84  *
85  * @since 1.0
86  * @version 1.0
87  */
88 class BluetoothIProfileSendMessageParameters : public Parcelable, public bluetooth::IProfileSendMessageParameters {
89 public:
90     bool Marshalling(Parcel &parcel) const override;
91 
92     static BluetoothIProfileSendMessageParameters *Unmarshalling(Parcel &parcel);
93     /*
94      * @brief Write IProfileSendMessageParameters values to parcel.
95      *
96      * @param parcel Parcel which store IProfileSendMessageParameters values.
97      * @return Operation result.
98      * @since 1.0
99      * @version 1.0
100      */
101     bool WriteToParcel(Parcel &parcel);
102 
103     /**
104      * @brief Read IProfileSendMessageParameters values from parcel.
105      *
106      * @param parcel Parcel which bring IProfileSendMessageParameters values.
107      * @return Operation result.
108      * @since 1.0
109      * @version 1.0
110      */
111     bool ReadFromParcel(Parcel &parcel);
112 };
113 
114 /**
115  * @brief Map IProfileSetOwnerStatusParameters Parameters
116  *
117  * @since 1.0
118  * @version 1.0
119  */
120 class BluetoothIProfileSetOwnerStatusParameters : public Parcelable,
121                                                   public bluetooth::IProfileSetOwnerStatusParameters {
122 public:
123     bool Marshalling(Parcel &parcel) const override;
124 
125     static BluetoothIProfileSetOwnerStatusParameters *Unmarshalling(Parcel &parcel);
126     /*
127      * @brief Write IProfileSetOwnerStatusParameters values to parcel.
128      *
129      * @param parcel Parcel which store IProfileSetOwnerStatusParameters values.
130      * @return Operation result.
131      * @since 1.0
132      * @version 1.0
133      */
134     bool WriteToParcel(Parcel &parcel);
135 
136     /**
137      * @brief Read IProfileSetOwnerStatusParameters values from parcel.
138      *
139      * @param parcel Parcel which bring IProfileSetOwnerStatusParameters values.
140      * @return Operation result.
141      * @since 1.0
142      * @version 1.0
143      */
144     bool ReadFromParcel(Parcel &parcel);
145 };
146 
147 /**
148  * @brief Map IProfileGetConversationListingParameters Parameters
149  *
150  * @since 1.0
151  * @version 1.0
152  */
153 class BluetoothIProfileGetConversationListingParameters : public Parcelable,
154                                                           public bluetooth::IProfileGetConversationListingParameters {
155 public:
156     bool Marshalling(Parcel &parcel) const override;
157 
158     static BluetoothIProfileGetConversationListingParameters *Unmarshalling(Parcel &parcel);
159     /*
160      * @brief Write IProfileGetConversationListingParameters values to parcel.
161      *
162      * @param parcel Parcel which store IProfileGetConversationListingParameters values.
163      * @return Operation result.
164      * @since 1.0
165      * @version 1.0
166      */
167     bool WriteToParcel(Parcel &parcel);
168 
169     /**
170      * @brief Read IProfileGetConversationListingParameters values from parcel.
171      *
172      * @param parcel Parcel which bring IProfileGetConversationListingParameters values.
173      * @return Operation result.
174      * @since 1.0
175      * @version 1.0
176      */
177     bool ReadFromParcel(Parcel &parcel);
178 };
179 
180 /**
181  * @brief Map IProfileGetMessageParameters Parameters
182  *
183  * @since 1.0
184  * @version 1.0
185  */
186 class BluetoothIProfileGetMessageParameters : public Parcelable, public bluetooth::IProfileGetMessageParameters {
187 public:
188     bool Marshalling(Parcel &parcel) const override;
189 
190     static BluetoothIProfileGetMessageParameters *Unmarshalling(Parcel &parcel);
191     /*
192      * @brief Write IProfileGetMessageParameters values to parcel.
193      *
194      * @param parcel Parcel which store IProfileGetMessageParameters values.
195      * @return Operation result.
196      * @since 1.0
197      * @version 1.0
198      */
199     bool WriteToParcel(Parcel &parcel);
200 
201     /**
202      * @brief Read IProfileGetMessageParameters values from parcel.
203      *
204      * @param parcel Parcel which bring IProfileGetMessageParameters values.
205      * @return Operation result.
206      * @since 1.0
207      * @version 1.0
208      */
209     bool ReadFromParcel(Parcel &parcel);
210 };
211 
212 /**
213  * @brief Map IProfileGetMessagesListingParameters Parameters
214  *
215  * @since 1.0
216  * @version 1.0
217  */
218 class BluetoothIProfileGetMessagesListingParameters : public Parcelable,
219                                                       public bluetooth::IProfileGetMessagesListingParameters {
220 public:
221     bool Marshalling(Parcel &parcel) const override;
222 
223     static BluetoothIProfileGetMessagesListingParameters *Unmarshalling(Parcel &parcel);
224     /*
225      * @brief Write IProfileGetMessagesListingParameters values to parcel.
226      *
227      * @param parcel Parcel which store IProfileGetMessagesListingParameters values.
228      * @return Operation result.
229      * @since 1.0
230      * @version 1.0
231      */
232     bool WriteToParcel(Parcel &parcel);
233 
234     /**
235      * @brief Read IProfileGetMessagesListingParameters values from parcel.
236      *
237      * @param parcel Parcel which bring IProfileGetMessagesListingParameters values.
238      * @return Operation result.
239      * @since 1.0
240      * @version 1.0
241      */
242     bool ReadFromParcel(Parcel &parcel);
243 };
244 
245 /**
246  * @brief Map IProfileBMessage Parameters
247  *
248  * @since 1.0
249  * @version 1.0
250  */
251 class BluetoothIProfileBMessage : public Parcelable, public bluetooth::IProfileBMessage {
252 public:
253     bool Marshalling(Parcel &parcel) const override;
254 
255     static BluetoothIProfileBMessage *Unmarshalling(Parcel &parcel);
256     /*
257      * @brief Write IProfileBMessage values to parcel.
258      *
259      * @param parcel Parcel which store IProfileBMessage values.
260      * @return Operation result.
261      * @since 1.0
262      * @version 1.0
263      */
264     bool WriteToParcel(Parcel &parcel);
265 
266     /**
267      * @brief Read IProfileBMessage values from parcel.
268      *
269      * @param parcel Parcel which bring IProfileBMessage values.
270      * @return Operation result.
271      * @since 1.0
272      * @version 1.0
273      */
274     bool ReadFromParcel(Parcel &parcel);
275 };
276 
277 /**
278  * @brief Map IProfileMessagesListing Parameters
279  *
280  * @since 1.0
281  * @version 1.0
282  */
283 class BluetoothIProfileMessagesListing : public Parcelable, public bluetooth::IProfileMessagesListing {
284 public:
285     bool Marshalling(Parcel &parcel) const override;
286 
287     static BluetoothIProfileMessagesListing *Unmarshalling(Parcel &parcel);
288     /*
289      * @brief Write IProfileMessagesListing values to parcel.
290      *
291      * @param parcel Parcel which store IProfileMessagesListing values.
292      * @return Operation result.
293      * @since 1.0
294      * @version 1.0
295      */
296     bool WriteToParcel(Parcel &parcel);
297 
298     /**
299      * @brief Read IProfileMessagesListing values from parcel.
300      *
301      * @param parcel Parcel which bring IProfileMessagesListing values.
302      * @return Operation result.
303      * @since 1.0
304      * @version 1.0
305      */
306     bool ReadFromParcel(Parcel &parcel);
307 
308 private:
309     bool WriteToParcelIProfileMessageOutline(
310         Parcel &parcel, const bluetooth::IProfileMessageOutline &outline) const;
311     bool ReadFromParcelIProfileMessageOutline(Parcel &parcel, bluetooth::IProfileMessageOutline &outline);
312     int outlineListSize;
313 };
314 
315 /**
316  * @brief Map IProfileConversationListing Parameters
317  *
318  * @since 1.0
319  * @version 1.0
320  */
321 class BluetoothIProfileConversationListing : public Parcelable, public bluetooth::IProfileConversationListing {
322 public:
323     bool Marshalling(Parcel &parcel) const override;
324 
325     static BluetoothIProfileConversationListing *Unmarshalling(Parcel &parcel);
326     /*
327      * @brief Write IProfileConversationListing values to parcel.
328      *
329      * @param parcel Parcel which store IProfileConversationListing values.
330      * @return Operation result.
331      * @since 1.0
332      * @version 1.0
333      */
334     bool WriteToParcel(Parcel &parcel);
335 
336     /**
337      * @brief Read IProfileConversationListing values from parcel.
338      *
339      * @param parcel Parcel which bring IProfileConversationListing values.
340      * @return Operation result.
341      * @since 1.0
342      * @version 1.0
343      */
344     bool ReadFromParcel(Parcel &parcel);
345 
346 private:
347     bool WriteToParcelIProfileConversation(Parcel &parcel, const bluetooth::IProfileConversation &outline) const;
348     bool ReadFromParcelIProfileConversation(Parcel &parcel, bluetooth::IProfileConversation &outline);
349     bool WriteToParcelIProfileParticipant(Parcel &parcel, const bluetooth::IProfileParticipant &outline) const;
350     bool ReadFromParcelIProfileParticipant(Parcel &parcel, bluetooth::IProfileParticipant &outline);
351     int participantListNum_ = 0;
352     int conversationOutlineListNum_ = 0;
353 };
354 
355 /**
356  * @brief Map IProfileMapEventReport Parameters
357  *
358  * @since 1.0
359  * @version 1.0
360  */
361 class BluetoothIProfileMapEventReport : public Parcelable, public bluetooth::IProfileMapEventReport {
362 public:
363     bool Marshalling(Parcel &parcel) const override;
364 
365     static BluetoothIProfileMapEventReport *Unmarshalling(Parcel &parcel);
366     /*
367      * @brief Write IProfileMapEventReport values to parcel.
368      *
369      * @param parcel Parcel which store IProfileMapEventReport values.
370      * @return Operation result.
371      * @since 1.0
372      * @version 1.0
373      */
374     bool WriteToParcel(Parcel &parcel);
375 
376     /**
377      * @brief Read IProfileMapEventReport values from parcel.
378      *
379      * @param parcel Parcel which bring IProfileMapEventReport values.
380      * @return Operation result.
381      * @since 1.0
382      * @version 1.0
383      */
384     bool ReadFromParcel(Parcel &parcel);
385 };
386 
387 /**
388  * @brief Map IProfileBMessageStruct Parameters
389  *
390  * @since 1.0
391  * @version 1.0
392  */
393 class BluetoothIProfileBMessageStruct {
394 public:
395     /*
396      * @brief Write IProfileBMessageStruct values to parcel.
397      *
398      * @param parcel Parcel which store IProfileBMessageStruct values.
399      * @return Operation result.
400      * @since 1.0
401      * @version 1.0
402      */
403     bool WriteToParcel(Parcel &parcel, const bluetooth::IProfileBMessageStruct &msgStruct) const;
404 
405     /**
406      * @brief Read IProfileBMessageStruct values from parcel.
407      *
408      * @param parcel Parcel which bring IProfileBMessageStruct values.
409      * @return Operation result.
410      * @since 1.0
411      * @version 1.0
412      */
413     bool ReadFromParcel(Parcel &parcel, bluetooth::IProfileBMessageStruct &msgStruct);
414 
415 private:
416     bool WriteToParcelIProfileMapVcard(Parcel &parcel, const bluetooth::IProfileMapVcard &vcard) const;
417     bool ReadFromParcelIProfileMapVcard(Parcel &parcel, bluetooth::IProfileMapVcard &vcard);
418 };
419 
420 }  // namespace Bluetooth
421 }  // namespace OHOS
422 
423 #endif  // BLUETOOTH_PARCEL_MAP_MCE_PARAMETER_H