ohos_window_manager_sys/display_manager/display_manager_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::display_info::NativeDisplayManagerResult;
7use crate::display_info::NativeDisplayManager_CutoutInfo;
8#[cfg(feature = "api-14")]
9use crate::display_info::NativeDisplayManager_DisplayInfo;
10#[cfg(feature = "api-14")]
11use crate::display_info::NativeDisplayManager_DisplaysInfo;
12use crate::display_info::NativeDisplayManager_FoldDisplayMode;
13use crate::display_info::NativeDisplayManager_Orientation;
14use crate::display_info::NativeDisplayManager_Rotation;
15#[cfg(feature = "api-20")]
16use crate::display_info::{NativeDisplayManager_Rect, NativeDisplayManager_SourceMode};
17
18/// the callback function type when display change.
19///
20/// # Arguments
21///
22/// * `displayId` - change display id.
23///
24/// Available since API-level: 12
25#[cfg(feature = "api-12")]
26#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
27pub type OH_NativeDisplayManager_DisplayChangeCallback =
28 ::core::option::Option<unsafe extern "C" fn(displayId: u64)>;
29/// the callback function type when display fold change.
30///
31/// # Arguments
32///
33/// * `displayMode` - current fold display mode.
34///
35/// Available since API-level: 12
36#[cfg(feature = "api-12")]
37#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
38pub type OH_NativeDisplayManager_FoldDisplayModeChangeCallback =
39 ::core::option::Option<unsafe extern "C" fn(displayMode: NativeDisplayManager_FoldDisplayMode)>;
40/// the callback function type when available area change.
41///
42/// # Arguments
43///
44/// * `displayId` - The changed display id.
45///
46/// Available since API-level: 20
47#[cfg(feature = "api-20")]
48#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
49pub type OH_NativeDisplayManager_AvailableAreaChangeCallback =
50 ::core::option::Option<unsafe extern "C" fn(displayId: u64)>;
51/// the callback function type when display connect.
52///
53/// # Arguments
54///
55/// * `displayId` - The added display id.
56///
57/// Available since API-level: 20
58#[cfg(feature = "api-20")]
59#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
60pub type OH_NativeDisplayManager_DisplayAddCallback =
61 ::core::option::Option<unsafe extern "C" fn(displayId: u64)>;
62/// the callback function type when display disconnect.
63///
64/// # Arguments
65///
66/// * `displayId` - The removed display id.
67///
68/// Available since API-level: 20
69#[cfg(feature = "api-20")]
70#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
71pub type OH_NativeDisplayManager_DisplayRemoveCallback =
72 ::core::option::Option<unsafe extern "C" fn(displayId: u64)>;
73extern "C" {
74 /// Obtain the default display Id.
75 ///
76 /// # Arguments
77 ///
78 /// * `displayId` - Indicates the pointer to an <b>uint64_t</b> object.
79 ///
80 /// # Returns
81 ///
82 /// * { DISPLAY_MANAGER_OK } If the operation is successful
83 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
84 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
85 ///
86 /// Available since API-level: 12
87 #[cfg(feature = "api-12")]
88 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
89 pub fn OH_NativeDisplayManager_GetDefaultDisplayId(
90 displayId: *mut u64,
91 ) -> NativeDisplayManagerResult;
92 /// Obtain the default display width.
93 ///
94 /// # Arguments
95 ///
96 /// * `displayWidth` - Indicates the pointer to an <b>int32_t</b> object.
97 ///
98 /// # Returns
99 ///
100 /// * { DISPLAY_MANAGER_OK } If the operation is successful
101 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
102 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
103 ///
104 /// Available since API-level: 12
105 #[cfg(feature = "api-12")]
106 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
107 pub fn OH_NativeDisplayManager_GetDefaultDisplayWidth(
108 displayWidth: *mut i32,
109 ) -> NativeDisplayManagerResult;
110 /// Obtain the default display height.
111 ///
112 /// # Arguments
113 ///
114 /// * `displayHeight` - Indicates the pointer to an <b>int32_t</b> object.
115 ///
116 /// # Returns
117 ///
118 /// * { DISPLAY_MANAGER_OK } If the operation is successful
119 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
120 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
121 ///
122 /// Available since API-level: 12
123 #[cfg(feature = "api-12")]
124 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
125 pub fn OH_NativeDisplayManager_GetDefaultDisplayHeight(
126 displayHeight: *mut i32,
127 ) -> NativeDisplayManagerResult;
128 /// Obtain the default display rotation.
129 ///
130 /// # Arguments
131 ///
132 /// * `displayRotation` - Indicates the pointer to an <b>NativeDisplayManager_Rotation</b> object.
133 ///
134 /// # Returns
135 ///
136 /// * { DISPLAY_MANAGER_OK } If the operation is successful
137 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
138 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
139 ///
140 /// Available since API-level: 12
141 #[cfg(feature = "api-12")]
142 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
143 pub fn OH_NativeDisplayManager_GetDefaultDisplayRotation(
144 displayRotation: *mut NativeDisplayManager_Rotation,
145 ) -> NativeDisplayManagerResult;
146 /// Obtain the default display orientation.
147 ///
148 /// # Arguments
149 ///
150 /// * `displayOrientation` - Indicates the pointer to an <b>NativeDisplayManager_Orientation</b> object.
151 ///
152 /// # Returns
153 ///
154 /// * { DISPLAY_MANAGER_OK } If the operation is successful
155 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
156 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
157 ///
158 /// Available since API-level: 12
159 #[cfg(feature = "api-12")]
160 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
161 pub fn OH_NativeDisplayManager_GetDefaultDisplayOrientation(
162 displayOrientation: *mut NativeDisplayManager_Orientation,
163 ) -> NativeDisplayManagerResult;
164 /// Obtain the default display virtualPixels.
165 ///
166 /// # Arguments
167 ///
168 /// * `virtualPixels` - Indicates the pointer to an <b>float</b> object.
169 ///
170 /// # Returns
171 ///
172 /// * { DISPLAY_MANAGER_OK } If the operation is successful
173 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
174 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
175 ///
176 /// Available since API-level: 12
177 #[cfg(feature = "api-12")]
178 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
179 pub fn OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio(
180 virtualPixels: *mut f32,
181 ) -> NativeDisplayManagerResult;
182 /// Obtain the default display refreshRate.
183 ///
184 /// # Arguments
185 ///
186 /// * `refreshRate` - Indicates the pointer to an <b>uint32_t</b> object.
187 ///
188 /// # Returns
189 ///
190 /// * { DISPLAY_MANAGER_OK } If the operation is successful
191 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
192 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
193 ///
194 /// Available since API-level: 12
195 #[cfg(feature = "api-12")]
196 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
197 pub fn OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(
198 refreshRate: *mut u32,
199 ) -> NativeDisplayManagerResult;
200 /// Obtain the default display densityDpi.
201 ///
202 /// # Arguments
203 ///
204 /// * `densityDpi` - Indicates the pointer to an <b>int32_t</b> object.
205 ///
206 /// # Returns
207 ///
208 /// * { DISPLAY_MANAGER_OK } If the operation is successful
209 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
210 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
211 ///
212 /// Available since API-level: 12
213 #[cfg(feature = "api-12")]
214 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
215 pub fn OH_NativeDisplayManager_GetDefaultDisplayDensityDpi(
216 densityDpi: *mut i32,
217 ) -> NativeDisplayManagerResult;
218 /// Obtain the default display densityPixels.
219 ///
220 /// # Arguments
221 ///
222 /// * `densityPixels` - Indicates the pointer to an <b>float</b> object.
223 ///
224 /// # Returns
225 ///
226 /// * { DISPLAY_MANAGER_OK } If the operation is successful
227 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
228 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
229 ///
230 /// Available since API-level: 12
231 #[cfg(feature = "api-12")]
232 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
233 pub fn OH_NativeDisplayManager_GetDefaultDisplayDensityPixels(
234 densityPixels: *mut f32,
235 ) -> NativeDisplayManagerResult;
236 /// Obtain the default display scaledDensity.
237 ///
238 /// # Arguments
239 ///
240 /// * `scaledDensity` - Indicates the pointer to an <b>float</b> object.
241 ///
242 /// # Returns
243 ///
244 /// * { DISPLAY_MANAGER_OK } If the operation is successful
245 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
246 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
247 ///
248 /// Available since API-level: 12
249 #[cfg(feature = "api-12")]
250 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
251 pub fn OH_NativeDisplayManager_GetDefaultDisplayScaledDensity(
252 scaledDensity: *mut f32,
253 ) -> NativeDisplayManagerResult;
254 /// Obtain the default display xDpi.
255 ///
256 /// # Arguments
257 ///
258 /// * `xDpi` - Indicates the pointer to an <b>float</b> object.
259 ///
260 /// # Returns
261 ///
262 /// * { DISPLAY_MANAGER_OK } If the operation is successful
263 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
264 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
265 ///
266 /// Available since API-level: 12
267 #[cfg(feature = "api-12")]
268 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
269 pub fn OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi(
270 xDpi: *mut f32,
271 ) -> NativeDisplayManagerResult;
272 /// Obtain the default display yDpi.
273 ///
274 /// # Arguments
275 ///
276 /// * `yDpi` - Indicates the pointer to an <b>float</b> object.
277 ///
278 /// # Returns
279 ///
280 /// * { DISPLAY_MANAGER_OK } If the operation is successful
281 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
282 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
283 ///
284 /// Available since API-level: 12
285 #[cfg(feature = "api-12")]
286 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
287 pub fn OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi(
288 yDpi: *mut f32,
289 ) -> NativeDisplayManagerResult;
290 /// Create the cutout info of the device.
291 ///
292 /// # Arguments
293 ///
294 /// * `cutoutInfo` - Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object.
295 ///
296 /// # Returns
297 ///
298 /// * { DISPLAY_MANAGER_OK } If the operation is successful
299 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
300 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
301 ///
302 /// Available since API-level: 12
303 #[cfg(feature = "api-12")]
304 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
305 pub fn OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo(
306 cutoutInfo: *mut *mut NativeDisplayManager_CutoutInfo,
307 ) -> NativeDisplayManagerResult;
308 /// Destroy an <b>NativeDisplayManager_CutoutInfo</b> object and reclaims the memory occupied by the object.
309 ///
310 /// # Arguments
311 ///
312 /// * `cutoutInfo` - Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object.
313 ///
314 /// # Returns
315 ///
316 /// * { DISPLAY_MANAGER_OK } If the operation is successful
317 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
318 ///
319 /// Available since API-level: 12
320 #[cfg(feature = "api-12")]
321 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
322 pub fn OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo(
323 cutoutInfo: *mut NativeDisplayManager_CutoutInfo,
324 ) -> NativeDisplayManagerResult;
325 /// Check whether the device is foldable.
326 ///
327 ///
328 /// # Returns
329 ///
330 /// * { bool } true means the device is foldable.
331 ///
332 /// Available since API-level: 12
333 #[cfg(feature = "api-12")]
334 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
335 pub fn OH_NativeDisplayManager_IsFoldable() -> bool;
336 /// Get the display mode of the foldable device.
337 ///
338 /// # Arguments
339 ///
340 /// * `displayMode` - Indicates the pointer to an <b>NativeDisplayManager_FoldDisplayMode</b> object.
341 ///
342 /// # Returns
343 ///
344 /// * { DISPLAY_MANAGER_OK } If the operation is successful
345 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
346 /// { DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
347 ///
348 /// Available since API-level: 12
349 #[cfg(feature = "api-12")]
350 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
351 pub fn OH_NativeDisplayManager_GetFoldDisplayMode(
352 displayMode: *mut NativeDisplayManager_FoldDisplayMode,
353 ) -> NativeDisplayManagerResult;
354 /// Register the callback for display change listener.
355 ///
356 /// # Arguments
357 ///
358 /// * `displayChangeCallback` - display change callback.
359 ///
360 /// * `listenerIndex` - Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
361 ///
362 /// # Returns
363 ///
364 /// * { DISPLAY_MANAGER_OK } If the operation is successful
365 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
366 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
367 ///
368 /// Available since API-level: 12
369 #[cfg(feature = "api-12")]
370 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
371 pub fn OH_NativeDisplayManager_RegisterDisplayChangeListener(
372 displayChangeCallback: OH_NativeDisplayManager_DisplayChangeCallback,
373 listenerIndex: *mut u32,
374 ) -> NativeDisplayManagerResult;
375 /// Unregister the callback for display changes listener.
376 ///
377 /// # Arguments
378 ///
379 /// * `listenerIndex` - display changed listener index.
380 ///
381 /// # Returns
382 ///
383 /// * { DISPLAY_MANAGER_OK } If the operation is successful
384 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
385 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
386 ///
387 /// Available since API-level: 12
388 #[cfg(feature = "api-12")]
389 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
390 pub fn OH_NativeDisplayManager_UnregisterDisplayChangeListener(
391 listenerIndex: u32,
392 ) -> NativeDisplayManagerResult;
393 /// Register the callback for display mode change listener.
394 ///
395 /// # Arguments
396 ///
397 /// * `displayModeChangeCallback` - display mode change callback.
398 ///
399 /// * `listenerIndex` - Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
400 ///
401 /// # Returns
402 ///
403 /// * { DISPLAY_MANAGER_OK } If the operation is successful
404 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
405 /// { DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
406 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
407 ///
408 /// Available since API-level: 12
409 #[cfg(feature = "api-12")]
410 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
411 pub fn OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener(
412 displayModeChangeCallback: OH_NativeDisplayManager_FoldDisplayModeChangeCallback,
413 listenerIndex: *mut u32,
414 ) -> NativeDisplayManagerResult;
415 /// Unregister the callback for display mode change listener.
416 ///
417 /// # Arguments
418 ///
419 /// * `listenerIndex` - display mode change listener index.
420 ///
421 /// # Returns
422 ///
423 /// * { DISPLAY_MANAGER_OK } If the operation is successful
424 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
425 /// { DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
426 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
427 ///
428 /// Available since API-level: 12
429 #[cfg(feature = "api-12")]
430 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
431 pub fn OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(
432 listenerIndex: u32,
433 ) -> NativeDisplayManagerResult;
434 /// Create all displays.
435 ///
436 /// # Arguments
437 ///
438 /// * `allDisplays` - Output parameter for all displays information.
439 ///
440 /// # Returns
441 ///
442 /// * { DISPLAY_MANAGER_OK } If the operation is successful.
443 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
444 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
445 ///
446 /// Available since API-level: 14
447 #[cfg(feature = "api-14")]
448 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
449 pub fn OH_NativeDisplayManager_CreateAllDisplays(
450 allDisplays: *mut *mut NativeDisplayManager_DisplaysInfo,
451 ) -> NativeDisplayManagerResult;
452 /// Destroy all displays.
453 ///
454 /// # Arguments
455 ///
456 /// * `allDisplays` - all displays to be free.
457 ///
458 /// Available since API-level: 14
459 #[cfg(feature = "api-14")]
460 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
461 pub fn OH_NativeDisplayManager_DestroyAllDisplays(
462 allDisplays: *mut NativeDisplayManager_DisplaysInfo,
463 );
464 /// Create display information by display id.
465 ///
466 /// # Arguments
467 ///
468 /// * `displayId` - The display id.
469 ///
470 /// * `displayInfo` - The pointer to the display information.
471 ///
472 /// # Returns
473 ///
474 /// * { DISPLAY_MANAGER_OK } If the operation is successful.
475 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
476 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
477 ///
478 /// Available since API-level: 14
479 #[cfg(feature = "api-14")]
480 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
481 pub fn OH_NativeDisplayManager_CreateDisplayById(
482 displayId: u32,
483 displayInfo: *mut *mut NativeDisplayManager_DisplayInfo,
484 ) -> NativeDisplayManagerResult;
485 /// Destroy the display information.
486 ///
487 /// # Arguments
488 ///
489 /// * `displayInfo` - the target display to be free.
490 ///
491 /// Available since API-level: 14
492 #[cfg(feature = "api-14")]
493 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
494 pub fn OH_NativeDisplayManager_DestroyDisplay(
495 displayInfo: *mut NativeDisplayManager_DisplayInfo,
496 );
497 /// Create a primary display.
498 ///
499 /// # Arguments
500 ///
501 /// * `displayInfo` - The information of the created display.
502 ///
503 /// # Returns
504 ///
505 /// * { DISPLAY_MANAGER_OK } If the operation is successful.
506 /// { DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
507 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
508 ///
509 /// Available since API-level: 14
510 #[cfg(feature = "api-14")]
511 #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
512 pub fn OH_NativeDisplayManager_CreatePrimaryDisplay(
513 displayInfo: *mut *mut NativeDisplayManager_DisplayInfo,
514 ) -> NativeDisplayManagerResult;
515 /// Register the callback for available area change listener.
516 ///
517 /// # Arguments
518 ///
519 /// * `availableAreaChangeCallback` - Available area change callback.
520 ///
521 /// * `listenerIndex` - Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
522 ///
523 /// # Returns
524 ///
525 /// * { DISPLAY_MANAGER_OK } If the operation is successful
526 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
527 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
528 ///
529 /// Available since API-level: 20
530 #[cfg(feature = "api-20")]
531 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
532 pub fn OH_NativeDisplayManager_RegisterAvailableAreaChangeListener(
533 availableAreaChangeCallback: OH_NativeDisplayManager_AvailableAreaChangeCallback,
534 listenerIndex: *mut u32,
535 ) -> NativeDisplayManagerResult;
536 /// Unregister the callback for available area changes listener.
537 ///
538 /// # Arguments
539 ///
540 /// * `listenerIndex` - The display changed listener index.
541 ///
542 /// # Returns
543 ///
544 /// * { DISPLAY_MANAGER_OK } If the operation is successful
545 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
546 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
547 ///
548 /// Available since API-level: 20
549 #[cfg(feature = "api-20")]
550 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
551 pub fn OH_NativeDisplayManager_UnregisterAvailableAreaChangeListener(
552 listenerIndex: u32,
553 ) -> NativeDisplayManagerResult;
554 /// Create the available area.
555 ///
556 /// # Arguments
557 ///
558 /// * `displayId` - The display id.
559 ///
560 /// * `availableArea` - Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object.
561 ///
562 /// # Returns
563 ///
564 /// * { DISPLAY_MANAGER_OK } If the operation is successful
565 /// { DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
566 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
567 ///
568 /// Available since API-level: 20
569 #[cfg(feature = "api-20")]
570 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
571 pub fn OH_NativeDisplayManager_CreateAvailableArea(
572 displayId: u64,
573 availableArea: *mut *mut NativeDisplayManager_Rect,
574 ) -> NativeDisplayManagerResult;
575 /// Destroy an <b>NativeDisplayManager_Rect</b> object and reclaims the memory occupied by the object.
576 ///
577 /// # Arguments
578 ///
579 /// * `availableArea` - Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object.
580 ///
581 /// # Returns
582 ///
583 /// * { DISPLAY_MANAGER_OK } If the operation is successful
584 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
585 ///
586 /// Available since API-level: 20
587 #[cfg(feature = "api-20")]
588 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
589 pub fn OH_NativeDisplayManager_DestroyAvailableArea(
590 availableArea: *mut NativeDisplayManager_Rect,
591 ) -> NativeDisplayManagerResult;
592 /// Register the callback for display connect listener.
593 ///
594 /// # Arguments
595 ///
596 /// * `displayAddCallback` - display add callback.
597 ///
598 /// * `listenerIndex` - Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
599 ///
600 /// # Returns
601 ///
602 /// * { DISPLAY_MANAGER_OK } If the operation is successful
603 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
604 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
605 ///
606 /// Available since API-level: 20
607 #[cfg(feature = "api-20")]
608 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
609 pub fn OH_NativeDisplayManager_RegisterDisplayAddListener(
610 displayAddCallback: OH_NativeDisplayManager_DisplayAddCallback,
611 listenerIndex: *mut u32,
612 ) -> NativeDisplayManagerResult;
613 /// Unregister the callback for display connect listener.
614 ///
615 /// # Arguments
616 ///
617 /// * `listenerIndex` - The display add listener index.
618 ///
619 /// # Returns
620 ///
621 /// * { DISPLAY_MANAGER_OK } If the operation is successful
622 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
623 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
624 ///
625 /// Available since API-level: 20
626 #[cfg(feature = "api-20")]
627 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
628 pub fn OH_NativeDisplayManager_UnregisterDisplayAddListener(
629 listenerIndex: u32,
630 ) -> NativeDisplayManagerResult;
631 /// Register the callback for display disconnect listener.
632 ///
633 /// # Arguments
634 ///
635 /// * `displayRemoveCallback` - display remove callback.
636 ///
637 /// * `listenerIndex` - Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
638 ///
639 /// # Returns
640 ///
641 /// * { DISPLAY_MANAGER_OK } If the operation is successful
642 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
643 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
644 ///
645 /// Available since API-level: 20
646 #[cfg(feature = "api-20")]
647 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
648 pub fn OH_NativeDisplayManager_RegisterDisplayRemoveListener(
649 displayRemoveCallback: OH_NativeDisplayManager_DisplayRemoveCallback,
650 listenerIndex: *mut u32,
651 ) -> NativeDisplayManagerResult;
652 /// Unregister the callback for display disconnect listener.
653 ///
654 /// # Arguments
655 ///
656 /// * `listenerIndex` - The display remove listener index.
657 ///
658 /// # Returns
659 ///
660 /// * { DISPLAY_MANAGER_OK } If the operation is successful
661 /// { DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
662 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
663 ///
664 /// Available since API-level: 20
665 #[cfg(feature = "api-20")]
666 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
667 pub fn OH_NativeDisplayManager_UnregisterDisplayRemoveListener(
668 listenerIndex: u32,
669 ) -> NativeDisplayManagerResult;
670 /// Get the source mode of the device.
671 ///
672 /// # Arguments
673 ///
674 /// * `displayId` - The display id.
675 ///
676 /// * `sourceMode` - Indicates the pointer to an <b>NativeDisplayManager_SourceMode</b> object.
677 ///
678 /// # Returns
679 ///
680 /// * { DISPLAY_MANAGER_OK } If the operation is successful
681 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
682 ///
683 /// Available since API-level: 20
684 #[cfg(feature = "api-20")]
685 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
686 pub fn OH_NativeDisplayManager_GetDisplaySourceMode(
687 displayId: u64,
688 sourceMode: *mut NativeDisplayManager_SourceMode,
689 ) -> NativeDisplayManagerResult;
690 /// Get the position of the device.
691 ///
692 /// # Arguments
693 ///
694 /// * `displayId` - The display id.
695 ///
696 /// * `x` - The x-coordinate of the screen's top-left corner relative to the primary screen's origin (in px).
697 ///
698 /// * `y` - The y-coordinate of the screen's top-left corner relative to the primary screen's origin (in px).
699 ///
700 /// # Returns
701 ///
702 /// * { DISPLAY_MANAGER_OK } If the operation is successful
703 /// { DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
704 ///
705 /// Available since API-level: 20
706 #[cfg(feature = "api-20")]
707 #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
708 pub fn OH_NativeDisplayManager_GetDisplayPosition(
709 displayId: u64,
710 x: *mut i32,
711 y: *mut i32,
712 ) -> NativeDisplayManagerResult;
713}