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.

131 lines
4.9 KiB

  1. #ifndef __SUBSCR_H__
  2. #define __SUBSCR_H__
  3. #include "grplist2.h"
  4. #define idtFindDelay 1
  5. #define dtFindDelay 600
  6. // SIZETABLE - This struct is used to make the dialog resizable. We keep one
  7. // of these for each control in the dialog. The rect's are updated
  8. // in WM_SIZE. A table of these is built in WM_INITDIALOG.
  9. typedef struct tagSIZETABLE
  10. {
  11. HWND hwndCtl;
  12. UINT id;
  13. RECT rc;
  14. } SIZETABLE, *PSIZETABLE;
  15. class CGroupListDlg : public IGroupListAdvise
  16. {
  17. public:
  18. CGroupListDlg();
  19. ~CGroupListDlg();
  20. // IUnknown
  21. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
  22. virtual ULONG STDMETHODCALLTYPE AddRef(void);
  23. virtual ULONG STDMETHODCALLTYPE Release(void);
  24. // IGroupListAdvise
  25. HRESULT STDMETHODCALLTYPE ItemUpdate(void);
  26. HRESULT STDMETHODCALLTYPE ItemActivate(FOLDERID id);
  27. // CGroupListDlg
  28. BOOL FCreate(HWND hwndOwner, FOLDERTYPE type, FOLDERID *pGotoId,
  29. UINT iTabSelect, BOOL fEnableGoto, FOLDERID idSel);
  30. private:
  31. static INT_PTR CALLBACK GroupListDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  32. BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam);
  33. void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify);
  34. LRESULT OnNotify(HWND hwnd, int idFrom, LPNMHDR pnmhdr);
  35. void OnTimer(HWND hwnd, UINT id);
  36. void OnPaint(HWND hwnd);
  37. void OnClose(HWND hwnd);
  38. void OnDestroy(HWND hwnd);
  39. void OnSize(HWND hwnd, UINT state, int cx, int cy);
  40. void OnGetMinMaxInfo(HWND hwnd, LPMINMAXINFO lpmmi);
  41. void OnChangeServers(HWND hwnd);
  42. BOOL IsGrpDialogMessage(HWND hwnd, LPMSG pMsg);
  43. BOOL ChangeServers(FOLDERID id, BOOL fForce = FALSE);
  44. BOOL FillServerList(HWND hwndList, FOLDERID idSel);
  45. BOOL OnSwitchTabs(HWND hwnd, UINT iTab);
  46. // Whenever we do something that might update the state of a button on
  47. // the dialog, we call this to allow the subclasses to update their UI.
  48. void UpdateStateUI(void);
  49. UINT m_cRef;
  50. // Handy window handles to have available
  51. HWND m_hwnd;
  52. HWND m_hwndFindText;
  53. HWND m_hwndOwner;
  54. // State variables
  55. BOOL m_fAllowDesc; // TRUE if the user can search descriptions
  56. LPTSTR m_pszPrevQuery; // The string that we last searched on
  57. UINT m_cchPrevQuery; // The allocated length of m_pszPrevQuery
  58. // Values used in resizing
  59. UINT m_cxHorzSep;
  60. UINT m_cyVertSep;
  61. PSIZETABLE m_rgst; // st - SizeTable. I use this a lot so I wanted it short - SteveSer
  62. SIZE m_sizeDlg;
  63. POINT m_ptDragMin;
  64. HIMAGELIST m_himlServer;
  65. CGroupList *m_pGrpList;
  66. FOLDERTYPE m_type;
  67. UINT m_iTabSelect;
  68. FOLDERID m_idSel;
  69. FOLDERID m_idGoto;
  70. BOOL m_fEnableGoto;
  71. BOOL m_fServerListInited;
  72. FOLDERID m_idCurrent;
  73. HICON m_hIcon;
  74. CColumns *m_pColumns;
  75. };
  76. /////////////////////////////////////////////////////////////////////////////
  77. // Dialog Control ID's
  78. //
  79. #define idcGroupList 2001 // Group list listview
  80. #define idcFindText 2002 // Find query edit box
  81. #define idcShowFavorites 2003 // Filter favorites toggle
  82. #define idcUseDesc 2004 // Use Desc checkbox
  83. #define idcServers 2005 // Server Listview
  84. #define idcHelp 2006 // Help button
  85. #define idcResetList 2007 // Rebuild the group list
  86. #define idcUpdateNow 1001
  87. #define idcFullWord 1004
  88. #define idcPreview 1006
  89. #define idcProgress 1007
  90. #define idcApply 1008
  91. #define idcFind 1010
  92. #define idcDispText 1011
  93. #define idcServerText 1012
  94. #define idcPreviewBtn 1013
  95. #define idcSubscribe 1014
  96. #define idcUnsubscribe 1015
  97. #define idcTabs 1016
  98. #define idcStaticNewsServers 1017
  99. #define idcStaticHorzLine 1019
  100. #define idcGoto 1020
  101. enum { iTabAll = 0, iTabSubscribed, iTabNew, iTabMax };
  102. enum { iCtlFindText = 0, iCtlUseDesc, iCtlGroupList, iCtlSubscribe, iCtlUnsubscribe,
  103. iCtlResetList, iCtlGoto, iCtlOK, iCtlCancel, iCtlServers, iCtlStaticNewsServers,
  104. iCtlStaticHorzLine, iCtlTabs, iCtlMax };
  105. HRESULT DoSubscriptionDialog(HWND hwnd, BOOL fNews, FOLDERID idFolder, BOOL fShowNew = FALSE);
  106. #endif // __SUBSCR_H__