同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Provides window management capabilities, including creating, destroying, showing, hiding, moving, resizing a window, raising a window to the top, and lowering a window to the bottom.
Since:
1.0
Version:
1.0
Declares the Window class that provides a drawing canvas for the RootView, which represents the root node of a view tree. |
Provides a drawing canvas for the RootView, which represents the root node of a view tree. |
OHOS::WindowPixelFormat { OHOS::WINDOW_PIXEL_FORMAT_RGB565 = 101, OHOS::WINDOW_PIXEL_FORMAT_ARGB1555, OHOS::WINDOW_PIXEL_FORMAT_RGB888, OHOS::WINDOW_PIXEL_FORMAT_ARGB8888 } |
OHOS::Window::CreateWindow (const WindowConfig &config) |
static Window * Creates a Window instance. |
OHOS::Window::DestoryWindow (Window *window) |
|
OHOS::Window::BindRootView (RootView *rootView)=0 |
Binds the RootView to this window. |
Unbinds the RootView from this window. |
|
virtual RootView * Obtains the RootView bound to this window. |
|
virtual Rect Obtains the rectangle information (position, width, and height) of this window. |
|
OHOS::Window::Show ()=0 |
|
OHOS::Window::Hide ()=0 |
|
OHOS::Window::MoveTo (int16_t x, int16_t y)=0 |
|
OHOS::Window::Resize (int16_t width, int16_t height)=0 |
|
enum [OHOS::WindowPixelFormat](Window.md#gade9f6a70c1e8547785d266aab3ca5725)
Description:
Enumerates the pixel formats of this window.
WINDOW_PIXEL_FORMAT_RGB565 | |
WINDOW_PIXEL_FORMAT_ARGB1555 | |
WINDOW_PIXEL_FORMAT_RGB888 | |
WINDOW_PIXEL_FORMAT_ARGB8888 |
virtual void OHOS::Window::BindRootView ([RootView](OHOS-RootView.md) * rootView)
Description:
Binds the RootView to this window.
Parameters:
rootView | Indicates the RootView to bind. |
static [Window](OHOS-Window.md)* OHOS::Window::CreateWindow (const [WindowConfig](OHOS-WindowConfig.md) & config)
Description:
Creates a Window instance.
Parameters:
config | Indicates the window configuration. For details, see WindowConfig. |
Returns:
Returns the Window instance if the operation is successful; returns nullptr otherwise.
static void OHOS::Window::DestoryWindow ([Window](OHOS-Window.md) * window)
Description:
Destroys a specified window.
Parameters:
window | Indicates the Window instance to destroy. |
virtual [Rect](OHOS-Rect.md) OHOS::Window::GetRect ()
Description:
Obtains the rectangle information (position, width, and height) of this window.
Returns:
Returns the rectangle information of this window.
virtual [RootView](OHOS-RootView.md)* OHOS::Window::GetRootView ()
Description:
Obtains the RootView bound to this window.
Returns:
Returns the RootView if available; returns nullptr otherwise.
virtual int32_t OHOS::Window::GetWindowId ()
Description:
Obtains the unique ID of this window.
The window ID is within [0, 31]. An ID will be reused after the current window is destroyed. A maximum of 32 windows can be displayed at the same time.
Returns:
Returns the unique ID of this window if the operation is successful; returns -1 otherwise.
virtual void OHOS::Window::Hide ()
Description:
Hides this window.
virtual void OHOS::Window::LowerToBottom ()
Description:
Lowers this window to the bottom.
virtual void OHOS::Window::MoveTo (int16_t x, int16_t y )
Description:
Moves this window to a specified position.
Parameters:
x | Indicates the x-coordinate of the target position. |
y | Indicates the y-coordinate of the target position. |
virtual void OHOS::Window::RaiseToTop ()
Description:
Raises this window to the top.
virtual void OHOS::Window::Resize (int16_t width, int16_t height )
Description:
Resizes this window.
Parameters:
width | Indicates the new window width. |
height | Indicates the new window height. |
virtual void OHOS::Window::Show ()
Description:
Shows this window.
virtual void OHOS::Window::UnbindRootView ()
Description:
Unbinds the RootView from this window.
uint8_t OHOS::WindowConfig::opacity
Description:
Opacity, within [0, 255]
uint32_t OHOS::WindowConfig::option
Description:
Other options
[WindowPixelFormat](Window.md#gade9f6a70c1e8547785d266aab3ca5725) OHOS::WindowConfig::pixelFormat
Description:
Pixel format
[Rect](OHOS-Rect.md) OHOS::WindowConfig::rect
Description:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。