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.

100 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FaxDeviceIds.h
  5. Abstract:
  6. Declaration of the CFaxDeviceIds class
  7. Author:
  8. Iv Garber (IvG) Jun, 2000
  9. Revision History:
  10. --*/
  11. #ifndef __FAXDEVICEIDS_H_
  12. #define __FAXDEVICEIDS_H_
  13. #include "resource.h" // main symbols
  14. #include "FaxCommon.h"
  15. #include <vector>
  16. #include "VCUE_Copy.h"
  17. namespace DeviceIdsNamespace
  18. {
  19. // Store the Device Ids in Vector
  20. typedef std::vector<long> ContainerType;
  21. // Typedef the copy classes using existing typedefs
  22. typedef VCUE::GenericCopy<VARIANT, long> EnumCopyType;
  23. typedef VCUE::GenericCopy<long, long> CollectionCopyType;
  24. typedef CComEnumOnSTL< IEnumVARIANT, &__uuidof(IEnumVARIANT), VARIANT, EnumCopyType,
  25. ContainerType > EnumType;
  26. typedef ICollectionOnSTLImpl< IFaxDeviceIds, ContainerType, long, CollectionCopyType,
  27. EnumType > CollectionType;
  28. };
  29. using namespace DeviceIdsNamespace;
  30. //
  31. //===================== FAX DEVICE IDS COLLECTION ======================================
  32. // FaxDeviceIDs Collection needs Ptr to the Fax Server, for Remove, Add and SetOrder
  33. // operations. So, it inherits from CFaxInitInnerAddRef class.
  34. //
  35. class ATL_NO_VTABLE CFaxDeviceIds :
  36. public CComObjectRootEx<CComSingleThreadModel>,
  37. public ISupportErrorInfo,
  38. public IDispatchImpl<DeviceIdsNamespace::CollectionType, &IID_IFaxDeviceIds, &LIBID_FAXCOMEXLib>,
  39. public CFaxInitInnerAddRef
  40. {
  41. public:
  42. CFaxDeviceIds() : CFaxInitInnerAddRef(_T("FAX DEVICE IDS"))
  43. {
  44. }
  45. ~CFaxDeviceIds()
  46. {
  47. //
  48. // Clear the Collection
  49. //
  50. CCollectionKiller<DeviceIdsNamespace::ContainerType> CKiller;
  51. CKiller.ClearCollection(&m_coll);
  52. }
  53. DECLARE_REGISTRY_RESOURCEID(IDR_FAXDEVICEIDS)
  54. DECLARE_NOT_AGGREGATABLE(CFaxDeviceIds)
  55. DECLARE_PROTECT_FINAL_CONSTRUCT()
  56. BEGIN_COM_MAP(CFaxDeviceIds)
  57. COM_INTERFACE_ENTRY(IFaxDeviceIds)
  58. COM_INTERFACE_ENTRY(IDispatch)
  59. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  60. END_COM_MAP()
  61. // Interfaces
  62. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  63. STDMETHOD(Add)(/*[in]*/ long lDeviceId);
  64. STDMETHOD(Remove)(/*[in]*/ long lIndex);
  65. STDMETHOD(SetOrder)(/*[in]*/ long lDeviceId, /*[in]*/ long lNewOrder);
  66. // Internal Use
  67. STDMETHOD(Init)(/*[in]*/ DWORD *pDeviceIds, /*[in]*/ DWORD dwNum, /*[in]*/ BSTR bstrGroupName,
  68. /*[in]*/ IFaxServerInner *pServer);
  69. private:
  70. CComBSTR m_bstrGroupName;
  71. // Private Functions
  72. STDMETHOD(UpdateGroup)();
  73. };
  74. #endif //__FAXDEVICEIDS_H_