19#include <interface/slayout-i.h>
20#include <interface/saccproxy-i.h>
21#include <interface/scaret-i.h>
22#include <helper/SwndMsgCracker.h>
23#include <layout/SLayoutSize.h>
24#include <event/SEventSlot.h>
26#include <event/SEventSet.h>
27#include <res.mgr/SUiDef.h>
30#include <animation/SAnimation.h>
31#include <interface/SWindow-i.h>
33#define SC_WANTARROWS 0x0001
34#define SC_WANTTAB 0x0002
35#define SC_WANTRETURN 0x0004
36#define SC_WANTCHARS 0x0008
37#define SC_WANTALLKEYS 0xFFFF
38#define SC_WANTSYSKEY 0x80000000
40#define ICWND_FIRST ((SWindow *)-1)
41#define ICWND_LAST NULL
44#define ASSERT_UI_THREAD() SNS::SWindow::TestMainThread()
46#define ASSERT_UI_THREAD()
128 return (dwState & state) == state;
152 SASSERT(swnd < 0x00FFFFFF && timeId >= 0);
161 memcpy(
this, &dwID,
sizeof(DWORD));
168 operator DWORD &()
const
170 return *(DWORD *)
this;
178class SOUI_EXP SPainter {
256 SStringT
GetText(BOOL bRawText = FALSE)
const;
286 ,
protected IAnimationListener {
289 friend class SwndLayoutBuilder;
290 friend class SWindowRepos;
291 friend class SHostWnd;
292 friend class SwndContainerImpl;
293 friend class FocusSearch;
294 friend class SGridLayout;
295 friend class SLinearLayout;
296 friend class SouiLayout;
297 friend class SHostProxy;
311 SAnimationHandler(
SWindow *pOwner);
333 bool getFillAfter()
const;
336 STDMETHOD_(
void, OnNextFrame)(THIS_) OVERRIDE;
344 BOOL OnOwnerResize(IEvtArgs *e);
390 STDMETHOD_(SWND,
GetSwnd)(THIS) SCONST OVERRIDE;
415 STDMETHOD_(BOOL, SetLayoutParam)(THIS_ ILayoutParam *pLayoutParam) OVERRIDE;
421 STDMETHOD_(BOOL, IsFloat)(THIS) SCONST OVERRIDE;
427 STDMETHOD_(BOOL, IsDisplay)(THIS) SCONST OVERRIDE;
433 STDMETHOD_(
void, SetWindowText)(THIS_ LPCTSTR lpszText) OVERRIDE;
439 STDMETHOD_(
void, SetWindowTextU8)(THIS_ LPCSTR lpszText) OVERRIDE;
445 STDMETHOD_(
void, SetToolTipText)(THIS_ LPCTSTR pszText) OVERRIDE;
451 STDMETHOD_(
void, SetToolTipTextU8)(THIS_ LPCSTR pszText) OVERRIDE;
457 STDMETHOD_(BOOL, IsChecked)(THIS) SCONST OVERRIDE;
463 STDMETHOD_(
void, SetCheck)(THIS_ BOOL bCheck) OVERRIDE;
470 STDMETHOD_(BOOL, IsDisabled)(THIS_ BOOL bCheckParent DEF_VAL(FALSE)) SCONST OVERRIDE;
477 STDMETHOD_(
void, EnableWindow)(THIS_ BOOL bEnable, BOOL bUpdate DEF_VAL(FALSE)) OVERRIDE;
484 STDMETHOD_(BOOL, IsVisible)(THIS_ BOOL bCheckParent DEF_VAL(FALSE)) SCONST OVERRIDE;
491 STDMETHOD_(
void, SetVisible)(THIS_ BOOL bVisible, BOOL bUpdate DEF_VAL(FALSE)) OVERRIDE;
497 STDMETHOD_(BOOL, IsMsgTransparent)(THIS) SCONST OVERRIDE;
503 STDMETHOD_(ULONG_PTR, GetUserData)(THIS) SCONST OVERRIDE;
510 STDMETHOD_(ULONG_PTR, SetUserData)(THIS_ ULONG_PTR uData) OVERRIDE;
528 STDMETHOD_(
void,
GetVisibleRect)(CTHIS_ LPRECT prect) SCONST OVERRIDE;
542 STDMETHOD_(BOOL,
IsContainPoint)(THIS_ POINT pt, BOOL bClientOnly) SCONST OVERRIDE;
548 STDMETHOD_(
void,
DoColorize)(THIS_ COLORREF cr) OVERRIDE;
560 STDMETHOD_(BOOL,
Destroy)(THIS) OVERRIDE;
582 (THIS_ UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0, BOOL *pbMsgHandled DEF_VAL(NULL)) OVERRIDE;
591 (THIS_ UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0) OVERRIDE;
596 STDMETHOD_(
void,
SetFocus)(THIS) OVERRIDE;
601 STDMETHOD_(
void,
KillFocus)(THIS) OVERRIDE;
607 STDMETHOD_(BOOL,
IsFocused)(THIS) SCONST OVERRIDE;
635 STDMETHOD_(BOOL,
IsUpdateLocked)(CTHIS_ BOOL bCheckParent DEF_VAL(FALSE)) SCONST OVERRIDE;
641 STDMETHOD_(
void,
Update)(THIS_ BOOL bForce DEF_VAL(FALSE)) OVERRIDE;
647 STDMETHOD_(
void,
Move)(THIS_ LPCRECT prect) OVERRIDE;
667 STDMETHOD_(
void,
SetWindowPath)(THIS_ IPathS *pPath, BOOL bRedraw DEF_VAL(TRUE)) OVERRIDE;
681 STDMETHOD_(BOOL,
SetTimer)(THIS_
char id, UINT uElapse) OVERRIDE;
688 STDMETHOD_(BOOL,
KillTimer)(THIS_
char id) OVERRIDE;
694 STDMETHOD_(SWND,
GetCapture)(THIS) SCONST OVERRIDE;
712 STDMETHOD_(
void,
SetAnimation)(THIS_ IAnimation *animation) OVERRIDE;
718 STDMETHOD_(IAnimation *,
GetAnimation)(THIS) SCONST OVERRIDE;
724 STDMETHOD_(
void,
StartAnimation)(THIS_ IAnimation *animation) OVERRIDE;
735 STDMETHOD_(
void,
SetAlpha)(THIS_ BYTE byAlpha) OVERRIDE;
741 STDMETHOD_(BYTE,
GetAlpha)(THIS) SCONST OVERRIDE;
747 STDMETHOD_(
void,
SetMatrix)(THIS_
const IMatrix *mtx) OVERRIDE;
753 STDMETHOD_(
void,
GetMatrix)(THIS_ IMatrix *mtx) SCONST OVERRIDE;
759 STDMETHOD_(
int,
GetScale)(THIS) SCONST OVERRIDE;
787 STDMETHOD_(BOOL,
IsFocusable)(THIS) SCONST OVERRIDE;
806 STDMETHOD_(IWindow *,
GetNextLayoutIChild)(THIS_
const IWindow *pCurChild) SCONST OVERRIDE;
818 STDMETHOD_(IWindow *,
GetIWindow)(THIS_
int uCode) SCONST OVERRIDE;
825 STDMETHOD_(IWindow *,
GetIChild)(THIS_
int iChild) SCONST OVERRIDE;
831 STDMETHOD_(IWindow *,
GetIParent)(THIS) SCONST OVERRIDE;
837 STDMETHOD_(IWindow *,
GetIRoot)(THIS) SCONST OVERRIDE;
844 STDMETHOD_(BOOL,
IsDescendant)(THIS_
const IWindow *pWnd) SCONST OVERRIDE;
851 STDMETHOD_(BOOL,
AdjustIZOrder)(THIS_ IWindow *pInsertAfter) OVERRIDE;
859 (THIS_ IWindow *pNewChild, IWindow *pInsertAfter = ICWND_LAST) OVERRIDE;
866 STDMETHOD_(BOOL,
RemoveIChild)(THIS_ IWindow *pChild) OVERRIDE;
873 STDMETHOD_(BOOL,
DestroyIChild)(THIS_ IWindow *pChild) OVERRIDE;
925 STDMETHOD_(
void,
GetDesiredSize)(THIS_ SIZE *psz,
int nParentWid,
int nParentHei) OVERRIDE;
934 STDMETHOD_(
void,
Move2)(THIS_
int x,
int y,
int cx DEF_VAL(-1),
int cy DEF_VAL(-1)) OVERRIDE;
943 STDMETHOD_(
int,
GetWindowText)(THIS_ TCHAR *pBuf,
int nBufLen, BOOL bRawText) OVERRIDE;
951 STDMETHOD_(
int,
GetWindowTextU8)(THIS_ IStringA *pStr, BOOL bRawText) OVERRIDE;
957 STDMETHOD_(
void,
SetEventMute)(THIS_ BOOL bMute) OVERRIDE;
963 STDMETHOD_(DWORD,
GetState)(THIS) SCONST OVERRIDE;
973 (THIS_ DWORD dwStateAdd, DWORD dwStateRemove, BOOL bUpdate DEF_VAL(FALSE)) OVERRIDE;
979 STDMETHOD_(
void,
SetIOwner)(THIS_ IWindow *pOwner) OVERRIDE;
985 STDMETHOD_(IWindow *,
GetIOwner)(THIS) SCONST OVERRIDE;
1014 STDMETHOD_(BOOL,
GetAttribute)(THIS_ LPCWSTR pszName, IStringW *strValue) SCONST OVERRIDE;
1040 STDMETHOD_(SWND,
SwndFromPoint)(THIS_ POINT *pt, BOOL bIncludeMsgTransparent DEF_VAL(FALSE)) SCONST OVERRIDE;
1047 STDMETHOD_(BOOL,
FireEvent)(THIS_ IEvtArgs *evt) OVERRIDE;
1060 STDMETHOD_(BOOL,
FireCtxMenu)(THIS_ POINT pt) OVERRIDE;
1068 STDMETHOD_(BOOL,
SubscribeEvent)(THIS_ DWORD evtId,
const IEvtSlot *pSlot) OVERRIDE;
1076 STDMETHOD_(BOOL,
UnsubscribeEvent)(THIS_ DWORD evtId,
const IEvtSlot *pSlot) OVERRIDE;
1092 STDMETHOD_(BOOL,
AddEvent)(THIS_ DWORD dwEventID, LPCWSTR pszEventHandlerName) OVERRIDE;
1099 STDMETHOD_(BOOL,
RemoveEvent)(THIS_ DWORD dwEventID) OVERRIDE;
1109 STDMETHOD_(BOOL,
SwndProc)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult) OVERRIDE;
1115 STDMETHOD_(
void,
SetSwndProc)(THIS_ FunSwndProc swndProc) OVERRIDE;
1134 STDMETHOD_(BOOL,
RegisterDragDrop)(THIS_ IDropTarget *pDragTarget) OVERRIDE;
1150 STDMETHOD_(BOOL,
CreateCaret)(THIS_ HBITMAP pBmp,
int nWid,
int nHeight) OVERRIDE;
1156 STDMETHOD_(
void,
ShowCaret)(THIS_ BOOL bShow) OVERRIDE;
1163 STDMETHOD_(
void,
SetCaretPos)(THIS_
int x,
int y) OVERRIDE;
1171 IAccessible *GetAccessible();
1206 SWindow *GetWindow(
int uCode)
const;
1213 SWindow *GetChild(
int iChild)
const;
1240 BOOL AdjustZOrder(
SWindow *pInsertAfter);
1248 void InsertChild(
SWindow *pNewChild,
SWindow *pInsertAfter = ICWND_LAST);
1256 BOOL RemoveChild(
SWindow *pChild);
1264 BOOL DestroyChild(
SWindow *pChild);
1271 void SetMatrix(
const SMatrix &mtx);
1278 virtual SStringT GetWindowText(BOOL bRawText = FALSE);
1284 virtual SStringT GetToolTipText();
1306 void SetOwner(
SWindow *pOwner);
1318 UINT GetTextAlign()
const;
1324 CRect GetWindowRect()
const;
1330 virtual CRect GetClientRect()
const;
1339 SWindow *FindChildByID(
int nID,
int nDeep = -1);
1364 if (!pTarget || !pTarget->
IsClass(T::GetClassName()))
1366 SSLOGW() <<
"FindChildByID2 Failed, no window of class " << T::GetClassName() <<
" with id of " << nID <<
" was found within " << nDeep <<
" levels";
1369 return (T *)pTarget;
1378 SWindow *FindChildByName(LPCWSTR strName,
int nDeep = -1);
1386 SWindow *FindChildByName(LPCSTR strName,
int nDeep = -1);
1399 if (!pTarget || !pTarget->
IsClass(T::GetClassName()))
1401 SSLOGW() <<
"FindChildByName2 Failed, no window of class " << T::GetClassName() <<
" with name of " << pszName <<
" was found within " << nDeep <<
" levels";
1404 return (T *)pTarget;
1432 if (pChild->
IsClass(T::GetClassName()))
1447 return (T *)pChildFind;
1460 IScriptModule *GetScriptModule();
1468 void InvalidateRect(
const CRect &rect, BOOL bFromThis = TRUE, BOOL bClip = FALSE);
1481 BOOL CreateChild(
SXmlNode xmlChild);
1487 void CreateChilds(
SXmlNode xmlNode);
1495 STDMETHOD_(
void, OnAnimationStart)(THIS_ IAnimation *animation);
1501 STDMETHOD_(
void, OnAnimationStop)(THIS_ IAnimation *animation);
1507 STDMETHOD_(
void, OnAnimationRepeat)(THIS_ IAnimation *animation);
1514 STDMETHOD_(
void, OnAnimationPauseChange)(THIS_ IAnimation *animation, BOOL bPaused);
1523 virtual void OnAnimationInvalidate(IAnimation *pAni,
bool bErase);
1528 virtual void OnContentChanged();
1534 virtual void OnColorize(COLORREF cr);
1541 virtual BOOL OnSetCursor(
const CPoint &pt);
1548 virtual void OnStateChanging(DWORD dwOldState, DWORD dwNewState);
1555 virtual void OnStateChanged(DWORD dwOldState, DWORD dwNewState);
1561 virtual void OnCaptureChanged(BOOL bCaptured);
1568 virtual BOOL OnRelayout(
const CRect &rcWnd);
1578 virtual SIZE MeasureContent(
int nParentWid,
int nParentHei);
1586 virtual SIZE MeasureChildren(
int nParentWid,
int nParentHei);
1607 virtual SWindow *GetSelectedChildInGroup();
1615 virtual BOOL CreateChildren(
SXmlNode xmlNode);
1623 virtual SWindow *CreateChildByName(LPCWSTR pszName);
1629 virtual void RequestRelayout(SWND hSource, BOOL bSourceResizable);
1646 virtual SWND SwndFromPoint(CPoint &pt, BOOL bIncludeMsgTransparent =
false)
const;
1654 virtual BOOL OnNcHitTest(CPoint pt);
1666 virtual BOOL NeedRedrawWhenStateChange();
1672 virtual void GetTextRect(LPRECT pRect);
1678 virtual void DrawText(
IRenderTarget *pRT, LPCTSTR pszBuf,
int cchText, LPRECT pRect, UINT uFormat);
1702 virtual LPCWSTR GetTrCtx()
const;
1791 void TransformPoint(CPoint &pt)
const;
1801 void TransformPointEx(CPoint &pt)
const;
1825 bool IsCacheDirty()
const;
1835 void MarkCacheDirty(
bool bDirty);
1844 virtual bool IsDrawToCache()
const;
1853 virtual BOOL IsLayeredWindow()
const;
1893 virtual SWindow *_FindChildByID(
int nID,
int nDeep);
1904 virtual SWindow *_FindChildByName(
const SStringW &strName,
int nDeep);
1913 SWindow *_GetCurrentLayeredWindow();
1944 bool _WndRectInRgn(
const CRect &rc,
const IRegionS *rgn)
const;
1963 void _RedrawNonClient();
1993 void UpdateCacheMode();
1998 void TestMainThread();
2016 int OnCreate(LPVOID);
2027 void OnSize(UINT nType, CSize size);
2077 void OnShowWindow(BOOL bShow, UINT nStatus);
2088 void OnEnable(BOOL bEnable, UINT nStatus);
2099 void OnLButtonDown(UINT nFlags, CPoint pt);
2110 void OnLButtonDbClick(UINT nFlags, CPoint point);
2121 void OnLButtonUp(UINT nFlags, CPoint pt);
2132 void OnRButtonDown(UINT nFlags, CPoint point);
2143 void OnRButtonUp(UINT nFlags, CPoint point);
2154 void OnMouseHover(UINT nFlags, CPoint ptPos);
2165 void OnMouseMove(UINT nFlags, CPoint pt);
2174 void OnMouseLeave();
2186 BOOL OnMouseWheel(UINT nFlags,
short zDelta, CPoint pt);
2198 LRESULT OnMouseClick(UINT uMsg, WPARAM wParam, LPARAM lParam);
2208 void OnSetFocus(SWND wndOld);
2218 void OnKillFocus(SWND wndFocus);
2230 LRESULT OnSetScale(UINT uMsg, WPARAM wParam, LPARAM lParam);
2242 LRESULT OnSetLanguage(UINT uMsg, WPARAM wParam, LPARAM lParam);
2254 LRESULT OnSetColorize(UINT uMsg, WPARAM wParam, LPARAM lParam);
2266 LRESULT OnUpdateFont(UINT uMsg, WPARAM wParam, LPARAM lParam);
2269 SOUI_MSG_MAP_BEGIN()
2270 MSG_WM_PAINT_EX(OnPaint)
2271 MSG_WM_ERASEBKGND_EX(OnEraseBkgnd)
2272 MSG_WM_NCPAINT_EX(OnNcPaint)
2273 MSG_WM_CREATE(OnCreate)
2275 MSG_WM_DESTROY(OnDestroy)
2276 MSG_WM_SHOWWINDOW(OnShowWindow)
2277 MSG_WM_ENABLE_EX(OnEnable)
2278 MESSAGE_RANGE_HANDLER_EX(WM_LBUTTONDOWN, WM_MBUTTONDBLCLK, OnMouseClick)
2279 MSG_WM_LBUTTONDOWN(OnLButtonDown)
2280 MSG_WM_LBUTTONUP(OnLButtonUp)
2281 MSG_WM_LBUTTONDBLCLK(OnLButtonDbClick)
2282 MSG_WM_RBUTTONDOWN(OnRButtonDown)
2283 MSG_WM_RBUTTONUP(OnRButtonUp)
2284 MSG_WM_MOUSEMOVE(OnMouseMove)
2285 MSG_WM_MOUSEHOVER(OnMouseHover)
2286 MSG_WM_MOUSELEAVE(OnMouseLeave)
2287 MSG_WM_MOUSEWHEEL(OnMouseWheel)
2288 MSG_WM_SETFOCUS_EX(OnSetFocus)
2289 MSG_WM_KILLFOCUS_EX(OnKillFocus)
2290 MESSAGE_HANDLER_EX(UM_SETLANGUAGE, OnSetLanguage)
2291 MESSAGE_HANDLER_EX(UM_SETSCALE, OnSetScale)
2292 MESSAGE_HANDLER_EX(UM_SETCOLORIZE, OnSetColorize)
2293 MESSAGE_HANDLER_EX(UM_UPDATEFONT, OnUpdateFont)
2294 SOUI_MSG_MAP_END_BASE()
2307 HRESULT OnAttrVisible(const
SStringW &strValue, BOOL bLoading);
2318 HRESULT OnAttrEnable(const
SStringW &strValue, BOOL bLoading);
2329 HRESULT OnAttrDisplay(const
SStringW &strValue, BOOL bLoading);
2340 HRESULT OnAttrCache(const
SStringW &strValue, BOOL bLoading);
2351 HRESULT OnAttrAlpha(const
SStringW &strValue, BOOL bLoading);
2362 HRESULT OnAttrSkin(const
SStringW &strValue, BOOL bLoading);
2373 HRESULT OnAttrLayout(const
SStringW &strValue, BOOL bLoading);
2384 HRESULT OnAttrClass(const
SStringW &strValue, BOOL bLoading);
2395 HRESULT OnAttrTrackMouseEvent(const
SStringW &strValue, BOOL bLoading);
2406 HRESULT OnAttrVideoCanvas(const
SStringW &strValue, BOOL bLoading);
2417 HRESULT OnAttrID(const
SStringW &strValue, BOOL bLoading);
2428 HRESULT OnAttrName(const
SStringW &strValue, BOOL bLoading);
2439 HRESULT OnAttrTip(const
SStringW &strValue, BOOL bLoading);
2450 HRESULT OnAttrText(const
SStringW &strValue, BOOL bLoading);
2462 HRESULT DefAttributeProc(const
SStringW &strAttribName, const
SStringW &strValue, BOOL bLoading);
2475 virtual HRESULT AfterAttribute(const
SStringW &strAttribName, const
SStringW &strValue, BOOL bLoading, HRESULT hr);
2477 ATTR_CUSTOM(L
"layout", OnAttrLayout)
2478 ATTR_CUSTOM(L
"class", OnAttrClass)
2479 ATTR_CUSTOM(L
"id", OnAttrID)
2480 ATTR_CUSTOM(L
"name", OnAttrName)
2481 ATTR_CUSTOM(L
"skin", OnAttrSkin)
2482 ATTR_SKIN(L
"ncskin", m_pNcSkin, TRUE)
2483 ATTR_INT(L
"data", m_uData, 0)
2484 ATTR_CUSTOM(L
"text", OnAttrText)
2485 ATTR_STRINGW(L
"trCtx", m_strTrCtx, FALSE)
2486 ATTR_CUSTOM(L
"enable", OnAttrEnable)
2487 ATTR_CUSTOM(L
"visible", OnAttrVisible)
2488 ATTR_CUSTOM(L
"show", OnAttrVisible)
2489 ATTR_CUSTOM(L
"display", OnAttrDisplay)
2490 ATTR_CUSTOM(L
"cache", OnAttrCache)
2491 ATTR_CUSTOM(L
"alpha", OnAttrAlpha)
2492 ATTR_BOOL(L
"layeredWindow", m_bLayeredWindow, TRUE)
2493 ATTR_CUSTOM(L
"trackMouseEvent", OnAttrTrackMouseEvent)
2494 ATTR_CUSTOM(L
"videoCanvas", OnAttrVideoCanvas)
2495 ATTR_CUSTOM(L
"tip", OnAttrTip)
2496 ATTR_BOOL(L
"msgTransparent", m_bMsgTransparent, FALSE)
2497 ATTR_LAYOUTSIZE(L
"maxWidth", m_nMaxWidth, FALSE)
2498 ATTR_BOOL(L
"clipClient", m_bClipClient, FALSE)
2499 ATTR_BOOL(L
"focusable", m_bFocusable, FALSE)
2500 ATTR_BOOL(L
"drawFocusRect", m_bDrawFocusRect, TRUE)
2501 ATTR_BOOL(L
"hoverAware", m_bHoverAware, FALSE)
2502 ATTR_BOOL(L
"float", m_bFloat, FALSE)
2513 virtual HRESULT OnLanguageChanged();
2519 virtual
void OnScaleChanged(
int scale);
2524 virtual
void OnRebuildFont();
2530 virtual
void OnBeforeInsertChild(
SWindow *pChild);
2536 virtual
void OnAfterInsertChild(
SWindow *pChild);
2542 virtual
void OnBeforeRemoveChild(
SWindow *pChild);
2548 virtual
void OnAfterRemoveChild(
SWindow *pChild);
2636 typedef struct GETRTDATA
2656 tid_t m_nMainThreadId;
2672 m_pOwner->GetContainer()->EnableHostPrivateUiDef(TRUE);
2680 m_pOwner->GetContainer()->EnableHostPrivateUiDef(FALSE);
WndState
Window state flags.
SAutoEnableHostPrivUiDef(SWindow *pOwner)
Constructor that enables private UI definitions for the host container.
~SAutoEnableHostPrivUiDef()
Destructor that disables private UI definitions for the host container.
Smart pointer class for managing COM-style reference-counted objects.
The SMatrix class holds a 3x3 matrix for transforming coordinates. SMatrix does not have a constructo...
BOOL IsClass(LPCWSTR lpszName) SCONST OVERRIDE
Checks if the object is of a specific class.
Helper class for painting.
SAutoRefPtr< IFontS > oldFont
Helper class for managing window states.
static bool TestState(DWORD dwState, WndState state)
Tests if a state is active.
static void ClearState(DWORD &dwState, WndState state)
Clears a state.
static void MarkState(DWORD &dwState, WndState state)
Marks a state as active.
A class representing an ASCII string.
STimerID(SWND swnd_, char timeId)
Constructor.
STimerID(DWORD dwID)
Constructor.
Class for handling text with translation support.
void SetOwner(SWindow *pOwner)
Sets the owner window.
void TranslateText()
Translates the text.
void SetText(const SStringT &strText, bool bAutoEscape=true)
Sets the text.
SStringT GetText(BOOL bRawText=FALSE) const
Gets the text.
static SStringW EscapeString(const SStringW &str)
Escapes a string.
STrText(SWindow *pOwner=NULL)
Constructor.
Base class for SOUI DUI windows.
IWindow * GetISelectedSiblingInGroup() OVERRIDE
Retrieves the selected sibling window in a group.
void StartAnimation(IAnimation *animation) OVERRIDE
Starts an animation for the window.
BOOL IsClipClient() SCONST OVERRIDE
Checks if client area clipping is enabled.
BOOL SetTimer(char id, UINT uElapse) OVERRIDE
Sets a timer for the window.
UINT OnGetDlgCode() SCONST OVERRIDE
Retrieves the dialog code for the window.
BOOL FireEvent(IEvtArgs *evt) OVERRIDE
Fires an event.
SAutoRefPtr< ISkinObj > m_pNcSkin
void SetMatrix(const IMatrix *mtx) OVERRIDE
Sets the transformation matrix for the window.
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Retrieves the desired size of the window.
SWND GetSwnd() SCONST OVERRIDE
Retrieves the window handle.
void accNotifyEvent(DWORD dwEvt)
Notifies an accessibility event.
HRESULT QueryInterface(REFGUID id, IObjRef **ppRet) OVERRIDE
Queries an interface.
IWindow * GetIOwner() SCONST OVERRIDE
Retrieves the owner window.
IWindow * GetIParent() SCONST OVERRIDE
Retrieves the parent window.
BOOL SubscribeEvent(DWORD evtId, const IEvtSlot *pSlot) OVERRIDE
Subscribes to an event.
void InsertIChild(IWindow *pNewChild, IWindow *pInsertAfter=NULL) OVERRIDE
Inserts a child window into the window tree.
void Move2(int x, int y, int cx=-1, int cy=-1) OVERRIDE
Moves the window to a new position and optionally resizes it.
BOOL UnregisterDragDrop() OVERRIDE
Unregisters a drop target for the window.
IWindow * GetIRoot() SCONST OVERRIDE
Retrieves the root window in the hierarchy.
void UnlockUpdate() OVERRIDE
Unlocks updates to the window.
BOOL Destroy() OVERRIDE
Destroys the window.
DWORD GetState() SCONST OVERRIDE
Retrieves the current state of the window.
BOOL AdjustIZOrder(IWindow *pInsertAfter) OVERRIDE
Adjusts the Z-order of the window.
void OnAnimationStop(IAnimation *animation)
Called when an animation stops.
void SetCaretPos(int x, int y) OVERRIDE
Sets the caret position.
SAutoRefPtr< IRegionS > m_clipRgn
SWND SwndFromPoint(POINT *pt, BOOL bIncludeMsgTransparent=FALSE) SCONST OVERRIDE
Retrieves the window handle at a specified point.
BOOL GetAttribute(LPCWSTR pszName, IStringW *strValue) SCONST OVERRIDE
Retrieves an attribute value from the window.
void GetClientRect(LPRECT prect) SCONST OVERRIDE
Retrieves the client rectangle of the window.
BOOL FireEvent(SEvtArgs &evt)
Fires an event.
BOOL IsSiblingsAutoGroupped() SCONST OVERRIDE
Checks if siblings are auto-grouped.
IAccProxy * GetAccProxy()
Retrieves the accessibility proxy for the window.
int GetWindowTextU8(IStringA *pStr, BOOL bRawText) OVERRIDE
Retrieves the window text as a UTF-8 string.
int GetWindowText(TCHAR *pBuf, int nBufLen, BOOL bRawText) OVERRIDE
Retrieves the window text.
IWindow * GetNextLayoutIChild(const IWindow *pCurChild) SCONST OVERRIDE
Retrieves the next layout child window.
BOOL IsLayoutDirty() SCONST OVERRIDE
Checks if the layout is dirty.
void SetAnimation(IAnimation *animation) OVERRIDE
Sets an animation for the window.
void OnAnimationStart(IAnimation *animation)
Called when an animation starts.
UINT GetChildrenCount() SCONST OVERRIDE
Retrieves the number of child windows.
SAutoRefPtr< ILayoutParam > m_pLayoutParam
SAutoRefPtr< IPathS > m_clipPath
BOOL SwndProc(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult) OVERRIDE
Processes a window message.
void SDispatchMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0) OVERRIDE
Dispatches a message to the window.
void BringWindowToTop() OVERRIDE
Brings the window to the top of the Z-order.
int GetScale() SCONST OVERRIDE
Retrieves the scale factor of the window.
void GetMatrix(IMatrix *mtx) SCONST OVERRIDE
Retrieves the transformation matrix of the window.
BOOL IsMsgHandled() const
Checks if the message is handled.
T * FindChildByID2(int nID, int nDeep=-1)
Finds a child window by its ID and casts it to a specific type.
void GetVisibleRect(LPRECT prect) SCONST OVERRIDE
Retrieves the visible rectangle of the window.
COLORREF GetColorizeColor() SCONST OVERRIDE
Retrieves the colorization color of the window.
BOOL IsVideoCanvas() SCONST OVERRIDE
Checks if the window is a video canvas.
BOOL DestroyIChild(IWindow *pChild) OVERRIDE
Destroys a child window.
void SetWindowPath(IPathS *pPath, BOOL bRedraw=TRUE) OVERRIDE
Sets the window path.
STransformation m_transform
BOOL UnsubscribeEvent(DWORD evtId, const IEvtSlot *pSlot) OVERRIDE
Unsubscribes from an event.
ISwndContainer * GetContainer() OVERRIDE
Retrieves the container associated with this window.
void SetEventMute(BOOL bMute) OVERRIDE
Sets the event mute state.
BOOL IsFocused() SCONST OVERRIDE
Checks if the window has focus.
void DoColorize(COLORREF cr) OVERRIDE
Applies colorization to the window.
BYTE GetAlpha() SCONST OVERRIDE
Retrieves the alpha value of the window.
STransformation GetTransformation() const
Retrieves the current transformation matrix of the window.
void SetAlpha(BYTE byAlpha) OVERRIDE
Sets the alpha value for the window.
void SetSwndProc(FunSwndProc swndProc) OVERRIDE
Sets the window procedure.
FunSwndProc m_funSwndProc
PSWNDMSG GetCurMsg(void) const
Retrieves the current message being processed.
void GetChildrenLayoutRect(RECT *prc) SCONST OVERRIDE
Retrieves the layout rectangle of the children.
T * FindChildByName2(LPCSTR pszName, int nDeep=-1)
Overloaded method to find a child window by its name and cast it to a specific type (ANSI version).
SWindow * FindChildByName(LPCWSTR strName, int nDeep=-1)
Finds a child window by its name.
IAnimation * GetAnimation() SCONST OVERRIDE
Retrieves the animation object associated with the window.
void OnFinalRelease()
Called when the last reference to the object is released.
LRESULT SSendMessage(UINT uMsg, WPARAM wParam=0, LPARAM lParam=0, BOOL *pbMsgHandled=NULL) OVERRIDE
Sends a message to the window.
LayoutDirtyType
Enumerates the types of layout dirty states.
IWindow * GetIWindow(int uCode) SCONST OVERRIDE
Retrieves a window based on a given code.
IWindow * GetISelectedChildInGroup() OVERRIDE
Retrieves the selected child window in a group.
T * FindChildByName2(LPCWSTR pszName, int nDeep=-1)
Finds a child window by its name and casts it to a specific type.
IWindow * FindIChildByNameA(LPCSTR pszName) OVERRIDE
Finds a child window by its name (ANSI version).
BOOL CreateChildrenFromXml(LPCWSTR pszXml) OVERRIDE
Creates child windows from XML.
static SStringW GetXmlText(const SXmlNode &xmlNode)
Gets the XML text from a node.
void InvalidateRect(LPCRECT lprect) OVERRIDE
Invalidates a specific rectangle area of the window.
void UpdateLayout() OVERRIDE
Updates the layout of the window.
void UpdateChildrenPosition() OVERRIDE
Updates the position of child windows.
LayoutDirtyType m_layoutDirty
SAutoRefPtr< IRenderTarget > m_cachedRT
IRegionS * GetWindowRgn() SCONST OVERRIDE
Retrieves the window region.
virtual void OnUpdateFloatPosition(const CRect &rcParent)
Update floating window position.
BOOL RemoveIChild(IWindow *pChild) OVERRIDE
Removes a child window from the window tree.
void SetContainer(ISwndContainer *pContainer) OVERRIDE
Sets the container for the window.
T * FindChildByClass(int nDeep=-1) const
Recursively finds a child window by its class type.
BOOL IsContainPoint(POINT pt, BOOL bClientOnly) SCONST OVERRIDE
Checks if the window contains a specified point.
T * GetLayoutParamT()
Template method to cast layout parameters to a specific type.
SWND SetCapture() OVERRIDE
Sets the window to capture the mouse.
SAutoRefPtr< ICaret > m_caret
void ClearAnimation() OVERRIDE
Clears the animation for the window.
void SetFocus() OVERRIDE
Sets the focus to the window.
SWND GetCapture() SCONST OVERRIDE
Retrieves the window that has captured the mouse.
void SetIOwner(IWindow *pOwner) OVERRIDE
Sets the owner window.
BOOL IsUpdateLocked(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if updates to the window are locked.
void SetWindowRgn(IRegionS *pRgn, BOOL bRedraw=TRUE) OVERRIDE
Sets the window region.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SWindow * GetWindow(int uCode) const
Retrieves a window based on a given code.
void ShowCaret(BOOL bShow) OVERRIDE
Shows or hides the caret.
void KillFocus() OVERRIDE
Kills the focus from the window.
IWindow * FindIChildByName(LPCWSTR pszName) OVERRIDE
Finds a child window by its name.
void DestroyAllChildren() OVERRIDE
Destroys all child windows.
SEventSet * GetEventSet()
Retrieves the event set associated with the window.
BOOL KillTimer(char id) OVERRIDE
Kills a timer for the window.
BOOL IsFocusable() SCONST OVERRIDE
Checks if the window is focusable.
SAutoRefPtr< ISkinObj > m_pBgSkin
BOOL FireCtxMenu(POINT pt) OVERRIDE
Fires a context menu event.
void Invalidate() OVERRIDE
Invalidates the entire window.
IPathS * GetWindowPath() SCONST OVERRIDE
Retrieves the window path.
BOOL CreateCaret(HBITMAP pBmp, int nWid, int nHeight) OVERRIDE
Creates a caret.
BOOL IsDescendant(const IWindow *pWnd) SCONST OVERRIDE
Checks if a window is a descendant of this window.
virtual SWindow * GetSelectedSiblingInGroup()
Get selected sibling in group.
void RequestRelayout() OVERRIDE
Requests a relayout of the window.
BOOL AddEvent(DWORD dwEventID, LPCWSTR pszEventHandlerName) OVERRIDE
Adds an event handler.
void GetWindowRect(LPRECT prect) SCONST OVERRIDE
Retrieves the bounding rectangle of the window.
COLORREF GetBkgndColor() SCONST OVERRIDE
Retrieves the background color of the window.
ILayout * GetLayout() OVERRIDE
Retrieves the layout object associated with the window.
void SetMsgHandled(BOOL bHandled)
Sets the message handled flag.
BOOL RegisterDragDrop(IDropTarget *pDragTarget) OVERRIDE
Registers a drop target for the window.
BOOL InitFromXml(IXmlNode *pNode) OVERRIDE
Initializes the window from an XML node.
IWindow * GetIChild(int iChild) SCONST OVERRIDE
Retrieves a child window by index.
BOOL FireCommand() OVERRIDE
Fires a command event.
void Update(BOOL bForce=FALSE) OVERRIDE
Updates the window.
SAnimationHandler m_animationHandler
DWORD ModifyState(DWORD dwStateAdd, DWORD dwStateRemove, BOOL bUpdate=FALSE) OVERRIDE
Modifies the state of the window.
SAutoRefPtr< IAttrStorage > m_attrStorage
void LockUpdate() OVERRIDE
Locks updates to the window.
HWND GetHostHwnd() OVERRIDE
Retrieves the host window handle.
IWindow * FindIChildByID(int nId) OVERRIDE
Finds a child window by its ID.
SWND m_swnd
Member variables representing various properties of the window.
SWindow * FindChildByID(int nID, int nDeep=-1)
Finds a child window by its ID.
void Move(LPCRECT prect) OVERRIDE
Moves the window to a new position and size.
ISwndContainer * m_pContainer
ITimelineHandlersMgr * GetTimelineHandlersMgr() OVERRIDE
Retrieves the timeline handlers manager.
SAutoRefPtr< ILayout > m_pLayout
BOOL RemoveEvent(DWORD dwEventID) OVERRIDE
Removes an event handler.
BOOL CreateChildrenFromResId(LPCTSTR pszResId) OVERRIDE
Creates child windows from a resource ID.
SAutoRefPtr< IAnimation > m_animation
BOOL ReleaseCapture() OVERRIDE
Releases the mouse capture from the window.
Class representing an XML node.
Manages the style attributes of SOUI windows.
Interface for reference counting.
Interface for rendering target objects.
SOUI Window Container Interface.
Structure representing a window message.