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.

198 lines
5.3 KiB

  1. //
  2. // bbar.h: BBar drop down connection status bar
  3. // Copyright Microsoft Corporation 1999-2000
  4. //
  5. //
  6. #ifndef _BBAR_H_
  7. #define _BBAR_H_
  8. #ifdef USE_BBAR
  9. class CUI;
  10. class CBBar
  11. {
  12. public:
  13. typedef enum {
  14. bbarNotInit = 0x0,
  15. bbarInitialized = 0x1,
  16. bbarLowering = 0x2,
  17. bbarRaising = 0x3,
  18. bbarLowered = 0x4,
  19. bbarRaised = 0x5
  20. } BBarState;
  21. CBBar(HWND hwndParent, HINSTANCE hInstance, CUI* pUi,
  22. BOOL fBBarEnabled);
  23. virtual ~CBBar();
  24. BOOL StartupBBar(int desktopX, int desktopY, BOOL fStartRaised);
  25. BOOL KillAndCleanupBBar();
  26. //
  27. // Kickoff the lower or raise animations
  28. //
  29. BOOL StartLowerBBar();
  30. BOOL StartRaiseBBar();
  31. VOID SetLocked(BOOL fLocked) {_fLocked = fLocked;}
  32. BOOL GetLockedState() {return _fLocked;}
  33. VOID SetEnabled(BOOL fEnabled) {_fBBarEnabled = fEnabled;}
  34. BOOL GetEnabled() {return _fBBarEnabled;}
  35. HWND GetHwnd() {return _hwndBBar;}
  36. HINSTANCE GetInstance() {return _hInstance;}
  37. BBarState GetState() {return _state;}
  38. #ifdef DISABLE_SHADOW_IN_FULLSCREEN
  39. VOID GetBBarLoweredAspect(RECT *rect)
  40. {
  41. rect->left = _rcBBarLoweredAspect.left;
  42. rect->top = _rcBBarLoweredAspect.top;
  43. rect->right = _rcBBarLoweredAspect.right;
  44. rect->bottom = _rcBBarLoweredAspect.bottom;
  45. }
  46. #endif // DISABLE_SHADOW_IN_FULLSCREEN
  47. VOID SetDisplayedText(LPTSTR szText);
  48. LPTSTR GetDisplayedText() {return _szDisplayedText;}
  49. //
  50. // Notification from UI that the hotzone hover timer
  51. //
  52. VOID OnBBarHotzoneFired();
  53. //
  54. // Fullscreen notifications
  55. //
  56. VOID OnNotifyEnterFullScreen();
  57. VOID OnNotifyLeaveFullScreen();
  58. // Syscolor change notification
  59. VOID OnSysColorChange();
  60. BOOL IsRaised() {return _state == bbarRaised;}
  61. BOOL IsLowered() {return _state == bbarLowered;}
  62. VOID SetPinned(BOOL b) {_fPinned = b;}
  63. BOOL IsPinned() {return _fPinned;}
  64. //
  65. // Button state props
  66. //
  67. VOID SetShowMinimize(BOOL fShowMinimize) {_fShowMinimize = fShowMinimize;}
  68. BOOL GetShowMinimize() {return _fShowMinimize;}
  69. VOID SetShowRestore(BOOL fShowRestore) {_fShowRestore = fShowRestore;}
  70. BOOL GetShowRestore() {return _fShowRestore;}
  71. private:
  72. //Private methods
  73. HWND CreateWnd(HINSTANCE hInstance,HWND hwndParent,
  74. LPRECT lpInitialRect);
  75. LRESULT CALLBACK BBarWndProc(HWND hwnd,
  76. UINT uMsg,
  77. WPARAM wParam,
  78. LPARAM lParam);
  79. BOOL DestroyWindow() {return ::DestroyWindow(_hwndBBar);}
  80. static LRESULT CALLBACK StaticBBarWndProc(HWND hwnd,
  81. UINT uMsg,
  82. WPARAM wParam,
  83. LPARAM lParam);
  84. VOID SetState(BBarState newState);
  85. BOOL Initialize(int desktopX, int desktopY, BOOL fStartRaised);
  86. BOOL ImmediateRaiseBBar();
  87. #ifdef OS_WINCE
  88. BOOL ImmediateLowerBBar();
  89. #endif
  90. BOOL AddReplaceImage(HWND hwndToolbar, UINT rsrcId,
  91. UINT nCells, HBITMAP* phbmpOldImage,
  92. PUINT pImgIndex);
  93. BOOL CreateToolbars();
  94. BOOL ReloadImages();
  95. //
  96. // Window event handlers
  97. //
  98. LRESULT OnPaint(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  99. LRESULT OnEraseBkgnd(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  100. //
  101. // Internal event handlers
  102. //
  103. VOID OnBBarLowered();
  104. VOID OnBBarRaised();
  105. VOID OnCmdMinimize();
  106. VOID OnCmdRestore();
  107. VOID OnCmdClose();
  108. VOID OnCmdPin();
  109. #ifdef OS_WINCE
  110. HRGN GetBBarRgn(POINT *pts);
  111. #endif
  112. protected:
  113. //Protected members
  114. HWND _hwndBBar;
  115. HWND _hwndParent;
  116. private:
  117. //Private members
  118. HINSTANCE _hInstance;
  119. BOOL _fBBarEnabled;
  120. HWND _hwndPinBar;
  121. HWND _hwndWinControlsBar;
  122. BBarState _state;
  123. RECT _rcBBarLoweredAspect;
  124. SIZE _sizeLoweredBBar;
  125. TCHAR _szDisplayedText[260];
  126. RECT _rcBBarDisplayTextArea;
  127. BOOL _fBlockZOrderChanges;
  128. //
  129. // Vertical offset used for animation
  130. // 0 is fully raised
  131. // _sizeLoweredBBar.cy is fully lowered
  132. INT _nBBarVertOffset;
  133. INT _nBBarAutoHideTime;
  134. //
  135. // Position of the mouse at the last autohide
  136. //
  137. POINT _ptLastAutoHideMousePos;
  138. CUI* _pUi;
  139. BOOL _fPinned;
  140. INT _nPinUpImage;
  141. INT _nPinDownImage;
  142. HBITMAP _hbmpLeftImage;
  143. HBITMAP _hbmpRightImage;
  144. //
  145. // Locked in similar to the pin except that it does not
  146. // affect the pin state. It can be used to force the bbar
  147. // to remain in a lowered state without having to change
  148. // the pin state
  149. //
  150. BOOL _fLocked;
  151. //
  152. // Button display states
  153. //
  154. BOOL _fShowMinimize;
  155. BOOL _fShowRestore;
  156. };
  157. #endif // USE_BBAR
  158. #endif // _BBAR_H_