Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.6 KiB

  1. /*
  2. * Host
  3. */
  4. #ifndef DUI_CORE_HOST_H_INCLUDED
  5. #define DUI_CORE_HOST_H_INCLUDED
  6. #pragma once
  7. #include "duielement.h"
  8. namespace DirectUI
  9. {
  10. ////////////////////////////////////////////////////////
  11. // HWNDElement
  12. #define HWEM_FLUSHWORKINGSET WM_USER
  13. class HWNDElement : public Element
  14. {
  15. public:
  16. static HRESULT Create(OUT Element** ppElement); // Required for ClassInfo (always fails)
  17. static HRESULT Create(HWND hParent, bool fDblBuffer, UINT nCreate, OUT Element** ppElement);
  18. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  19. virtual void OnGroupChanged(int fGroups, bool bLowPri);
  20. virtual void OnDestroy();
  21. virtual void OnEvent(Event* pEvent);
  22. virtual void OnInput(InputEvent* pInput);
  23. virtual bool CanSetFocus() {return true;}
  24. Element* ElementFromPoint(POINT* ppt);
  25. static LRESULT CALLBACK StaticWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  26. virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  27. void FlushWorkingSet(); // Async
  28. HWND GetHWND() { return _hWnd; }
  29. Element* GetKeyFocusedElement();
  30. void ShowUIState(bool fUpdateAccel, bool fUpdateFocus);
  31. WORD GetUIState() { return _wUIState; }
  32. bool ShowAccel() { return !(GetUIState() & UISF_HIDEACCEL); }
  33. bool ShowFocus() { return !(GetUIState() & UISF_HIDEFOCUS); }
  34. void SetParentSizeControl(bool bParentSizeControl) {_bParentSizeControl = bParentSizeControl;}
  35. void SetScreenCenter(bool bScreenCenter) {_bScreenCenter = bScreenCenter;}
  36. // Property definitions
  37. static PropertyInfo* WrapKeyboardNavigateProp;
  38. // Quick property accessors
  39. bool GetWrapKeyboardNavigate() DUIQuickGetter(bool, GetBool(), WrapKeyboardNavigate, Specified)
  40. HRESULT SetWrapKeyboardNavigate(bool v) DUIQuickSetter(CreateBool(v), WrapKeyboardNavigate)
  41. // ClassInfo accessors (static and virtual instance-based)
  42. static IClassInfo* Class;
  43. virtual IClassInfo* GetClassInfo() { return Class; }
  44. static HRESULT Register();
  45. ///////////////////////////////////////////////////////
  46. // Accessibility support
  47. virtual HRESULT GetAccessibleImpl(IAccessible ** ppAccessible);
  48. HWNDElement() {_bParentSizeControl = false; _bScreenCenter = false;}
  49. virtual ~HWNDElement() { }
  50. HRESULT Initialize(HWND hParent, bool fDblBuffer, UINT nCreate);
  51. protected:
  52. HWND _hWnd;
  53. HPALETTE _hPal;
  54. bool _bParentSizeControl;
  55. bool _bScreenCenter;
  56. WORD _wUIState;
  57. };
  58. } // namespace DirectUI
  59. #endif // DUI_CORE_HOST_H_INCLUDED