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.

128 lines
2.7 KiB

  1. //
  2. // candmenu.h
  3. //
  4. #ifndef CANDMENU_H
  5. #define CANDMENU_H
  6. #include "mscandui.h"
  7. #include "lbmenu.h"
  8. #include "cuilib.h"
  9. class CCandMenu;
  10. class CUIFMenu;
  11. class CUIFWindow;
  12. class CCandWindowBase;
  13. //////////////////////////////////////////////////////////////////////////////
  14. //
  15. // CCandMenuItem
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. class CCandMenuItem : public CCicLibMenuItem
  19. {
  20. public:
  21. CCandMenuItem( CCandMenu *pUTBMenu );
  22. ~CCandMenuItem( void );
  23. BOOL InsertToUI( CUIFMenu *pCuiMenu );
  24. private:
  25. CCandMenu *m_pCandMenu;
  26. };
  27. //////////////////////////////////////////////////////////////////////////////
  28. //
  29. // CCandMenu
  30. //
  31. //////////////////////////////////////////////////////////////////////////////
  32. class CCandMenu : public CCicLibMenu,
  33. public ITfCandUIMenuExtension
  34. {
  35. public:
  36. CCandMenu( HINSTANCE hInst );
  37. virtual ~CCandMenu( void );
  38. //
  39. // IUnknown methods
  40. //
  41. STDMETHODIMP_(ULONG) AddRef( void );
  42. STDMETHODIMP_(ULONG) Release( void );
  43. STDMETHODIMP QueryInterface( REFIID riid, void **ppvObj );
  44. //
  45. // ITfCandUIMenuExtension methods
  46. //
  47. STDMETHODIMP SetFont( LOGFONTW *plf );
  48. STDMETHODIMP GetFont( LOGFONTW *plf );
  49. UINT ShowPopup( CCandWindowBase *pCandWindow, const POINT pt, const RECT *prcArea );
  50. void ClosePopup( void );
  51. CUIFMenu *CreateMenuUI( BOOL fSubMenu );
  52. CUIFMenu *GetMenuUI( void );
  53. virtual CCicLibMenu *CreateSubMenu()
  54. {
  55. CCandMenu *pSubMenu = new CCandMenu( m_hInst );
  56. if (pSubMenu != NULL) {
  57. pSubMenu->SetFont( &m_lf );
  58. }
  59. return pSubMenu;
  60. }
  61. virtual CCicLibMenuItem *CreateMenuItem()
  62. {
  63. return new CCandMenuItem( this );
  64. }
  65. private:
  66. HINSTANCE m_hInst;
  67. CUIFMenu *m_pCUIMenu;
  68. LOGFONTW m_lf;
  69. CCandWindowBase *m_pCandWnd;
  70. };
  71. //
  72. //
  73. //
  74. class CUIFCandMenu : public CUIFMenu
  75. {
  76. public:
  77. CUIFCandMenu( HINSTANCE hInst, DWORD dwWndSTyle, DWORD dwMenuStyle );
  78. virtual ~CUIFCandMenu( void );
  79. void ResetMenuFont( LOGFONTW *plf );
  80. };
  81. //
  82. //
  83. //
  84. class CUIFCandMenuParent : public CUIFCandMenu
  85. {
  86. public:
  87. CUIFCandMenuParent( HINSTANCE hInst, DWORD dwWndSTyle, DWORD dwMenuStyle, CCandWindowBase *pCandWnd );
  88. virtual ~CUIFCandMenuParent( void );
  89. protected:
  90. virtual void ModalMessageLoop( void );
  91. virtual BOOL InitShow( CUIFWindow *pcuiWndParent, const RECT *prc, BOOL fVertical, BOOL fAnimate );
  92. virtual BOOL UninitShow( void );
  93. BOOL InstallHook( void );
  94. BOOL UninstallHook( void );
  95. static LRESULT CALLBACK KeyboardProc( int code, WPARAM wParam, LPARAM lParam );
  96. static LRESULT CALLBACK MouseProc( int code, WPARAM wParam, LPARAM lParam );
  97. CCandWindowBase *m_pCandWnd;
  98. };
  99. #endif CANDMENU_H