• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 /**
17  * @addtogroup OH_PictureInPicture
18  * @{
19  *
20  * @file oh_window_pip.h
21  *
22  * @brief Declares C APIs for picture in picture window
23  *
24  * @kit ArkUI
25  * @library libnative_window_manager.so
26  * @syscap SystemCapability.Window.SessionManager
27  * @since 20
28  * @version 1.0
29  */
30 #ifndef OH_WINDOW_PIP_H
31 #define OH_WINDOW_PIP_H
32 
33 #include "stdint.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /**
40  * @brief Picture in picture config.
41  * @since 20
42  */
43 typedef void* PictureInPicture_PipConfig;
44 
45 /**
46  * @brief Enumerates picture in picture template type.
47  * @since 20
48  */
49 typedef enum {
50     /** Video play. */
51     VIDEO_PLAY = 0,
52     /** Video call. */
53     VIDEO_CALL = 1,
54     /** Video meeting. */
55     VIDEO_MEETING = 2,
56     /** Video live. */
57     VIDEO_LIVE = 3,
58 } PictureInPicture_PipTemplateType;
59 
60 /**
61  * @brief Enumerates picture in picture control group.
62  * @since 20
63  */
64 typedef enum {
65     /** Previous/next control group for video play. */
66     VIDEO_PLAY_VIDEO_PREVIOUS_NEXT = 101,
67     /** Fast forward/backward control group for video play. */
68     VIDEO_PLAY_FAST_FORWARD_BACKWARD = 102,
69     /** Switch on/off the microphone control group for video call. */
70     VIDEO_CALL_MICROPHONE_SWITCH = 201,
71     /** Hang up control group for video call. */
72     VIDEO_CALL_HANG_UP_BUTTON = 202,
73     /** Switch on/off the camera control group for video call. */
74     VIDEO_CALL_CAMERA_SWITCH = 203,
75     /** Mute control group for video call. */
76     VIDEO_CALL_MUTE_SWITCH = 204,
77     /** Hang up control group for video meeting. */
78     VIDEO_MEETING_HANG_UP_BUTTON = 301,
79     /** Switch on/off the camera control group for video meeting. */
80     VIDEO_MEETING_CAMERA_SWITCH = 302,
81     /** Mute control group for video meeting. */
82     VIDEO_MEETING_MUTE_SWITCH = 303,
83     /** Switch on/off the microphone control group for video meeting. */
84     VIDEO_MEETING_MICROPHONE_SWITCH = 304,
85     /** Video play/pause control group for video live. */
86     VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401,
87     /** Mute control group for video live. */
88     VIDEO_LIVE_MUTE_SWITCH = 402,
89 } PictureInPicture_PipControlGroup;
90 
91 /**
92  * @brief Enumerates picture in picture control type.
93  * @since 20
94  */
95 typedef enum {
96     /** Video play/pause. */
97     VIDEO_PLAY_PAUSE = 0,
98     /** Video previous. */
99     VIDEO_PREVIOUS = 1,
100     /** Video next. */
101     VIDEO_NEXT = 2,
102     /** Video fast forward. */
103     FAST_FORWARD = 3,
104     /** Video back forward. */
105     FAST_BACKWARD = 4,
106     /** Hang up. */
107     HANG_UP_BUTTON = 5,
108     /** Microphone switch. */
109     MICROPHONE_SWITCH = 6,
110     /** camera switch. */
111     CAMERA_SWITCH = 7,
112     /** mute switch. */
113     MUTE_SWITCH = 8,
114 } PictureInPicture_PipControlType;
115 
116 /**
117  * @brief Enumerates picture in picture control status.
118  * @since 20
119  */
120 typedef enum {
121     /** Play. */
122     PLAY = 1,
123     /** Pause. */
124     PAUSE = 0,
125     /** Open. */
126     OPEN = 1,
127     /** Close. */
128     CLOSE = 0,
129 } PictureInPicture_PipControlStatus;
130 
131 /**
132  * @brief Enumerates picture in picture state.
133  * @since 20
134  */
135 typedef enum {
136     /** About to start. */
137     ABOUT_TO_START = 1,
138     /** started. */
139     STARTED = 2,
140     /** About to stop. */
141     ABOUT_TO_STOP = 3,
142     /** stopped. */
143     STOPPED = 4,
144     /** About to restore. */
145     ABOUT_TO_RESTORE = 5,
146     /** Error. */
147     ERROR = 6,
148 } PictureInPicture_PipState;
149 
150 /**
151  * @brief Start the picture-in-picture callback
152  * @param controllerId The picture-in-picture controller ID
153  * @param requestId The picture-in-picture requestId
154  * @param surfaceId The picture-in-picture surfaceId
155  * @since 20
156  */
157 typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, uint64_t surfaceId);
158 
159 /**
160  * @brief The picture-in-picture lifecycle callback
161  * @param controllerId The picture-in-picture controller ID
162  * @param state The picture-in-picture state
163  * @param errcode The picture-in-picture error code
164  * @since 20
165  */
166 typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode);
167 
168 /**
169  * @brief The picture-in-picture control event callback
170  * @param controllerId The picture-in-picture controller ID
171  * @param controlType The picture-in-picture control type
172  * @param status The picture-in-picture control status
173  * @since 20
174  */
175 typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PipControlType controlType,
176     PictureInPicture_PipControlStatus status);
177 
178 /**
179  * @brief The picture-in-picture size change callback
180  * @param controllerId The picture-in-picture controller ID
181  * @param width The picture-in-picture window width
182  * @param height The picture-in-picture window height
183  * @param scale The picture-in-picture window scale
184  * @since 20
185  */
186 typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint32_t height, double scale);
187 
188 /**
189  * @brief Create picture-in-picture config.
190  * @param pipConfig The picture-in-picture config
191  * @return Return the result code.
192  *         {@link OK} the function call is successful.
193  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
194  * @since 20
195  */
196 int32_t OH_PictureInPicture_CreatePipConfig(PictureInPicture_PipConfig* pipConfig);
197 
198 /**
199  * @brief Destroy picture-in-picture config.
200  * @param pipConfig The picture-in-picture config
201  * @return Return the result code.
202  *         {@link OK} the function call is successful.
203  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
204  * @since 20
205  */
206 int32_t OH_PictureInPicture_DestroyPipConfig(PictureInPicture_PipConfig* pipConfig);
207 
208 /**
209  * @brief Set picture-in-picture mainWindowId.
210  *
211  * @param pipConfig The picture-in-picture config
212  * @param mainWindowId WindowId of corresponding mainWindow
213  * @return Return the result code.
214  *         {@link OK} the function call is successful.
215  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
216  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
217  * @since 20
218  */
219 int32_t OH_PictureInPicture_SetPipMainWindowId(PictureInPicture_PipConfig pipConfig, uint32_t mainWindowId);
220 
221 /**
222  * @brief Set picture-in-picture templateType.
223  *
224  * @param pipConfig The picture-in-picture config
225  * @param pipTemplateType The picture-in-picture template type
226  * @return Return the result code.
227  *         {@link OK} the function call is successful.
228  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
229  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
230  * @since 20
231  */
232 int32_t OH_PictureInPicture_SetPipTemplateType(PictureInPicture_PipConfig pipConfig,
233     PictureInPicture_PipTemplateType pipTemplateType);
234 
235 /**
236  * @brief Set picture-in-picture rect.
237  *
238  * @param pipConfig The picture-in-picture config
239  * @param width The picture-in-picture window width
240  * @param height The picture-in-picture window height
241  * @return Return the result code.
242  *         {@link OK} the function call is successful.
243  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
244  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
245  * @since 20
246  */
247 int32_t OH_PictureInPicture_SetPipRect(PictureInPicture_PipConfig pipConfig, uint32_t width, uint32_t height);
248 
249 /**
250  * @brief Set picture-in-picture control group.
251  *
252  * @param pipConfig The picture-in-picture config
253  * @param controlGroup The picture-in-picture control group
254  * @param controlGroupLength The length of picture-in-picture control group
255  * @return Return the result code.
256  *         {@link OK} the function call is successful.
257  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
258  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
259  * @since 20
260  */
261 int32_t OH_PictureInPicture_SetPipControlGroup(PictureInPicture_PipConfig pipConfig,
262     PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength);
263 
264 /**
265  * @brief Set picture-in-picture napi env.
266  *
267  * @param pipConfig The picture-in-picture config
268  * @param env The picture-in-picture napi env
269  * @return Return the result code.
270  *         {@link OK} the function call is successful.
271  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
272  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
273  * @since 20
274  */
275 int32_t OH_PictureInPicture_SetPipNapiEnv(PictureInPicture_PipConfig pipConfig, void* env);
276 
277 /**
278  * @brief Create picture-in-picture controller.
279  * @param pipConfig The picture-in-picture config
280  * @param controllerId The picture-in-picture controller ID
281  * @return Return the result code.
282  *         {@link OK} the function call is successful.
283  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
284  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
285  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
286  * @since 20
287  */
288 int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig pipConfig, uint32_t* controllerId);
289 
290 /**
291  * @brief Delete picture-in-picture controller.
292  *
293  * @param controllerId The picture-in-picture controller ID
294  * @return Return the result code.
295  *         {@link OK} The function call is successful.
296  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
297  * @since 20
298  */
299 int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId);
300 
301 /**
302  * @brief Start picture-in-picture.
303  *
304  * @param controllerId The picture-in-picture controller ID
305  * @return Return the result code.
306  *         {@link OK} the function call is successful.
307  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal.
308  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED} failed to create the PiP window.
309  *         {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
310  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation.
311  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
312  * @since 20
313  */
314 int32_t OH_PictureInPicture_StartPip(uint32_t controllerId);
315 
316 /**
317  * @brief Stop picture-in-picture.
318  *
319  * @param controllerId The picture-in-picture controller ID
320  * @return Return the result code.
321  *         {@link OK} the function call is successful.
322  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED} failed to destroy the PiP window.
323  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal.
324  *         {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
325  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation.
326  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
327  * @since 20
328  */
329 int32_t OH_PictureInPicture_StopPip(uint32_t controllerId);
330 
331 /**
332  * @brief Update picture-in-picture content size.
333  *
334  * @param controllerId The picture-in-picture controller ID
335  * @param width The picture-in-picture content width
336  * @param height The picture-in-picture content height
337  * @return Return the result code.
338  *         {@link OK} the function call is successful.
339  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
340  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
341  * @since 20
342  */
343 int32_t OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t width, uint32_t height);
344 
345 /**
346  * @brief Update picture-in-picture control status.
347  *
348  * @param controllerId The picture-in-picture controller ID
349  * @param controlType The picture-in-picture control type.
350  * @param status The picture-in-picture control status.
351  * @return Return the result code.
352  *         {@link OK} the function call is successful.
353  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
354  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
355  * @since 20
356  */
357 int32_t OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PipControlType controlType,
358     PictureInPicture_PipControlStatus status);
359 
360 /**
361  * @brief Set picture-in-picture controll enable status.
362  *
363  * @param controllerId The picture-in-picture controller ID
364  * @param controlType The picture-in-picture control type.
365  * @param enabled Indicate the picture-in-picture control is enabled.
366  * @return Return the result code.
367  *         {@link OK} the function call is successful.
368  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
369  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
370  * @since 20
371  */
372 int32_t OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType,
373     bool enabled);
374 
375 /**
376  * @brief Set picture-in-picture initial surface rect.
377  *
378  * @param controllerId The picture-in-picture controller ID
379  * @param positionX The X position of the first frame when start the picture-in-picture.
380  * @param positionY The Y position of the first frame when start the picture-in-picture.
381  * @param width The width of the first frame when start the picture-in-picture.
382  * @param height The height of the first frame when start the picture-in-picture.
383  * @return Return the result code.
384  *         {@link OK} the function call is successful.
385  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
386  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
387  * @since 20
388  */
389 int32_t OH_PictureInPicture_SetPipInitialSurfaceRect(uint32_t controllerId, int32_t positionX, int32_t positionY,
390     uint32_t width, uint32_t height);
391 
392 /**
393  * @brief Unset picture-in-picture initial surface rect.
394  *
395  * @param controllerId The picture-in-picture controller ID
396  * @return Return the result code.
397  *         {@link OK} the function call is successful.
398  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
399  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
400  * @since 20
401  */
402 int32_t OH_PictureInPicture_UnsetPipInitialSurfaceRect(uint32_t controllerId);
403 
404 /**
405  * @brief Register picture-in-picture controller start callback.
406  *
407  * @param controllerId The picture-in-picture controller ID
408  * @param callback Start the picture-in-picture callback
409  * @return Return the result code.
410  *         {@link OK} the function call is successful.
411  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
412  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
413  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
414  * @since 20
415  */
416 int32_t OH_PictureInPicture_RegisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback);
417 
418 /**
419  * @brief Unregister picture-in-picture controller start callback.
420  *
421  * @param controllerId The picture-in-picture controller ID
422  * @param callback Start the picture-in-picture callback
423  * @return Return the result code.
424  *         {@link OK} the function call is successful.
425  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
426  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
427  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
428  * @since 20
429  */
430 int32_t OH_PictureInPicture_UnregisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback);
431 
432 /**
433  * @brief Unregister all picture-in-picture controller start callbacks.
434  *
435  * @param controllerId The picture-in-picture controller ID
436  * @return Return the result code.
437  *         {@link OK} the function call is successful.
438  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
439  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
440  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
441  * @since 20
442  */
443 int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId);
444 
445 /**
446  * @brief Register picture-in-picture lifecycle listener callback.
447  *
448  * @param controllerId The picture-in-picture controller ID
449  * @param callback The picture-in-picture lifecycle callback.
450  * @return Return the result code.
451  *         {@link OK} the function call is successful.
452  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
453  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
454  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
455  * @since 20
456  */
457 int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback);
458 
459 /**
460  * @brief Unregister picture-in-picture lifecycle listener callback.
461  *
462  * @param controllerId The picture-in-picture controller ID
463  * @param callback The picture-in-picture lifecycle callback.
464  * @return Return the result code.
465  *         {@link OK} the function call is successful.
466  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
467  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
468  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
469  * @since 20
470  */
471 int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback);
472 
473 /**
474  * @brief Unregister all picture-in-picture lifecycle listener callbacks.
475  *
476  * @param controllerId The picture-in-picture controller ID
477  * @return Return the result code.
478  *         {@link OK} the function call is successful.
479  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
480  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
481  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
482  * @since 20
483  */
484 int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId);
485 
486 /**
487  * @brief Register picture-in-picture control event listener callback.
488  *
489  * @param controllerId The picture-in-picture controller ID
490  * @param callback The picture-in-picture control event callback.
491  * @return Return the result code.
492  *         {@link OK} the function call is successful.
493  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
494  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
495  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
496  * @since 20
497  */
498 int32_t OH_PictureInPicture_RegisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback);
499 
500 /**
501  * @brief Unregister picture-in-picture control event listener callback.
502  *
503  * @param controllerId The picture-in-picture controller ID
504  * @param callback The picture-in-picture control event callback.
505  * @return Return the result code.
506  *         {@link OK} the function call is successful.
507  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
508  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
509  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
510  * @since 20
511  */
512 int32_t OH_PictureInPicture_UnregisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback);
513 
514 /**
515  * @brief Unregister all picture-in-picture control event listener callbacks.
516  *
517  * @param controllerId The picture-in-picture controller ID
518  * @return Return the result code.
519  *         {@link OK} the function call is successful.
520  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
521  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
522  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
523  * @since 20
524  */
525 int32_t OH_PictureInPicture_UnregisterAllControlEventListeners(uint32_t controllerId);
526 
527 /**
528  * @brief Register picture-in-picture resize listener callback.
529  *
530  * @param controllerId The picture-in-picture controller ID
531  * @param callback The picture-in-picture size change callback.
532  * @return Return the result code.
533  *         {@link OK} the function call is successful.
534  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
535  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
536  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
537  * @since 20
538  */
539 int32_t OH_PictureInPicture_RegisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback);
540 
541 /**
542  * @brief Unregister picture-in-picture resize listener callback.
543  *
544  * @param controllerId The picture-in-picture controller ID
545  * @param callback The picture-in-picture size change callback.
546  * @return Return the result code.
547  *         {@link OK} the function call is successful.
548  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
549  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
550  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
551  * @since 20
552  */
553 int32_t OH_PictureInPicture_UnregisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback);
554 
555 /**
556  * @brief Unregister all picture-in-picture resize listener callbacks.
557  *
558  * @param controllerId The picture-in-picture controller ID
559  * @return Return the result code.
560  *         {@link OK} the function call is successful.
561  *         {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error.
562  *         {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported.
563  *         {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error.
564  * @since 20
565  */
566 int32_t OH_PictureInPicture_UnregisterAllResizeListeners(uint32_t controllerId);
567 
568 #ifdef __cplusplus
569 }
570 #endif
571 
572 #endif // OH_WINDOW_PIP_H
573 /** @} */