Skip to main content

ohos_abilitykit_sys/base/want/
want_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::base::common::AbilityBaseResult;
7
8/// Indicates information of element.
9///
10///
11/// Available since API-level: 15
12#[cfg(feature = "api-15")]
13#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
14#[repr(C)]
15#[derive(Debug, Copy, Clone)]
16pub struct AbilityBase_Element {
17    /// Indicates the name of application.
18    pub bundleName: *mut ::core::ffi::c_char,
19    /// Indicates the name of module.
20    pub moduleName: *mut ::core::ffi::c_char,
21    /// Indicates the name of ability.
22    pub abilityName: *mut ::core::ffi::c_char,
23}
24#[repr(C)]
25pub struct AbilityBase_Want {
26    _unused: [u8; 0],
27}
28extern "C" {
29    /// Create want.
30    ///
31    /// # Arguments
32    ///
33    /// * `element` - Information of element.
34    ///
35    /// # Returns
36    ///
37    /// * Returns the newly created AbilityBase_Want object.
38    ///
39    ///
40    /// Available since API-level: 15
41    #[cfg(feature = "api-15")]
42    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
43    pub fn OH_AbilityBase_CreateWant(element: AbilityBase_Element) -> *mut AbilityBase_Want;
44    /// Destroy input want.
45    ///
46    /// # Arguments
47    ///
48    /// * `want` - The want to be deleted.
49    ///
50    /// # Returns
51    ///
52    /// * The error code.
53    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
54    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want is invalid.
55    ///
56    /// Available since API-level: 15
57    #[cfg(feature = "api-15")]
58    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
59    pub fn OH_AbilityBase_DestroyWant(want: *mut AbilityBase_Want) -> AbilityBaseResult;
60    /// Set want element.
61    ///
62    /// # Arguments
63    ///
64    /// * `want` - The want that needs to be set element.
65    ///
66    /// * `element` - Information of element.
67    ///
68    /// # Returns
69    ///
70    /// * The error code.
71    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
72    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want is invalid.
73    ///
74    /// Available since API-level: 15
75    #[cfg(feature = "api-15")]
76    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
77    pub fn OH_AbilityBase_SetWantElement(
78        want: *mut AbilityBase_Want,
79        element: AbilityBase_Element,
80    ) -> AbilityBaseResult;
81    /// Get want element.
82    ///
83    /// # Arguments
84    ///
85    /// * `want` - The want for the element that has been obtained.
86    ///
87    /// * `element` - The element obtained from want.
88    ///
89    /// # Returns
90    ///
91    /// * The error code.
92    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
93    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the want or element is invalid.
94    ///
95    /// Available since API-level: 15
96    #[cfg(feature = "api-15")]
97    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
98    pub fn OH_AbilityBase_GetWantElement(
99        want: *mut AbilityBase_Want,
100        element: *mut AbilityBase_Element,
101    ) -> AbilityBaseResult;
102    /// Set want char param.
103    ///
104    /// # Arguments
105    ///
106    /// * `want` - The want needs to be set char param.
107    ///
108    /// * `key` - The key of char param.
109    ///
110    /// * `value` - The value of char param.
111    ///
112    /// # Returns
113    ///
114    /// * The error code.
115    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
116    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
117    ///
118    /// Available since API-level: 15
119    #[cfg(feature = "api-15")]
120    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
121    pub fn OH_AbilityBase_SetWantCharParam(
122        want: *mut AbilityBase_Want,
123        key: *const ::core::ffi::c_char,
124        value: *const ::core::ffi::c_char,
125    ) -> AbilityBaseResult;
126    /// Get want char param.
127    ///
128    /// # Arguments
129    ///
130    /// * `want` - The want for the char param that has been obtained.
131    ///
132    /// * `key` - The key of char param.
133    ///
134    /// * `value` - The value of char param.
135    ///
136    /// * `valueSize` - Size of the value.
137    ///
138    /// # Returns
139    ///
140    /// * The error code.
141    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
142    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
143    ///
144    /// Available since API-level: 15
145    #[cfg(feature = "api-15")]
146    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
147    pub fn OH_AbilityBase_GetWantCharParam(
148        want: *mut AbilityBase_Want,
149        key: *const ::core::ffi::c_char,
150        value: *mut ::core::ffi::c_char,
151        valueSize: usize,
152    ) -> AbilityBaseResult;
153    /// Add fd to want.
154    ///
155    /// # Arguments
156    ///
157    /// * `want` - The want needs to be add fd.
158    ///
159    /// * `key` - The key of the fd.
160    ///
161    /// * `fd` - File Descriptor.
162    ///
163    /// # Returns
164    ///
165    /// * The error code.
166    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
167    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
168    ///
169    /// Available since API-level: 15
170    #[cfg(feature = "api-15")]
171    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
172    pub fn OH_AbilityBase_AddWantFd(
173        want: *mut AbilityBase_Want,
174        key: *const ::core::ffi::c_char,
175        fd: i32,
176    ) -> AbilityBaseResult;
177    /// Get fd from want.
178    ///
179    /// # Arguments
180    ///
181    /// * `want` - The want that includes fd.
182    ///
183    /// * `key` - The key of the fd.
184    ///
185    /// * `fd` - File Descriptor.
186    ///
187    /// # Returns
188    ///
189    /// * The error code.
190    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
191    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
192    ///
193    /// Available since API-level: 15
194    #[cfg(feature = "api-15")]
195    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
196    pub fn OH_AbilityBase_GetWantFd(
197        want: *mut AbilityBase_Want,
198        key: *const ::core::ffi::c_char,
199        fd: *mut i32,
200    ) -> AbilityBaseResult;
201    /// Set uri to want.
202    ///
203    /// # Arguments
204    ///
205    /// * `want` - The want needs to set uri.
206    ///
207    /// * `uri` - The uri of the want.
208    ///
209    /// # Returns
210    ///
211    /// * The error code.
212    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
213    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
214    ///
215    /// Available since API-level: 17
216    #[cfg(feature = "api-17")]
217    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
218    pub fn OH_AbilityBase_SetWantUri(
219        want: *mut AbilityBase_Want,
220        uri: *const ::core::ffi::c_char,
221    ) -> AbilityBaseResult;
222    /// Get uri from want.
223    ///
224    /// # Arguments
225    ///
226    /// * `want` - The want that includes uri.
227    ///
228    /// * `uri` - The uri of the want.
229    ///
230    /// * `uriSize` - Size of the uri.
231    ///
232    /// # Returns
233    ///
234    /// * The error code.
235    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
236    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
237    ///
238    /// Available since API-level: 17
239    #[cfg(feature = "api-17")]
240    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
241    pub fn OH_AbilityBase_GetWantUri(
242        want: *mut AbilityBase_Want,
243        uri: *mut ::core::ffi::c_char,
244        uriSize: usize,
245    ) -> AbilityBaseResult;
246    /// Set int32_t to want.
247    ///
248    /// # Arguments
249    ///
250    /// * `want` - The want needs to set int32_t value.
251    ///
252    /// * `key` - The key of int32_t param.
253    ///
254    /// * `value` - The value of int32_t param.
255    ///
256    /// # Returns
257    ///
258    /// * The error code.
259    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
260    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
261    ///
262    /// Available since API-level: 17
263    #[cfg(feature = "api-17")]
264    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
265    pub fn OH_AbilityBase_SetWantInt32Param(
266        want: *mut AbilityBase_Want,
267        key: *const ::core::ffi::c_char,
268        value: i32,
269    ) -> AbilityBaseResult;
270    /// Get int32_t from want.
271    ///
272    /// # Arguments
273    ///
274    /// * `want` - The want includes int32_t value.
275    ///
276    /// * `key` - The key of int32_t param.
277    ///
278    /// * `value` - The value of int32_t param.
279    ///
280    /// # Returns
281    ///
282    /// * The error code.
283    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
284    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
285    ///
286    /// Available since API-level: 17
287    #[cfg(feature = "api-17")]
288    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
289    pub fn OH_AbilityBase_GetWantInt32Param(
290        want: *mut AbilityBase_Want,
291        key: *const ::core::ffi::c_char,
292        value: *mut i32,
293    ) -> AbilityBaseResult;
294    /// Set bool to want.
295    ///
296    /// # Arguments
297    ///
298    /// * `want` - The want needs to set bool value.
299    ///
300    /// * `key` - The key of bool param.
301    ///
302    /// * `value` - The value of bool param.
303    ///
304    /// # Returns
305    ///
306    /// * The error code.
307    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
308    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
309    ///
310    /// Available since API-level: 17
311    #[cfg(feature = "api-17")]
312    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
313    pub fn OH_AbilityBase_SetWantBoolParam(
314        want: *mut AbilityBase_Want,
315        key: *const ::core::ffi::c_char,
316        value: bool,
317    ) -> AbilityBaseResult;
318    /// Get bool from want.
319    ///
320    /// # Arguments
321    ///
322    /// * `want` - The want needs to set bool value.
323    ///
324    /// * `key` - The key of bool param.
325    ///
326    /// * `value` - The value of bool param.
327    ///
328    /// # Returns
329    ///
330    /// * The error code.
331    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
332    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
333    ///
334    /// Available since API-level: 17
335    #[cfg(feature = "api-17")]
336    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
337    pub fn OH_AbilityBase_GetWantBoolParam(
338        want: *mut AbilityBase_Want,
339        key: *const ::core::ffi::c_char,
340        value: *mut bool,
341    ) -> AbilityBaseResult;
342    /// Set double to want.
343    ///
344    /// # Arguments
345    ///
346    /// * `want` - The want needs to set double value.
347    ///
348    /// * `key` - The key of double param.
349    ///
350    /// * `value` - The value of double param.
351    ///
352    /// # Returns
353    ///
354    /// * The error code.
355    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
356    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
357    ///
358    /// Available since API-level: 17
359    #[cfg(feature = "api-17")]
360    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
361    pub fn OH_AbilityBase_SetWantDoubleParam(
362        want: *mut AbilityBase_Want,
363        key: *const ::core::ffi::c_char,
364        value: f64,
365    ) -> AbilityBaseResult;
366    /// Get double from want.
367    ///
368    /// # Arguments
369    ///
370    /// * `want` - The want needs to set double value.
371    ///
372    /// * `key` - The key of double param.
373    ///
374    /// * `value` - The value of double param.
375    ///
376    /// # Returns
377    ///
378    /// * The error code.
379    /// [`ABILITY_BASE_ERROR_CODE_NO_ERROR`] if the operation is successful.
380    /// [`ABILITY_BASE_ERROR_CODE_PARAM_INVALID`] if the input parameters are invalid.
381    ///
382    /// Available since API-level: 17
383    #[cfg(feature = "api-17")]
384    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
385    pub fn OH_AbilityBase_GetWantDoubleParam(
386        want: *mut AbilityBase_Want,
387        key: *const ::core::ffi::c_char,
388        value: *mut f64,
389    ) -> AbilityBaseResult;
390}