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.

69 lines
2.2 KiB

  1. /*
  2. * Viewer
  3. */
  4. #ifndef DUI_CONTROL_VIEWER_H_INCLUDED
  5. #define DUI_CONTROL_VIEWER_H_INCLUDED
  6. #pragma once
  7. namespace DirectUI
  8. {
  9. ////////////////////////////////////////////////////////
  10. // Viewer
  11. class Viewer : public Element
  12. {
  13. public:
  14. static HRESULT Create(OUT Element** ppElement);
  15. // Generic events
  16. virtual void OnEvent(Event* pEvent);
  17. // System events
  18. virtual void OnInput(InputEvent* pie);
  19. virtual bool OnPropertyChanging(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  20. virtual void OnPropertyChanged(PropertyInfo* ppi, int iIndex, Value* pvOld, Value* pvNew);
  21. // Self-layout methods
  22. void _SelfLayoutDoLayout(int dWidth, int dHeight);
  23. SIZE _SelfLayoutUpdateDesiredSize(int dConstW, int dConstH, Surface* psrf);
  24. // Property definitions
  25. static PropertyInfo* XOffsetProp;
  26. static PropertyInfo* YOffsetProp;
  27. static PropertyInfo* XScrollableProp;
  28. static PropertyInfo* YScrollableProp;
  29. // Quick property accessors
  30. int GetXOffset() DUIQuickGetter(int, GetInt(), XOffset, Specified)
  31. int GetYOffset() DUIQuickGetter(int, GetInt(), YOffset, Specified)
  32. bool GetXScrollable() DUIQuickGetter(bool, GetBool(), XScrollable, Specified)
  33. bool GetYScrollable() DUIQuickGetter(bool, GetBool(), YScrollable, Specified)
  34. HRESULT SetXOffset(int v) DUIQuickSetter(CreateInt(v), XOffset)
  35. HRESULT SetYOffset(int v) DUIQuickSetter(CreateInt(v), YOffset)
  36. HRESULT SetXScrollable(bool v) DUIQuickSetter(CreateBool(v), XScrollable)
  37. HRESULT SetYScrollable(bool v) DUIQuickSetter(CreateBool(v), YScrollable)
  38. // ClassInfo accessors (static and virtual instance-based)
  39. static IClassInfo* Class;
  40. virtual IClassInfo* GetClassInfo() { return Class; }
  41. static HRESULT Register();
  42. bool EnsureVisible(int x, int y, int cx, int cy);
  43. Viewer() { }
  44. HRESULT Initialize();
  45. virtual ~Viewer() { }
  46. private:
  47. Element* GetContent();
  48. bool InternalEnsureVisible(int x, int y, int cx, int cy);
  49. };
  50. } // namespace DirectUI
  51. #endif // DUI_CONTROL_VIEWER_H_INCLUDED