• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 OH_NATIVE_DISPLAY_MANAGER_H
17 #define OH_NATIVE_DISPLAY_MANAGER_H
18 
19 /**
20  * @addtogroup OH_DisplayManager
21  * @{
22  *
23  * @brief Defines the data structures for the C APIs of the display module.
24  *
25  * @syscap SystemCapability.WindowManager.WindowManager.Core
26  * @since 12
27  * @version 1.0
28  */
29 
30 /**
31  * @file oh_display_manager.h
32  *
33  * @brief Defines the data structures for the C APIs of the display module.
34  *
35  * @kit ArkUI
36  * @library libnative_display_manager.so.
37  * @syscap SystemCapability.WindowManager.WindowManager.Core
38  * @since 12
39  * @version 1.0
40  */
41 
42 #include "oh_display_info.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /**
49  * @brief Obtain the default display Id.
50  *
51  * @param { *displayId } Indicates the pointer to an <b>uint64_t</b> object.
52  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
53  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
54  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
55  * @since 12
56  */
57 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayId(uint64_t *displayId);
58 
59 /**
60  * @brief Obtain the default display width.
61  *
62  * @param { *displayWidth } Indicates the pointer to an <b>int32_t</b> object.
63  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
64  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
65  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
66  * @since 12
67  */
68 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayWidth(int32_t *displayWidth);
69 
70 /**
71  * @brief Obtain the default display height.
72  *
73  * @param { *displayHeight } Indicates the pointer to an <b>int32_t</b> object.
74  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
75  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
76  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
77  * @since 12
78  */
79 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayHeight(int32_t *displayHeight);
80 
81 /**
82  * @brief Obtain the default display rotation.
83  *
84  * @param { *displayRotation } Indicates the pointer to an <b>NativeDisplayManager_Rotation</b> object.
85  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
86  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
87  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
88  * @since 12
89  */
90 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRotation(
91     NativeDisplayManager_Rotation *displayRotation);
92 
93 /**
94  * @brief Obtain the default display orientation.
95  *
96  * @param { *displayOrientation } Indicates the pointer to an <b>NativeDisplayManager_Orientation</b> object.
97  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
98  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
99  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
100  * @since 12
101  */
102 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayOrientation(
103     NativeDisplayManager_Orientation *displayOrientation);
104 
105 /**
106  * @brief Obtain the default display virtualPixels.
107  *
108  * @param { *virtualPixels } Indicates the pointer to an <b>float</b> object.
109  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
110  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
111  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
112  * @since 12
113  */
114 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayVirtualPixelRatio(float *virtualPixels);
115 
116 /**
117  * @brief Obtain the default display refreshRate.
118  *
119  * @param { *refreshRate } Indicates the pointer to an <b>uint32_t</b> object.
120  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
121  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
122  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
123  * @since 12
124  */
125 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(uint32_t *refreshRate);
126 
127 /**
128  * @brief Obtain the default display densityDpi.
129  *
130  * @param { *densityDpi } Indicates the pointer to an <b>int32_t</b> object.
131  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
132  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
133  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
134  * @since 12
135  */
136 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityDpi(int32_t *densityDpi);
137 
138 /**
139  * @brief Obtain the default display densityPixels.
140  *
141  * @param { *densityPixels } Indicates the pointer to an <b>float</b> object.
142  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
143  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
144  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
145  * @since 12
146  */
147 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityPixels(float *densityPixels);
148 
149 /**
150  * @brief Obtain the default display scaledDensity.
151  *
152  * @param { *scaledDensity } Indicates the pointer to an <b>float</b> object.
153  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
154  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
155  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
156  * @since 12
157  */
158 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayScaledDensity(float *scaledDensity);
159 
160 /**
161  * @brief Obtain the default display xDpi.
162  *
163  * @param { *xDpi } Indicates the pointer to an <b>float</b> object.
164  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
165  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
166  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
167  * @since 12
168  */
169 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityXdpi(float *xDpi);
170 
171 /**
172  * @brief Obtain the default display yDpi.
173  *
174  * @param { *yDpi } Indicates the pointer to an <b>float</b> object.
175  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
176  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
177  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
178  * @since 12
179  */
180 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDefaultDisplayDensityYdpi(float *yDpi);
181 
182 /**
183  * @brief Create the cutout info of the device.
184  *
185  * @param { **cutoutInfo } Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object.
186  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
187  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
188  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
189  * @since 12
190  */
191 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDefaultDisplayCutoutInfo(
192     NativeDisplayManager_CutoutInfo **cutoutInfo);
193 
194 /**
195  * @brief Destroy an <b>NativeDisplayManager_CutoutInfo</b> object and reclaims the memory occupied by the object.
196  *
197  * @param { **cutoutInfo } Indicates the pointer to an <b>NativeDisplayManager_CutoutInfo</b> object.
198  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
199  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
200  * @since 12
201  */
202 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyDefaultDisplayCutoutInfo(
203     NativeDisplayManager_CutoutInfo *cutoutInfo);
204 
205 /**
206  * @brief Check whether the device is foldable.
207  *
208  * @return { bool } true means the device is foldable.
209  * @since 12
210  */
211 bool OH_NativeDisplayManager_IsFoldable();
212 
213 /**
214  * @brief Get the display mode of the foldable device.
215  *
216  * @param { *displayMode } Indicates the pointer to an <b>NativeDisplayManager_FoldDisplayMode</b> object.
217  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
218  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
219  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
220  * @since 12
221  */
222 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetFoldDisplayMode(
223     NativeDisplayManager_FoldDisplayMode *displayMode);
224 
225 /**
226  * @brief the callback function type when display change.
227  *
228  * @param { *displayId } change display id.
229  * @since 12
230  */
231 typedef void (*OH_NativeDisplayManager_DisplayChangeCallback)(uint64_t displayId);
232 
233 /**
234  * @brief Register the callback for display change listener.
235  *
236  * @param { displayChangeCallback } display change callback.
237  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
238  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
239  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
240  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
241  * @since 12
242  */
243 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayChangeListener(
244     OH_NativeDisplayManager_DisplayChangeCallback displayChangeCallback, uint32_t *listenerIndex);
245 
246 /**
247  * @brief Unregister the callback for display changes listener.
248  *
249  * @param { listenerIndex } display changed listener index.
250  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
251  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
252  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
253  * @since 12
254  */
255 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayChangeListener(uint32_t listenerIndex);
256 
257 /**
258  * @brief the callback function type when display fold change.
259  *
260  * @param { displayMode } current fold display mode.
261  * @since 12
262  */
263 typedef void (*OH_NativeDisplayManager_FoldDisplayModeChangeCallback)(
264     NativeDisplayManager_FoldDisplayMode displayMode);
265 
266 /**
267  * @brief Register the callback for display mode change listener.
268  *
269  * @param { displayModeChangeCallback } display mode change callback.
270  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
271  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
272  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
273  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
274  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
275  * @since 12
276  */
277 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterFoldDisplayModeChangeListener(
278     OH_NativeDisplayManager_FoldDisplayModeChangeCallback displayModeChangeCallback, uint32_t *listenerIndex);
279 
280 /**
281  * @brief Unregister the callback for display mode change listener.
282  *
283  * @param { listenerIndex } display mode change listener index.
284  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful
285  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
286  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORTED } device not support.
287  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
288  * @since 12
289  */
290 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterFoldDisplayModeChangeListener(uint32_t listenerIndex);
291 
292 /**
293  * @brief Create all displays.
294  *
295  * @param allDisplays Output parameter for all displays information.
296  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
297  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
298  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
299  * @since 14
300  */
301 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAllDisplays(
302     NativeDisplayManager_DisplaysInfo **allDisplays);
303 
304 /**
305  * @brief Destroy all displays.
306  *
307  * @param allDisplays all displays to be free.
308  * @since 14
309  */
310 void OH_NativeDisplayManager_DestroyAllDisplays(NativeDisplayManager_DisplaysInfo *allDisplays);
311 
312 /**
313  * @brief Create display information by display id.
314  *
315  * @param displayId The display id.
316  * @param displayInfo The pointer to the display information.
317  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
318  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
319  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
320  * @since 14
321  */
322 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateDisplayById(uint32_t displayId,
323     NativeDisplayManager_DisplayInfo **displayInfo);
324 
325 /**
326  * @brief Destroy the display information.
327  *
328  * @param displayInfo the target display to be free.
329  * @since 14
330  */
331 void OH_NativeDisplayManager_DestroyDisplay(NativeDisplayManager_DisplayInfo *displayInfo);
332 
333 /**
334  * @brief Create a primary display.
335  *
336  * @param displayInfo The information of the created display.
337  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
338  *         { @link DISPLAY_MANAGER_ERROR_INVALID_PARAM } If Parameter error.
339  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
340  * @since 14
341  */
342 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreatePrimaryDisplay(
343     NativeDisplayManager_DisplayInfo **displayInfo);
344 
345 /**
346  * @brief callback function type when available area change.
347  *
348  * @param { displayId } changed display id.
349  * @since 20
350  */
351 typedef void (*OH_NativeDisplayManager_AvailableAreaChangeCallback)(uint64_t displayId);
352 
353 /**
354  * @brief Register the callback for display mode change listener.
355  *
356  * @param { availableAreaChangeCallback } Available area change callback.
357  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in register call.
358  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
359  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
360  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
361  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
362  * @since 20
363  */
364 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterAvailableAreaChangeListener(
365     OH_NativeDisplayManager_AvailableAreaChangeCallback availableAreaChangeCallback, uint32_t* listenerIndex);
366 
367 /**
368  * @brief Unregister the callback for display mode change listener.
369  *
370  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
371  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
372  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
373  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
374  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
375  * @since 20
376  */
377 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterAvailableAreaChangeListener(uint32_t listenerIndex);
378 
379 /**
380  * @brief create available area.
381  *
382  * @param { displayid } displayid.
383  * @param { **availableArea } Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object.
384  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
385  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
386   *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
387  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
388  * @since 20
389  */
390 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_CreateAvailableArea(
391     uint64_t displayId, NativeDisplayManager_Rect** availableArea);
392 
393 /**
394  * @brief destroy available area.
395  *
396  * @param { displayid } displayid.
397  * @param { *availableArea } Indicates the pointer to an <b>NativeDisplayManager_Rect</b> object.
398  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
399  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
400  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
401  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
402  * @since 20
403  */
404 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_DestroyAvailableArea(NativeDisplayManager_Rect* availableArea);
405 
406 /**
407  * @brief callback function type when display add.
408  *
409  * @param { displayId } change display id.
410  * @since 20
411  */
412 typedef void (*OH_NativeDisplayManager_DisplayAddCallback)(uint64_t displayId);
413 
414 /**
415  * @brief Register the callback for display add listener.
416  *
417  * @param { displayAddCallback } display add callback.
418  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object.
419  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
420  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
421  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
422  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
423  * @since 20
424  */
425 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayAddListener(
426     OH_NativeDisplayManager_DisplayAddCallback displayAddCallback, uint32_t* listenerIndex);
427 
428 /**
429  * @brief Unregister the callback for display add listener.
430  *
431  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
432  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
433  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
434  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
435  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
436  * @since 20
437  */
438 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayAddListener(uint32_t listenerIndex);
439 
440 /**
441  * @brief callback function type when display remove.
442  *
443  * @param { displayId } changed display id.
444  * @since 20
445  */
446 typedef void (*OH_NativeDisplayManager_DisplayRemoveCallback)(uint64_t displayId);
447 
448 /**
449  * @brief Register the callback for display remove listener.
450  *
451  * @param { displayremoveCallback } display remove callback.
452  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object.
453  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
454  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
455  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
456  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
457  * @since 20
458  */
459 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_RegisterDisplayRemoveListener(
460     OH_NativeDisplayManager_DisplayRemoveCallback displayRemoveCallback, uint32_t* listenerIndex);
461 
462 /**
463  * @brief Unregister the callback for display remove listener.
464  *
465  * @param { *listenerIndex } Indicates the pointer to an <b>uint32_t</b> object. used in unregister call.
466  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
467  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
468  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
469  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
470  * @since 20
471  */
472 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_UnregisterDisplayRemoveListener(uint32_t listenerIndex);
473 
474 /**
475  * @brief get the source mode of the device.
476  *
477  * @param { displayid } displayid.
478  * @param { *sourceMode } Indicates the pointer to an <b>NativeDisplayManager_SourceMode</b> object.
479  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
480  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
481  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
482  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
483  * @since 20
484  */
485 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplaySourceMode(
486     uint64_t displayId, NativeDisplayManager_SourceMode* sourceMode);
487 
488 /**
489  * @brief get the position  of the device.
490  *
491  * @param { displayid } displayid.
492  * @param { x } The x-coordinate of the screen's top-left corner relative to the primary screen's origin (in px).
493  * @param { y } The y-coordinate of the screen's top-left corner relative to the primary screen's origin (in py).
494  * @return { @link DISPLAY_MANAGER_OK } If the operation is successful.
495  *         { @link DISPLAY_MANAGER_ERROR_ILLEGAL_PARAM } If Parameter illegal.
496  *         { @link DISPLAY_MANAGER_ERROR_DEVICE_NOT_SUPPORT } device not support.
497  *         { @link DISPLAY_MANAGER_ERROR_SYSTEM_ABNORMAL } If display manager service works abnormally.
498  * @since 20
499  */
500 NativeDisplayManager_ErrorCode OH_NativeDisplayManager_GetDisplayPosition(uint64_t displayId, int32_t* x, int32_t* y);
501 
502 #ifdef __cplusplus
503 }
504 #endif
505 /** @} */
506 #endif // OH_NATIVE_DISPLAY_MANAGER_H
507