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.

89 lines
2.9 KiB

  1. #ifndef DomainNode_h
  2. #define DomainNode_h
  3. #include "resource.h"
  4. #include ".\atlsnap.h"
  5. #include <objidl.h>
  6. #include "pop3.h"
  7. #include <P3Admin.h>
  8. #include "UserNode.h"
  9. class CPOP3ServerSnapData;
  10. class CServerNode;
  11. typedef std::list<CUserNode*> USERLIST;
  12. //////////////////////////////////////////////////////////////////////////////////
  13. //
  14. // CDomainNode
  15. //
  16. //////////////////////////////////////////////////////////////////////////////////
  17. class CDomainNode : public CSnapInItemImpl<CDomainNode>
  18. {
  19. public:
  20. static const GUID* m_NODETYPE;
  21. static const OLECHAR* m_SZNODETYPE;
  22. static const OLECHAR* m_SZDISPLAY_NAME;
  23. static const CLSID* m_SNAPIN_CLASSID;
  24. CComPtr<IControlbar> m_spControlBar;
  25. BEGIN_SNAPINCOMMAND_MAP(CDomainNode, FALSE)
  26. SNAPINCOMMAND_ENTRY ( IDM_DOMAIN_TOP_LOCK, OnDomainLock )
  27. SNAPINCOMMAND_ENTRY ( IDM_DOMAIN_TOP_UNLOCK, OnDomainLock )
  28. SNAPINCOMMAND_ENTRY ( IDM_DOMAIN_NEW_USER, OnNewUser )
  29. END_SNAPINCOMMAND_MAP()
  30. // Standard Class Constructor/Destructor
  31. CDomainNode(IP3Domain* pDomain, CServerNode* pParent);
  32. virtual ~CDomainNode();
  33. // Standard ATL Snap-In Impl Over-rides
  34. STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type)
  35. {
  36. if ( type == CCT_SCOPE || type == CCT_RESULT )
  37. return S_OK;
  38. return S_FALSE;
  39. }
  40. STDMETHOD(GetScopePaneInfo)(SCOPEDATAITEM *pScopeDataItem);
  41. STDMETHOD(GetResultPaneInfo)(RESULTDATAITEM *pResultDataItem);
  42. LPOLESTR GetResultPaneColInfo(int nCol);
  43. STDMETHOD(Notify)( MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param, IComponentData* pComponentData, IComponent* pComponent, DATA_OBJECT_TYPES type);
  44. // MenuItem Implementations
  45. STDMETHOD(AddMenuItems) (LPCONTEXTMENUCALLBACK piCallback, long* pInsertionAllowed, DATA_OBJECT_TYPES type );
  46. STDMETHOD(OnNewUser) (bool& bHandled, CSnapInObjectRootBase* pObj );
  47. STDMETHOD(OnDomainLock) (bool& bHandled, CSnapInObjectRootBase* pObj );
  48. public:
  49. // Public function for childrent to delete themselves
  50. HRESULT DeleteUser(CUserNode* pUser, BOOL bDeleteAccount = FALSE);
  51. BOOL IsLocked();
  52. // Helper Function
  53. HRESULT GetAuth(BOOL* pbHashPW = NULL, BOOL* pbSAM = NULL);
  54. HRESULT GetConfirmAddUser( BOOL *pbConfirm );
  55. HRESULT SetConfirmAddUser( BOOL bConfirm );
  56. private:
  57. // Private function to help with refresh and expanding
  58. HRESULT BuildUsers( );
  59. // Domain Information
  60. USERLIST m_lUsers;
  61. CComPtr<IP3Domain> m_spDomain;
  62. // Parent Information
  63. CServerNode* m_pParent;
  64. // Column text needs to be allocated by us, so we'll free them in the destructor
  65. CComBSTR m_bstrNumBoxes;
  66. CComBSTR m_bstrSize;
  67. CComBSTR m_bstrNumMessages;
  68. CComBSTR m_bstrState;
  69. };
  70. #endif // DomainNode_h