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.

181 lines
6.9 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) 1993-1996 Microsoft Corporation. All Rights Reserved.
  3. //
  4. // MODULE: Infcolum.h
  5. //
  6. // PURPOSE: Defines the CInfoColumn class.
  7. #ifndef __INFCOLUM_H__
  8. #define __INFCOLUM_H__
  9. #include "treeview.h"
  10. interface IMsgrAb;
  11. // interface IBLView;
  12. #define MAX_WIDTH 0xffff
  13. #define IMAGE_HEIGHT 16
  14. #define INVALID_BAND_INDEX (UINT)-1
  15. #define INFOCOLUMN_LAST (0xffff - 1)
  16. #define INFOCOLUMN_FIRST 0xffff
  17. class CFolderBar;
  18. #define LEFTPANE_VERSION 0x01
  19. //Band Ids
  20. enum {
  21. ICTREEVIEW = 0,
  22. ICBLAB,
  23. ICOETODAY,
  24. IC_MAX_OBJECTS
  25. };
  26. #define idcInfoColumn 2500
  27. #define idcTreeViewBand idcInfoColumn + 1
  28. #define idcOETodayBand idcInfoColumn + 2
  29. typedef struct TagColumnObjItem
  30. {
  31. IInputObject *pBandObj;
  32. BORDERWIDTHS rcBandBorder;
  33. DWORD fShow;
  34. }ColumnObjItem;
  35. class CInfoColumn : public IDockingWindow,
  36. public IDropTarget,
  37. public IInputObject,
  38. public IInputObjectSite,
  39. public IObjectWithSite,
  40. public IOleCommandTarget
  41. {
  42. public:
  43. CInfoColumn();
  44. HRESULT HrInit(IAthenaBrowser *pBrowser,
  45. ITreeViewNotify *ptvNotify);
  46. virtual ~CInfoColumn(void);
  47. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppvObj);
  48. virtual STDMETHODIMP_(ULONG) AddRef(void);
  49. virtual STDMETHODIMP_(ULONG) Release(void);
  50. HRESULT CInfoColumn::GetInfoColWnd(HWND * lphwnd);
  51. HRESULT RegisterFlyOut(CFolderBar *pFolderBar);
  52. HRESULT RevokeFlyOut(void);
  53. LRESULT PrivateProcessing(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  54. static LRESULT CALLBACK InfoColumnWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  55. CTreeView* GetTreeView();
  56. BOOL CycleFocus(BOOL fReverse);
  57. BOOL CycleFocus(DWORD LastorFirst, BOOL fReverse);
  58. void ForwardMessages(UINT msg, WPARAM wParam, LPARAM lParam);
  59. HRESULT HasFocus(UINT itb);
  60. IMsgrAb* GetBAComtrol(void) {return m_pMsgrAb; }
  61. //IOleWindow::GetWindow
  62. virtual STDMETHODIMP GetWindow(HWND* lphwnd);
  63. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
  64. //IDockingWindow
  65. virtual STDMETHODIMP ShowDW(BOOL fShow);
  66. virtual STDMETHODIMP ResizeBorderDW(LPCRECT prcBorder,
  67. IUnknown* punkToolbarSite,
  68. BOOL fReserved);
  69. virtual STDMETHODIMP CloseDW(DWORD dwReserved);
  70. //IInputObject
  71. virtual STDMETHODIMP UIActivateIO(BOOL fActivate, LPMSG lpMsg);
  72. virtual STDMETHODIMP HasFocusIO(void);
  73. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG pMsg);
  74. //IIinputObjectSite
  75. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  76. //IObjectWithSite
  77. virtual STDMETHODIMP GetSite(REFIID riid, LPVOID *ppvSite);
  78. virtual STDMETHODIMP SetSite(IUnknown *pUnkSite);
  79. //IOleCommandTarget
  80. HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup,
  81. ULONG cCmds,
  82. OLECMD rgCmds[],
  83. OLECMDTEXT *pCmdText);
  84. HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup,
  85. DWORD nCmdID,
  86. DWORD nCmdExecOpt,
  87. VARIANTARG *pvaIn,
  88. VARIANTARG *pvaOut);
  89. //IDropTarget
  90. virtual STDMETHODIMP DragEnter( IDataObject *pDataObject,
  91. DWORD grfKeyState,
  92. POINTL pt,
  93. DWORD *pdwEffect);
  94. virtual STDMETHODIMP DragOver( DWORD grfKeyState,
  95. POINTL pt,
  96. DWORD *pdwEffect );
  97. virtual STDMETHODIMP DragLeave(void);
  98. virtual STDMETHODIMP Drop( IDataObject *pDataObject,
  99. DWORD grfKeyState,
  100. POINTL pt,
  101. DWORD *pdwEffect);
  102. private:
  103. HRESULT CreateInfoColumn(BOOL fVisible);
  104. LRESULT WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  105. BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct);
  106. LRESULT OnNotify(HWND hwnd, WPARAM wParam, LPNMHDR lParam);
  107. void OnSize(HWND hwnd, UINT state, int cxClient, int cyClient);
  108. void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags);
  109. void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags);
  110. void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags);
  111. LRESULT OnICBeginDrag(LPNMREBAR pnm);
  112. void OnContextMenu(HWND hwnd, HWND hwndContext, UINT xPos, UINT yPos);
  113. HRESULT FindBandListIndex(DWORD *pdwindex);
  114. DWORD FindBandObject(IInputObject *punk);
  115. HRESULT AddObject(IInputObject *pinpObj, DWORD fShow);
  116. void ResizeBands(int width);
  117. void GetFontParams();
  118. BOOL SetCycledFocus(DWORD Index, BOOL fReverse);
  119. DWORD GetFirstBand();
  120. DWORD GetLastBand();
  121. HRESULT AddTreeView(DWORD dwSize = 0, BOOL fVisible = TRUE);
  122. HRESULT AddMsgrAb(DWORD dwSize = 0, BOOL fVisible = TRUE);
  123. void AddOETodayBand(DWORD dwSize = 0, BOOL fVisible = TRUE);
  124. HRESULT SaveSettings(void);
  125. HRESULT CreateBands(void);
  126. HRESULT CreateDefaultBands(void);
  127. void ShowHideBand(DWORD dwBandID);
  128. BOOL IsOurWindow(HWND hwnd);
  129. HRESULT RegisterChildren(CFolderBar *pFolder, BOOL Register);
  130. void CleanupLParam();
  131. void ShowAllBands();
  132. private:
  133. HFONT m_hfIcon;
  134. UINT m_cRef;
  135. IDockingWindowSite *m_pDwSite;
  136. ColumnObjItem m_BandList[IC_MAX_OBJECTS];
  137. IOleCommandTarget *m_CacheCmdTarget[IC_MAX_OBJECTS];
  138. IInputObject *m_CurFocus;
  139. HWND m_hwndInfoColumn;
  140. HWND m_hwndRebar;
  141. HWND m_hwndParent;
  142. BOOL m_fShow;
  143. CTreeView *m_pTreeView;
  144. IMsgrAb *m_pMsgrAb;
  145. LONG m_xWidth;
  146. HIMAGELIST m_himl;
  147. BOOL m_fRebarDragging;
  148. CFolderBar *m_pFolderBar;
  149. int m_cVisibleBands;
  150. BOOL m_fDragging;
  151. };
  152. #endif //__INFCOLUM_H__