ohos_window_manager_sys/window_comm/
window_comm_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)]
6
7pub type WindowManagerResult = Result<(), WindowManagerErrorCode>;
8#[cfg(feature = "api-12")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
10impl WindowManagerErrorCode {
11    /// No permission.
12    ///
13    ///
14    /// Available since API-level: 15
15    #[cfg(feature = "api-15")]
16    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
17    pub const WINDOW_MANAGER_ERRORCODE_NO_PERMISSION: WindowManagerErrorCode =
18        WindowManagerErrorCode(const { core::num::NonZero::new(201).unwrap() });
19    /// Param is invalid.
20    ///
21    ///
22    /// Available since API-level: 15
23    #[cfg(feature = "api-15")]
24    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
25    pub const WINDOW_MANAGER_ERRORCODE_INVALID_PARAM: WindowManagerErrorCode =
26        WindowManagerErrorCode(const { core::num::NonZero::new(401).unwrap() });
27    /// Device not support.
28    ///
29    ///
30    /// Available since API-level: 15
31    #[cfg(feature = "api-15")]
32    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
33    pub const WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED: WindowManagerErrorCode =
34        WindowManagerErrorCode(const { core::num::NonZero::new(801).unwrap() });
35    /// window id is invaild.
36    pub const INVAILD_WINDOW_ID: WindowManagerErrorCode =
37        WindowManagerErrorCode(const { core::num::NonZero::new(1000).unwrap() });
38    /// failed.
39    pub const SERVICE_ERROR: WindowManagerErrorCode =
40        WindowManagerErrorCode(const { core::num::NonZero::new(2000).unwrap() });
41    /// Window state is abnormal.
42    ///
43    ///
44    /// Available since API-level: 15
45    #[cfg(feature = "api-15")]
46    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
47    pub const WINDOW_MANAGER_ERRORCODE_STATE_ABNORMAL: WindowManagerErrorCode =
48        WindowManagerErrorCode(const { core::num::NonZero::new(1300002).unwrap() });
49    /// Window manager service works abnormally.
50    ///
51    ///
52    /// Available since API-level: 15
53    #[cfg(feature = "api-15")]
54    #[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
55    pub const WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL: WindowManagerErrorCode =
56        WindowManagerErrorCode(const { core::num::NonZero::new(1300003).unwrap() });
57    /// Picture-In-Picture failed to destroy.
58    ///
59    ///
60    /// Available since API-level: 20
61    #[cfg(feature = "api-20")]
62    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
63    pub const WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED: WindowManagerErrorCode =
64        WindowManagerErrorCode(const { core::num::NonZero::new(1300011).unwrap() });
65    /// Picture-In-Picture state is abnormal.
66    ///
67    ///
68    /// Available since API-level: 20
69    #[cfg(feature = "api-20")]
70    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
71    pub const WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL: WindowManagerErrorCode =
72        WindowManagerErrorCode(const { core::num::NonZero::new(1300012).unwrap() });
73    /// Picture-In-Picture failed to create.
74    ///
75    ///
76    /// Available since API-level: 20
77    #[cfg(feature = "api-20")]
78    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
79    pub const WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED: WindowManagerErrorCode =
80        WindowManagerErrorCode(const { core::num::NonZero::new(1300013).unwrap() });
81    /// Picture-In-Picture internal error.
82    ///
83    ///
84    /// Available since API-level: 20
85    #[cfg(feature = "api-20")]
86    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
87    pub const WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR: WindowManagerErrorCode =
88        WindowManagerErrorCode(const { core::num::NonZero::new(1300014).unwrap() });
89    /// Picture-In-Picture repeated operation.
90    ///
91    ///
92    /// Available since API-level: 20
93    #[cfg(feature = "api-20")]
94    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
95    pub const WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION: WindowManagerErrorCode =
96        WindowManagerErrorCode(const { core::num::NonZero::new(1300015).unwrap() });
97    /// Parameter is incorrect.
98    ///
99    /// Available since API-level: 20
100    #[cfg(feature = "api-20")]
101    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
102    pub const WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM: WindowManagerErrorCode =
103        WindowManagerErrorCode(const { core::num::NonZero::new(1300016).unwrap() });
104}
105#[repr(transparent)]
106/// Enumerates the result types of the wm interface
107///
108///
109/// Available since API-level: 12
110#[cfg(feature = "api-12")]
111#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
112#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
113pub struct WindowManagerErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
114#[cfg(feature = "api-15")]
115#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
116impl WindowManager_AvoidAreaType {
117    /// System.
118    pub const SYSTEM: WindowManager_AvoidAreaType = WindowManager_AvoidAreaType(0);
119    /// Cutout.
120    pub const CUTOUT: WindowManager_AvoidAreaType = WindowManager_AvoidAreaType(1);
121    /// System gesture.
122    pub const SYSTEM_GESTURE: WindowManager_AvoidAreaType = WindowManager_AvoidAreaType(2);
123    /// Keyboard.
124    pub const KEYBOARD: WindowManager_AvoidAreaType = WindowManager_AvoidAreaType(3);
125    /// Navigation indicator.
126    pub const NAVIGATION_INDICATOR: WindowManager_AvoidAreaType = WindowManager_AvoidAreaType(4);
127}
128#[repr(transparent)]
129/// Enumerates the avoid area types.
130///
131///
132/// Available since API-level: 15
133#[cfg(feature = "api-15")]
134#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
135#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
136pub struct WindowManager_AvoidAreaType(pub ::core::ffi::c_uint);
137#[cfg(feature = "api-15")]
138#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
139impl WindowManager_WindowType {
140    /// Sub window.
141    pub const APP: WindowManager_WindowType = WindowManager_WindowType(0);
142    /// Main window.
143    pub const MAIN: WindowManager_WindowType = WindowManager_WindowType(1);
144    /// Float.
145    pub const FLOAT: WindowManager_WindowType = WindowManager_WindowType(8);
146    /// Dialog.
147    pub const DIALOG: WindowManager_WindowType = WindowManager_WindowType(16);
148}
149#[repr(transparent)]
150/// The type of a window
151///
152///
153/// Available since API-level: 15
154#[cfg(feature = "api-15")]
155#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
156#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
157pub struct WindowManager_WindowType(pub ::core::ffi::c_uint);
158/// Defines the window rect data structure.
159///
160///
161/// Available since API-level: 15
162#[cfg(feature = "api-15")]
163#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
164#[repr(C)]
165#[derive(Debug, Copy, Clone)]
166pub struct WindowManager_Rect {
167    /// X-axis of the window.
168    pub posX: i32,
169    /// Y-axis of the window.
170    pub posY: i32,
171    /// Width of the window.
172    pub width: u32,
173    /// Height of the window.
174    pub height: u32,
175}
176/// Properties of window
177///
178///
179/// Available since API-level: 15
180#[cfg(feature = "api-15")]
181#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
182#[repr(C)]
183#[derive(Debug, Copy, Clone)]
184pub struct WindowManager_WindowProperties {
185    /// The position and size of the window.
186    pub windowRect: WindowManager_Rect,
187    /// The position relative to the window and size of drawable area.
188    pub drawableRect: WindowManager_Rect,
189    /// Window type.
190    pub type_: WindowManager_WindowType,
191    /// Whether the window is displayed in full screen mode. The default value is false.
192    pub isFullScreen: bool,
193    /// Whether the window layout is full screen mode. The default value is false.
194    pub isLayoutFullScreen: bool,
195    /// Whether the window can gain focus. The default value is true.
196    pub focusable: bool,
197    /// Whether the window is touchable. The default value is false.
198    pub touchable: bool,
199    /// Brightness value of window.
200    pub brightness: f32,
201    /// Whether keep screen on.
202    pub isKeepScreenOn: bool,
203    /// Whether make window in privacy mode or not.
204    pub isPrivacyMode: bool,
205    /// Whether is transparent or not.
206    pub isTransparent: bool,
207    /// Window id.
208    pub id: u32,
209    /// Display id.
210    pub displayId: u32,
211}
212/// Defines the avoid area data structure.
213///
214///
215/// Available since API-level: 15
216#[cfg(feature = "api-15")]
217#[cfg_attr(docsrs, doc(cfg(feature = "api-15")))]
218#[repr(C)]
219#[derive(Debug, Copy, Clone)]
220pub struct WindowManager_AvoidArea {
221    /// Top rect of the avoid area.
222    pub topRect: WindowManager_Rect,
223    /// Left rect of the avoid area.
224    pub leftRect: WindowManager_Rect,
225    /// Right rect of the avoid area.
226    pub rightRect: WindowManager_Rect,
227    /// Bottom rect of the avoid area.
228    pub bottomRect: WindowManager_Rect,
229}
230/// Main window info
231///
232///
233/// Available since API-level: 21
234#[cfg(feature = "api-21")]
235#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
236#[repr(C)]
237#[derive(Debug, Copy, Clone)]
238pub struct WindowManager_MainWindowInfo {
239    /// Display id of the window.
240    pub displayId: u64,
241    /// Window id.
242    pub windowId: i32,
243    /// Showing state of the window.
244    pub showing: bool,
245    /// Label of the window.
246    pub label: *const ::core::ffi::c_char,
247}
248/// Window snapshot config info
249///
250///
251/// Available since API-level: 21
252#[cfg(feature = "api-21")]
253#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
254#[repr(C)]
255#[derive(Debug, Copy, Clone)]
256pub struct WindowManager_WindowSnapshotConfig {
257    /// Use cached windows' snapshot.
258    pub useCache: bool,
259}