1#ifndef __SHOSTWNDPROXY__H__
2#define __SHOSTWNDPROXY__H__
12 THostWndProxy(LPCWSTR pszResId)
16 THostWndProxy(LPCSTR pszResId)
22 STDMETHOD_(
long, AddRef)(THIS)
26 STDMETHOD_(
long, Release)(THIS)
30 STDMETHOD_(
void, OnFinalRelease)(THIS)
34 STDMETHOD_(
int, GetID)(THIS) SCONST
38 STDMETHOD_(
void, SetID)(THIS_
int nID)
43 STDMETHOD_(HWND, CreateNative)
44 (THIS_ LPCTSTR lpWindowName,
53 LPVOID lpParam) OVERRIDE
56 hWndParent, nID, lpParam);
59 STDMETHOD_(HWND, GetHwnd)(THIS) OVERRIDE
64 STDMETHOD_(BOOL, SubclassWindow)(THIS_ HWND hWnd) OVERRIDE
68 STDMETHOD_(HWND, UnsubclassWindow)(THIS_ BOOL bForce = FALSE) OVERRIDE
72 STDMETHOD_(
const MSG *, GetCurrentMessage)(THIS) SCONST OVERRIDE
76 STDMETHOD_(
int, GetDlgCtrlID)(THIS) SCONST OVERRIDE
80 STDMETHOD_(DWORD, GetStyle)(THIS) SCONST OVERRIDE
84 STDMETHOD_(DWORD, GetExStyle)(THIS) SCONST OVERRIDE
88 STDMETHOD_(LONG_PTR, GetWindowLongPtr)(THIS_
int nIndex) SCONST OVERRIDE
92 STDMETHOD_(LONG_PTR, SetWindowLongPtr)(THIS_
int nIndex, LONG_PTR dwNewLong) OVERRIDE
96 STDMETHOD_(HWND, GetParent)(THIS) OVERRIDE
100 STDMETHOD_(HWND, SetParent)(THIS_ HWND hWndNewParent) OVERRIDE
104 STDMETHOD_(BOOL, IsWindowEnabled)(THIS) SCONST OVERRIDE
108 STDMETHOD_(BOOL, ModifyStyle)(THIS_ DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0) OVERRIDE
112 STDMETHOD_(BOOL, ModifyStyleEx)(THIS_ DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0) OVERRIDE
116 STDMETHOD_(BOOL, SetWindowPos)
117 (THIS_ HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy, UINT nFlags) OVERRIDE
121 STDMETHOD_(BOOL, CenterWindow)(THIS_ HWND hWndCenter = NULL) OVERRIDE
125 STDMETHOD_(BOOL, DestroyWindow)(THIS) OVERRIDE
129 STDMETHOD_(BOOL, IsWindow)(CTHIS) SCONST OVERRIDE
133 STDMETHOD_(BOOL, Invalidate)(THIS_ BOOL bErase = TRUE) OVERRIDE
137 STDMETHOD_(BOOL, InvalidateRect)(THIS_ LPCRECT lpRect, BOOL bErase = TRUE) OVERRIDE
141 STDMETHOD_(BOOL, GetWindowRect)(THIS_ LPRECT lpRect) SCONST OVERRIDE
145 STDMETHOD_(BOOL, GetClientRect)(THIS_ LPRECT lpRect) SCONST OVERRIDE
149 STDMETHOD_(BOOL, ClientToScreen)(THIS_ LPPOINT lpPoint) SCONST OVERRIDE
153 STDMETHOD_(BOOL, ClientToScreen2)(THIS_ LPRECT lpRect) SCONST OVERRIDE
157 STDMETHOD_(BOOL, ScreenToClient)(THIS_ LPPOINT lpPoint) SCONST OVERRIDE
161 STDMETHOD_(BOOL, ScreenToClient2)(THIS_ LPRECT lpRect) SCONST OVERRIDE
165 STDMETHOD_(
int, MapWindowPoints)
166 (THIS_ HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
170 STDMETHOD_(
int, MapWindowRect)(THIS_ HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
174 STDMETHOD_(UINT_PTR, SetTimer)
175 (THIS_ UINT_PTR nIDEvent,
177 void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD) = NULL) OVERRIDE
181 STDMETHOD_(BOOL, KillTimer)(THIS_ UINT_PTR nIDEvent) OVERRIDE
185 STDMETHOD_(HDC, GetDC)(THIS) OVERRIDE
189 STDMETHOD_(HDC, GetWindowDC)(THIS) OVERRIDE
193 STDMETHOD_(
int, ReleaseDC)(THIS_ HDC hDC) OVERRIDE
197 STDMETHOD_(BOOL, CreateCaret)(THIS_ HBITMAP hBitmap,
int nWidth,
int nHeight) OVERRIDE
201 STDMETHOD_(BOOL, HideCaret)(THIS) OVERRIDE
205 STDMETHOD_(BOOL, ShowCaret)(THIS) OVERRIDE
209 STDMETHOD_(HWND, SetCapture)(THIS) OVERRIDE
214 STDMETHOD_(HWND, GetCapture)(THIS) OVERRIDE
219 STDMETHOD_(BOOL, ReleaseCapture)(THIS) OVERRIDE
224 STDMETHOD_(HWND, SetFocus)(THIS) OVERRIDE
228 STDMETHOD_(LRESULT, SendMessage)
229 (THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
233 STDMETHOD_(BOOL, PostMessage)(THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
237 STDMETHOD_(BOOL, SendNotifyMessage)
238 (THIS_ UINT message, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE
242 STDMETHOD_(BOOL, SetWindowText)(THIS_ LPCTSTR lpszString) OVERRIDE
246 STDMETHOD_(
int, GetWindowText)(THIS_ LPTSTR lpszStringBuf,
int nMaxCount) SCONST OVERRIDE
250 STDMETHOD_(BOOL, IsIconic)(THIS) SCONST OVERRIDE
254 STDMETHOD_(BOOL, IsZoomed)(THIS) SCONST OVERRIDE
258 STDMETHOD_(BOOL, IsWindowVisible)(THIS) SCONST OVERRIDE
262 STDMETHOD_(BOOL, MoveWindow)
263 (THIS_
int x,
int y,
int nWidth,
int nHeight, BOOL bRepaint = TRUE) OVERRIDE
267 STDMETHOD_(BOOL, MoveWindow2)(THIS_ LPCRECT lpRect, BOOL bRepaint = TRUE) OVERRIDE
271 STDMETHOD_(BOOL, ShowWindow)(THIS_
int nCmdShow) OVERRIDE
275 STDMETHOD_(
int, SetWindowRgn)(THIS_ HRGN hRgn, BOOL bRedraw = TRUE) OVERRIDE
279 STDMETHOD_(BOOL, SetLayeredWindowAttributes)
280 (THIS_ COLORREF crKey, BYTE byAlpha, DWORD dwFlags) OVERRIDE
284 STDMETHOD_(BOOL, UpdateLayeredWindow)
291 BLENDFUNCTION *pblend,
298 STDMETHOD_(
void, SetMsgHandler)(THIS_ FunMsgHandler fun,
void *ctx) OVERRIDE
302 STDMETHOD_(MsgHandlerInfo *,GetMsgHandler)(THIS) OVERRIDE{
306 STDMETHOD_(HWND, CreateEx)
307 (THIS_ HWND hWndParent, DWORD dwStyle, DWORD dwExStyle,
int x,
int y,
int nWidth,
int nHeight, IXmlNode *xmlInit DEF_VAL(NULL))
309 return SHostWnd::CreateEx(hWndParent, dwStyle, dwExStyle, x, y, nWidth, nHeight, xmlInit);
311 STDMETHOD_(HWND, Create)
312 (THIS_ HWND hWndParent,
int x = 0,
int y = 0,
int nWidth = 0,
int nHeight = 0)
317 STDMETHOD_(BOOL, InitFromXml)(THIS_ IXmlNode *pNode) OVERRIDE{
321 STDMETHOD_(
void, SetLayoutId)(THIS_ LPCTSTR pszLayoutId) OVERRIDE
326 STDMETHOD_(IWindow *, GetIRoot)(THIS) OVERRIDE
331 STDMETHOD_(BOOL,IsTranslucent)(CTHIS) SCONST OVERRIDE{
334 STDMETHOD_(IHostPresenter*,GetPresenter)(THIS) OVERRIDE{
338 STDMETHOD_(
void,SetPresenter)(THIS_ IHostPresenter* pPresenter) OVERRIDE{
342 STDMETHOD_(IMessageLoop*,GetMsgLoop)(THIS) OVERRIDE{
346 STDMETHOD_(IWindow *, FindIChildByID)(THIS_
int nId) OVERRIDE{
350 STDMETHOD_(IWindow *, FindIChildByName)(THIS_ LPCWSTR pszName) OVERRIDE{
354 STDMETHOD_(IWindow *, FindIChildByNameA)(THIS_ LPCSTR pszName) OVERRIDE{
358 STDMETHOD_(INcPainter*,GetNcPainter)(THIS) OVERRIDE
363 STDMETHOD_(
void, SetEventHandler)(THIS_ FunCallback fun,
void *ctx) OVERRIDE{
367 STDMETHOD_(EventHandlerInfo*, GetEventHandler)(THIS) OVERRIDE{
371 STDMETHOD_(BOOL, AnimateHostWindow)(THIS_ DWORD dwTime, DWORD dwFlags) OVERRIDE{
375 STDMETHOD_(
void,EnableDragDrop)(THIS) OVERRIDE{
378 STDMETHOD_(
void,ShowHostWnd)(THIS_
int uShowCmd,BOOL bWaitAniDone) OVERRIDE{
381 STDMETHOD_(
void, EnablePrivateUiDef)(THIS_ BOOL bEnable) OVERRIDE{
384 STDMETHOD_(
void, SetScale)(THIS_
int nScale,LPCRECT pDestRect){
The main host window class responsible for managing the layout, events, and rendering of SOUI windows...
EventHandlerInfo * GetEventHandler() OVERRIDE
Gets the event handler information for the host window.
void EnableDragDrop() OVERRIDE
Enables drag-and-drop functionality for the host window.
BOOL ShowWindow(int nCmdShow) OVERRIDE
Shows or hides the host window.
BOOL IsTranslucent() SCONST OVERRIDE
Checks if the host window is translucent.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the host window from an XML node.
void SetLayoutId(LPCTSTR pszLayoutId) OVERRIDE
Sets the layout ID for the host window.
IWindow * FindIChildByID(int nId) OVERRIDE
Finds a child window by its ID.
SHostWnd(LPCWSTR pszResName=NULL)
Constructs a SHostWnd object with an optional resource name.
void SetEventHandler(FunCallback fun, void *ctx) OVERRIDE
Sets the event handler for the host window.
HWND Create(HWND hWndParent, int x=0, int y=0, int nWidth=0, int nHeight=0) OVERRIDE
Creates the host window.
void ShowHostWnd(int uShowCmd, BOOL bWaitAniDone) OVERRIDE
Shows the host window with optional animation.
void SetPresenter(IHostPresenter *pPresenter) OVERRIDE
Sets the presenter for rendering.
IHostPresenter * GetPresenter() OVERRIDE
Gets the presenter interface for rendering.
IWindow * FindIChildByName(LPCWSTR pszName) OVERRIDE
Finds a child window by its name (Unicode version).
BOOL DestroyWindow() OVERRIDE
Destroys the host window.
BOOL AnimateHostWindow(DWORD dwTime, DWORD dwFlags) OVERRIDE
Animates the host window.
void SetScale(int nScale, LPCRECT pDestRect) OVERRIDE
Sets the scale factor for the host window.
void EnablePrivateUiDef(BOOL bEnable) OVERRIDE
Enables or disables private UI definitions for the host window.
IWindow * GetIRoot() OVERRIDE
Gets the root window interface.
IWindow * FindIChildByNameA(LPCSTR pszName) OVERRIDE
Finds a child window by its name (ANSI version).
IMessageLoop * GetMsgLoop() OVERRIDE
Gets the message loop interface.
INcPainter * GetNcPainter() OVERRIDE
Gets the non-client area painter for the host window.
HWND CreateEx(HWND hWndParent, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, IXmlNode *xmlInit=NULL) OVERRIDE
Creates the host window with extended styles.
BOOL IsIconic() SCONST OVERRIDE
Checks if the window is iconic (minimized).
BOOL IsZoomed() SCONST OVERRIDE
Checks if the window is zoomed (maximized).
BOOL ClientToScreen2(LPRECT lpRect) SCONST OVERRIDE
Converts client rectangle coordinates to screen coordinates.
BOOL ScreenToClient(LPPOINT lpPoint) SCONST OVERRIDE
Converts screen coordinates to client coordinates.
int SetWindowRgn(HRGN hRgn, BOOL bRedraw=TRUE) OVERRIDE
Sets the window region.
int MapWindowRect(HWND hWndTo, LPRECT lpRect) SCONST OVERRIDE
Maps a rectangle from one window to another.
HDC GetDC() OVERRIDE
Retrieves a device context for the window.
HWND SetCapture() OVERRIDE
Sets the window to capture the mouse.
BOOL GetWindowRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the window rectangle.
HWND GetCapture() OVERRIDE
Retrieves the handle to the window that has captured the mouse.
BOOL ReleaseCapture() OVERRIDE
Releases the mouse capture.
int MapWindowPoints(HWND hWndTo, LPPOINT lpPoint, UINT nCount) SCONST OVERRIDE
Maps points from one window to another.
BOOL SetLayeredWindowAttributes(COLORREF crKey, BYTE bAlpha, DWORD dwFlags) OVERRIDE
Sets the layered window attributes.
BOOL IsWindowVisible() SCONST OVERRIDE
Checks if the window is visible.
BOOL Invalidate(BOOL bErase=TRUE) OVERRIDE
Invalidates the entire window.
BOOL IsWindow() SCONST OVERRIDE
Checks if the handle is a valid window handle.
BOOL IsWindowEnabled() SCONST OVERRIDE
Checks if the window is enabled.
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Sends a message to the window.
const MSG * GetCurrentMessage() SCONST OVERRIDE
Retrieves the current message being processed.
void SetMsgHandler(FunMsgHandler fun, void *ctx) OVERRIDE
Sets the message handler for the window.
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE) OVERRIDE
Moves the window to the specified position and resizes it.
BOOL SendNotifyMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Sends a notify message to the window.
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL) OVERRIDE
Sets a timer for the window.
HWND UnsubclassWindow(BOOL bForce=FALSE) OVERRIDE
Unsubclasses a window.
BOOL ShowCaret() OVERRIDE
Shows the caret.
BOOL SubclassWindow(HWND hWnd) OVERRIDE
Subclasses an existing window.
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Posts a message to the window.
DWORD GetStyle() SCONST OVERRIDE
Retrieves the window style.
int GetID() SCONST
Retrieves the window ID.
HWND GetParent() OVERRIDE
Retrieves the handle to the parent window.
HWND SetFocus() OVERRIDE
Sets the input focus to the window.
DWORD GetExStyle() SCONST OVERRIDE
Retrieves the extended window style.
HWND SetParent(HWND hWndNewParent) OVERRIDE
Sets the handle to the parent window.
BOOL SetWindowText(LPCTSTR lpszString) OVERRIDE
Sets the window text.
BOOL ClientToScreen(LPPOINT lpPoint) SCONST OVERRIDE
Converts client coordinates to screen coordinates.
BOOL KillTimer(UINT_PTR nIDEvent) OVERRIDE
Kills a timer for the window.
void SetID(int nID)
Sets the window ID.
int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) SCONST OVERRIDE
Retrieves the window text.
BOOL CreateCaret(HBITMAP hBitmap, int nWidth, int nHeight) OVERRIDE
Creates a caret for the window.
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) OVERRIDE
Sets the long pointer value at the specified index.
BOOL CenterWindow(HWND hWndCenter=0) OVERRIDE
Centers the window relative to another window.
BOOL GetClientRect(LPRECT lpRect) SCONST OVERRIDE
Retrieves the client rectangle.
BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
Modifies the window style.
HDC GetWindowDC() OVERRIDE
Retrieves a device context for the entire window.
HWND CreateNative(LPCTSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, int nID=0, LPVOID lpParam=0) OVERRIDE
Creates a native window.
BOOL ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags=0) OVERRIDE
Modifies the extended window style.
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) OVERRIDE
Sets the window position.
HWND GetHwnd() OVERRIDE
Retrieves the handle to the window.
int ReleaseDC(HDC hDC) OVERRIDE
Releases a device context.
BOOL HideCaret() OVERRIDE
Hides the caret.
BOOL ScreenToClient2(LPRECT lpRect) SCONST OVERRIDE
Converts screen rectangle coordinates to client coordinates.
int GetDlgCtrlID() SCONST OVERRIDE
Retrieves the dialog control ID.
MsgHandlerInfo * GetMsgHandler() OVERRIDE
Retrieves the message handler for the window.
LONG_PTR GetWindowLongPtr(int nIndex) SCONST OVERRIDE
Retrieves the long pointer value at the specified index.
BOOL UpdateLayeredWindow(HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags) OVERRIDE
Updates the layered window.
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase=TRUE) OVERRIDE
Invalidates a specified rectangle of the window.
BOOL MoveWindow2(LPCRECT lpRect, BOOL bRepaint=TRUE) OVERRIDE
Moves the window to the specified position and resizes it using a rectangle.
long Release() PURE
Release reference.
void OnFinalRelease() PURE
Final release of the object.
long AddRef() PURE
Add reference.