soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SWndContainer-i.h
Go to the documentation of this file.
1/**
2 * Copyright (C) 2014-2050
3 * All rights reserved.
4 *
5 * @file SwndContainer-i.h
6 * @brief
7 * @version v1.0
8 * @author SOUI group
9 * @date 2014/08/02
10 *
11 * Describe DUI窗口容器接口
12 */
13
14#ifndef __SWNDCONTAINER_I__H__
15#define __SWNDCONTAINER_I__H__
16
17#include <core/SDefine.h>
18#include <interface/SEvtArgs-i.h>
19#include <interface/SMsgLoop-i.h>
21#include <interface/scaret-i.h>
22#include <interface/STimelineHandler-i.h>
23#include <interface/SAccelerator-i.h>
24
25SNSBEGIN
26
27enum
28{
29 ZORDER_MIN = 0, /**< Minimum Z-Order */
30 ZORDER_MAX = (UINT)-1, /**< Maximum Z-Order */
31};
32
33typedef enum GrtFlag
34{
35 GRT_NODRAW = 0, /**< No drawing */
36 GRT_PAINTBKGND, /**< Paint background */
37 GRT_OFFSCREEN, /**< Offscreen drawing */
38} GrtFlag;
39
40/**
41 * @struct ISwndContainer
42 * @brief SOUI Window Container Interface
43 *
44 * This interface defines the methods for managing a window container in SOUI.
45 */
46
47typedef struct IRegionS IRegionS;
48
49#undef INTERFACE
50#define INTERFACE ISwndContainer
51DECLARE_INTERFACE_(ISwndContainer, ITimelineHandlersMgr)
52{
53 /**
54 * @brief Registers an animation frame handler.
55 * @param pHandler Pointer to the ITimelineHandler interface.
56 * @return TRUE if successful.
57 */
58 STDMETHOD_(BOOL, RegisterTimelineHandler)(THIS_ ITimelineHandler * pHandler) PURE;
59
60 /**
61 * @brief Unregisters an animation frame handler.
62 * @param pHandler Pointer to the ITimelineHandler interface.
63 * @return TRUE if successful.
64 */
65 STDMETHOD_(BOOL, UnregisterTimelineHandler)(THIS_ ITimelineHandler * pHandler) PURE;
66
67 /**
68 * @brief Registers an IDropTarget with a Swnd.
69 * @param swnd Handle to the target window.
70 * @param pDropTarget Pointer to the IDropTarget interface.
71 * @return TRUE if successful.
72 */
73 STDMETHOD_(BOOL, RegisterDragDrop)(THIS_ SWND swnd, IDropTarget * pDropTarget) PURE;
74
75 /**
76 * @brief Unregisters an IDropTarget from a Swnd.
77 * @param swnd Handle to the target window.
78 * @return TRUE if successful.
79 */
80 STDMETHOD_(BOOL, UnregisterDragDrop)(THIS_ SWND swnd) PURE;
81
82 /**
83 * @brief Fires an event.
84 * @param evt Pointer to the IEvtArgs event.
85 * @return TRUE if the event was handled.
86 */
87 STDMETHOD_(BOOL, OnFireEvent)(THIS_ IEvtArgs * evt) PURE;
88
89 /**
90 * @brief Retrieves the current message loop.
91 * @return Pointer to the IMessageLoop interface.
92 */
93 STDMETHOD_(IMessageLoop *, GetMsgLoop)(THIS) PURE;
94
95 /**
96 * @brief Retrieves the script module.
97 * @return Pointer to the IScriptModule interface.
98 */
99 STDMETHOD_(IScriptModule *, GetScriptModule)(THIS) PURE;
100
101 /**
102 * @brief Retrieves the handle to the host window.
103 * @return Handle to the host window (HWND).
104 */
105 STDMETHOD_(HWND, GetHostHwnd)(THIS) PURE;
106
107 /**
108 * @brief Checks if the host window is translucent.
109 * @return TRUE if the host window is translucent.
110 */
111 STDMETHOD_(BOOL, IsTranslucent)(CTHIS) SCONST PURE;
112
113 /**
114 * @brief Checks if mouseWheel messages are sent to the hover window.
115 * @return TRUE if mouseWheel messages are sent to the hover window, FALSE if sent to the focus window.
116 */
117 STDMETHOD_(BOOL, IsSendWheel2Hover)(CTHIS) SCONST PURE;
118
119 /**
120 * @brief Retrieves the current DPI scale factor.
121 * @return The scale factor.
122 */
123 STDMETHOD_(int, GetScale)(CTHIS) SCONST PURE;
124
125 /**
126 * @brief Retrieves the translation context.
127 * @return The translation context.
128 */
129 STDMETHOD_(LPCWSTR, GetTranslatorContext)(CTHIS) SCONST PURE;
130
131 /**
132 * @brief Retrieves the container's display rectangle.
133 * @param ret Pointer to the RECT structure to receive the container's display rectangle.
134 * @return void
135 */
136 STDMETHOD_(void, GetContainerRect)(CTHIS_ RECT * ret) SCONST PURE;
137
138 /**
139 * @brief Updates the specified region of the memory bitmap.
140 * @param rgn Pointer to the IRegionS region to update.
141 * @return void
142 */
143 STDMETHOD_(void, UpdateRegion)(THIS_ IRegionS * rgn) PURE;
144
145 /**
146 * @brief Requests a redraw of the specified area.
147 * @param rc Pointer to the LPCRECT structure defining the area to redraw.
148 * @param bClip TRUE if the area should be clipped.
149 * @return void
150 */
151 STDMETHOD_(void, OnRedraw)(THIS_ LPCRECT rc, BOOL bClip) PURE;
152
153 /**
154 * @brief Retrieves the Swnd object that has captured the mouse.
155 * @return Handle to the Swnd object that has captured the mouse.
156 */
157 STDMETHOD_(SWND, OnGetSwndCapture)(CTHIS) SCONST PURE;
158
159 /**
160 * @brief Sets the Swnd object to capture the mouse.
161 * @param swnd Handle to the Swnd object to capture the mouse.
162 * @return Handle to the previous Swnd object that had capture.
163 */
164 STDMETHOD_(SWND, OnSetSwndCapture)(THIS_ SWND swnd) PURE;
165
166 /**
167 * @brief Releases the mouse capture from the Swnd object.
168 * @return TRUE if successful.
169 */
170 STDMETHOD_(BOOL, OnReleaseSwndCapture)(THIS) PURE;
171
172 /**
173 * @brief Retrieves the Swnd object that is hovered over.
174 * @return Handle to the Swnd object that is hovered over.
175 */
176 STDMETHOD_(SWND, GetHover)(CTHIS) SCONST PURE;
177
178 /**
179 * @brief Retrieves the Swnd object that has focus.
180 * @return Handle to the Swnd object that has focus.
181 */
182 STDMETHOD_(SWND, GetFocus)(CTHIS) SCONST PURE;
183
184 /**
185 * @brief Sets the focus to the specified Swnd object.
186 * @param swnd Handle to the Swnd object to set focus to.
187 * @return void
188 */
189 STDMETHOD_(void, OnSetSwndFocus)(THIS_ SWND swnd) PURE;
190
191 /**
192 * @brief Requests an immediate update of the window.
193 * @param bForce TRUE to force a refresh, FALSE to refresh only if there are invalid regions.
194 * @return TRUE if successful.
195 */
196 STDMETHOD_(BOOL, UpdateWindow)(THIS_ BOOL bForce DEF_VAL(TRUE)) PURE;
197
198 /**
199 * @brief Requests an update of the tooltip.
200 * @return void
201 */
202 STDMETHOD_(void, UpdateTooltip)(THIS) PURE;
203
204 /**
205 * @brief Displays a tooltip at the specified position.
206 * @param rc Pointer to the LPCRECT structure defining the position of the tooltip relative to the container.
207 * @param tipAlign Alignment flags for the tooltip.
208 * @param pszTip Content of the tooltip, set to NULL to exit a fixed tooltip.
209 * @return void
210 */
211 STDMETHOD_(void, SetToolTip)(THIS_ LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) PURE;
212
213 /**
214 * @brief Converts the rectangle coordinates of the current frame to the final host coordinates.
215 * @param rc Pointer to the RECT structure containing the rectangle to convert.
216 * @return void
217 */
218 STDMETHOD_(void, FrameToHost)(CTHIS_ RECT * rc) SCONST PURE;
219
220 /**
221 * @brief Retrieves the accelerator manager.
222 * @return Pointer to the IAcceleratorMgr interface.
223 */
224 STDMETHOD_(IAcceleratorMgr *, GetAcceleratorMgr)(THIS) PURE;
225
226 /**
227 * @brief Registers a Swnd as a TrackMouseEvent window.
228 * @param swnd Handle to the target window.
229 * @return TRUE if successful.
230 * @remark After registration, the Swnd can capture hover and leave messages even if it is obscured by other windows.
231 */
232 STDMETHOD_(BOOL, RegisterTrackMouseEvent)(THIS_ SWND swnd) PURE;
233
234 /**
235 * @brief Unregisters a Swnd as a TrackMouseEvent window.
236 * @param swnd Handle to the target window.
237 * @return TRUE if successful.
238 * @remark After registration, the Swnd can capture hover and leave messages even if it is obscured by other windows.
239 */
240 STDMETHOD_(BOOL, UnregisterTrackMouseEvent)(THIS_ SWND swnd) PURE;
241
242 /**
243 * @brief Marks the window tree's z-order as dirty.
244 * @return void
245 */
246 STDMETHOD_(void, MarkWndTreeZorderDirty)(THIS) PURE;
247
248 /**
249 * @brief Rebuilds the window tree's z-order.
250 * @return void
251 */
252 STDMETHOD_(void, BuildWndTreeZorder)(THIS) PURE;
253
254 /**
255 * @brief Enables or disables the input method editor (IME).
256 * @param bEnable TRUE to enable IME, FALSE to disable.
257 * @return void
258 */
259 STDMETHOD_(void, EnableIME)(THIS_ BOOL bEnable) PURE;
260
261 /**
262 * @brief Updates the cursor.
263 * @return void
264 */
265 STDMETHOD_(void, OnUpdateCursor)(THIS) PURE;
266
267 /**
268 * @brief Registers a VideoCanvas window.
269 * @param swnd Handle to the VideoCanvas window.
270 * @return TRUE if successful.
271 */
272 STDMETHOD_(BOOL, RegisterVideoCanvas)(THIS_ SWND swnd) PURE;
273
274 /**
275 * @brief Unregisters a VideoCanvas window.
276 * @param swnd Handle to the VideoCanvas window.
277 * @return TRUE if successful.
278 */
279 STDMETHOD_(BOOL, UnregisterVideoCanvas)(THIS_ SWND swnd) PURE;
280
281 /**
282 * @brief Enables or disables the host's private UI definitions.
283 * @param bEnable TRUE to enable, FALSE to disable.
284 * @return void
285 */
286 STDMETHOD_(void, EnableHostPrivateUiDef)(THIS_ BOOL bEnable) PURE;
287
288 /**
289 * @brief Posts a task to the message queue.
290 * @param runable Pointer to the IRunnable task object.
291 * @param bAsync TRUE to execute asynchronously, FALSE to execute synchronously.
292 * @return TRUE if successful.
293 */
294 STDMETHOD_(BOOL, PostTask)(THIS_ IRunnable * runable, BOOL bAsync DEF_VAL(TRUE)) PURE;
295
296 /**
297 * @brief Removes all tasks associated with an object.
298 * @param pObj Pointer to the object.
299 * @return The number of tasks removed.
300 */
301 STDMETHOD_(int, RemoveTasksForObject)(THIS_ void *pObj) PURE;
302};
303
304SNSEND
305
306#endif // __SWNDCONTAINER_I__H__
GrtFlag
@ GRT_OFFSCREEN
@ GRT_PAINTBKGND
@ GRT_NODRAW
@ ZORDER_MIN
@ ZORDER_MAX
Interface for managing accelerator keys.
Interface for message loops.
Definition SMsgLoop-i.h:42
Region object interface.
Definition SRender-i.h:792
SOUI Window Container Interface.
void OnSetSwndFocus(SWND swnd) PURE
Sets the focus to the specified Swnd object.
BOOL RegisterDragDrop(SWND swnd, IDropTarget *pDropTarget) PURE
Registers an IDropTarget with a Swnd.
BOOL RegisterVideoCanvas(SWND swnd) PURE
Registers a VideoCanvas window.
HWND GetHostHwnd() PURE
Retrieves the handle to the host window.
SWND GetHover() SCONST PURE
Retrieves the Swnd object that is hovered over.
void FrameToHost(RECT *rc) SCONST PURE
Converts the rectangle coordinates of the current frame to the final host coordinates.
void SetToolTip(LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) PURE
Displays a tooltip at the specified position.
IScriptModule * GetScriptModule() PURE
Retrieves the script module.
void BuildWndTreeZorder() PURE
Rebuilds the window tree's z-order.
BOOL RegisterTimelineHandler(ITimelineHandler *pHandler) PURE
Registers an animation frame handler.
SWND GetFocus() SCONST PURE
Retrieves the Swnd object that has focus.
void GetContainerRect(RECT *ret) SCONST PURE
Retrieves the container's display rectangle.
BOOL OnReleaseSwndCapture() PURE
Releases the mouse capture from the Swnd object.
BOOL PostTask(IRunnable *runable, BOOL bAsync=TRUE) PURE
Posts a task to the message queue.
IAcceleratorMgr * GetAcceleratorMgr() PURE
Retrieves the accelerator manager.
void MarkWndTreeZorderDirty() PURE
Marks the window tree's z-order as dirty.
void OnUpdateCursor() PURE
Updates the cursor.
IMessageLoop * GetMsgLoop() PURE
Retrieves the current message loop.
BOOL UnregisterTrackMouseEvent(SWND swnd) PURE
Unregisters a Swnd as a TrackMouseEvent window.
void EnableHostPrivateUiDef(BOOL bEnable) PURE
Enables or disables the host's private UI definitions.
void UpdateTooltip() PURE
Requests an update of the tooltip.
LPCWSTR GetTranslatorContext() SCONST PURE
Retrieves the translation context.
SWND OnGetSwndCapture() SCONST PURE
Retrieves the Swnd object that has captured the mouse.
BOOL OnFireEvent(IEvtArgs *evt) PURE
Fires an event.
int RemoveTasksForObject(void *pObj) PURE
Removes all tasks associated with an object.
BOOL UnregisterTimelineHandler(ITimelineHandler *pHandler) PURE
Unregisters an animation frame handler.
void OnRedraw(LPCRECT rc, BOOL bClip) PURE
Requests a redraw of the specified area.
void UpdateRegion(IRegionS *rgn) PURE
Updates the specified region of the memory bitmap.
void EnableIME(BOOL bEnable) PURE
Enables or disables the input method editor (IME).
BOOL UnregisterDragDrop(SWND swnd) PURE
Unregisters an IDropTarget from a Swnd.
BOOL UpdateWindow(BOOL bForce=TRUE) PURE
Requests an immediate update of the window.
BOOL UnregisterVideoCanvas(SWND swnd) PURE
Unregisters a VideoCanvas window.
BOOL IsTranslucent() SCONST PURE
Checks if the host window is translucent.
int GetScale() SCONST PURE
Retrieves the current DPI scale factor.
BOOL IsSendWheel2Hover() SCONST PURE
Checks if mouseWheel messages are sent to the hover window.
BOOL RegisterTrackMouseEvent(SWND swnd) PURE
Registers a Swnd as a TrackMouseEvent window.
SWND OnSetSwndCapture(SWND swnd) PURE
Sets the Swnd object to capture the mouse.
时间轴处理接口