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.

146 lines
4.9 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved
  3. Module Name:
  4. ManVol.h
  5. Abstract:
  6. Node representing a Managed Volume.
  7. Author:
  8. Rohde Wakefield [rohde] 12-Aug-1997
  9. Revision History:
  10. --*/
  11. #ifndef _MANVOL_H
  12. #define _MANVOL_H
  13. #include "PrMrSts.h"
  14. #include "PrMrIE.h"
  15. #include "PrMrLvl.h"
  16. #include "SakNodeI.h"
  17. class ATL_NO_VTABLE CUiManVol :
  18. public CSakNodeImpl<CUiManVol>,
  19. public CComCoClass<CUiManVol,&CLSID_CUiManVol>,
  20. public CComDualImpl<IManVolProp, &IID_IManVolProp, &LIBID_HSMADMINLib>
  21. {
  22. public:
  23. // constructor/destructor
  24. CUiManVol(void) {};
  25. BEGIN_COM_MAP(CUiManVol)
  26. COM_INTERFACE_ENTRY2(IDispatch, IManVolProp)
  27. COM_INTERFACE_ENTRY2(ISakNodeProp, IManVolProp)
  28. COM_INTERFACE_ENTRY(IHsmEvent)
  29. COM_INTERFACE_ENTRY(ISakNode)
  30. COM_INTERFACE_ENTRY(IDataObject)
  31. END_COM_MAP()
  32. DECLARE_REGISTRY_RESOURCEID(IDR_CUiManVol)
  33. // for multiple-inheritance, forward all base implementations to CSakNode.
  34. FORWARD_BASEHSM_IMPLS
  35. HRESULT FinalConstruct( void );
  36. void FinalRelease( void );
  37. public:
  38. STDMETHOD( InvokeCommand ) ( SHORT sCmd, IDataObject *pDataObject );
  39. STDMETHOD( GetContextMenu ) ( BOOL bMultiSelect, HMENU *phMenu );
  40. // ISakNode methods
  41. STDMETHOD( InitNode ) ( ISakSnapAsk* pSakSnapAsk, IUnknown* pHsmObj, ISakNode* pParent );
  42. STDMETHOD( TerminateNode ) ( void );
  43. STDMETHOD( AddPropertyPages ) ( RS_NOTIFY_HANDLE handle, IUnknown* pUnkPropSheetCallback, IEnumGUID* pEnumObjectId, IEnumUnknown *pEnumUnkNode );
  44. STDMETHOD( RefreshObject ) ( );
  45. STDMETHOD( OnToolbarButtonClick ) ( IDataObject *pDataObject, long cmdId );
  46. STDMETHOD( GetResultIcon ) ( IN BOOL bOK, OUT int* pIconIndex );
  47. STDMETHOD( SupportsProperties ) ( BOOL bMutliSelec );
  48. STDMETHOD( SupportsRefresh ) ( BOOL bMutliSelect );
  49. STDMETHOD( IsValid ) ( );
  50. // IManVolProp methods
  51. STDMETHOD( get_DesiredFreeSpaceP ) ( BSTR *pszValue );
  52. STDMETHOD( get_DesiredFreeSpaceP_SortKey )( BSTR *pszValue );
  53. STDMETHOD( get_MinFileSizeKb ) ( BSTR *pszValue );
  54. STDMETHOD( get_AccessDays ) ( BSTR *pszValue );
  55. STDMETHOD( get_FreeSpaceP ) ( BSTR *pszValue );
  56. STDMETHOD( get_Capacity ) ( BSTR *pszValue );
  57. STDMETHOD( get_Capacity_SortKey ) ( BSTR *pszValue );
  58. STDMETHOD( get_FreeSpace ) ( BSTR *pszValue );
  59. STDMETHOD( get_FreeSpace_SortKey ) ( BSTR *pszValue );
  60. STDMETHOD( get_Premigrated ) ( BSTR *pszValue );
  61. STDMETHOD( get_Truncated ) ( BSTR *pszValue );
  62. // static, class-wide variables
  63. static INT m_nScopeOpenIconIndex; // virtual scope index of Open Icon
  64. static INT m_nScopeCloseIconIndex; // virtual scope index of Close Icon
  65. static INT m_nResultIconIndex; // virtual scope index of Close Icon
  66. private:
  67. HRESULT RemoveObject( );
  68. HRESULT ShowManVolProperties (IDataObject *pDataObject, int initialPage);
  69. HRESULT CreateAndRunManVolJob (HSM_JOB_DEF_TYPE jobType);
  70. HRESULT HandleTask(IDataObject * pDataObject, HSM_JOB_DEF_TYPE jobType);
  71. HRESULT IsDataObjectMs ( IDataObject *pDataObject );
  72. HRESULT IsDataObjectOt ( IDataObject *pDataObject );
  73. HRESULT IsDataObjectMultiSelect ( IDataObject *pDataObject );
  74. HRESULT GetOtFromMs ( IDataObject *pDataObject, IDataObject ** pOtDataObject );
  75. HRESULT GetTaskTypeMessageId ( HSM_JOB_DEF_TYPE jobType, BOOL multiSelect, UINT* msgId );
  76. HRESULT IsAvailable ( );
  77. // Put properties
  78. HRESULT put_DesiredFreeSpaceP (int percent);
  79. HRESULT put_MinFileSizeKb (LONG minFileSizeKb);
  80. HRESULT put_AccessDays (int accessTimeDays);
  81. HRESULT put_FreeSpaceP (int percent);
  82. HRESULT put_Capacity (LONGLONG capacity);
  83. HRESULT put_FreeSpace (LONGLONG freeSpace);
  84. HRESULT put_Premigrated (LONGLONG premigrated);
  85. HRESULT put_Truncated (LONGLONG truncated);
  86. HRESULT put_IsAvailable( BOOL Available );
  87. // Properties for display
  88. int m_DesiredFreeSpaceP;
  89. LONG m_MinFileSizeKb;
  90. int m_AccessDays;
  91. int m_FreeSpaceP;
  92. LONGLONG m_Capacity;
  93. LONGLONG m_FreeSpace;
  94. LONGLONG m_Premigrated;
  95. LONGLONG m_Truncated;
  96. HRESULT m_HrAvailable;
  97. static int m_nResultIconD;
  98. static UINT m_MultiSelect;
  99. static UINT m_ObjectTypes;
  100. public:
  101. CComPtr <IFsaResource> m_pFsaResource;
  102. };
  103. class CUiManVolSheet : public CSakVolPropSheet
  104. {
  105. public:
  106. HRESULT AddPropertyPages( );
  107. HRESULT GetNextFsaResource( int *pBookMark, IFsaResource ** ppFsaResource );
  108. CUiManVolSheet( ) { };
  109. private:
  110. };
  111. #endif
  112. /////////////////////////////////////////////////////////////////////////////