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.

189 lines
3.2 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. sdpadtex.h
  5. Abstract:
  6. Author:
  7. */
  8. #ifndef __SDP_ADDRESS_TEXT__
  9. #define __SDP_ADDRESS_TEXT__
  10. #include "sdpcommo.h"
  11. #include "sdpgen.h"
  12. #include "sdpcstrl.h"
  13. #include "sdpbstrl.h"
  14. #include "sdpsadt.h"
  15. class _DllDecl SDP_ADDRESS_TEXT : public SDP_VALUE
  16. {
  17. public:
  18. inline SDP_ADDRESS_TEXT(
  19. IN DWORD ErrorCode,
  20. IN const CHAR *TypeString,
  21. IN const SDP_LINE_TRANSITION *SdpLineTransition = NULL
  22. );
  23. inline SDP_OPTIONAL_BSTRING &GetAddress();
  24. inline SDP_BSTRING &GetText();
  25. inline BOOL SetCharacterSet(
  26. IN SDP_CHARACTER_SET CharacterSet
  27. );
  28. HRESULT SetAddressTextValues(
  29. IN BSTR AddressBstr,
  30. IN BSTR TextBstr
  31. );
  32. protected:
  33. SDP_OPTIONAL_BSTRING m_Address;
  34. SDP_BSTRING m_Text;
  35. virtual BOOL GetField(
  36. OUT SDP_FIELD *&Field,
  37. OUT BOOL &AddToArray
  38. ) = 0;
  39. virtual void InternalReset();
  40. };
  41. inline
  42. SDP_ADDRESS_TEXT::SDP_ADDRESS_TEXT(
  43. IN DWORD ErrorCode,
  44. IN const CHAR *TypeString,
  45. IN const SDP_LINE_TRANSITION *SdpLineTransition
  46. )
  47. : SDP_VALUE(ErrorCode, TypeString, SdpLineTransition)
  48. {
  49. }
  50. inline SDP_OPTIONAL_BSTRING &
  51. SDP_ADDRESS_TEXT::GetAddress(
  52. )
  53. {
  54. return m_Address;
  55. }
  56. inline SDP_BSTRING &
  57. SDP_ADDRESS_TEXT::GetText(
  58. )
  59. {
  60. return m_Text;
  61. }
  62. inline BOOL
  63. SDP_ADDRESS_TEXT::SetCharacterSet(
  64. IN SDP_CHARACTER_SET CharacterSet
  65. )
  66. {
  67. return m_Text.SetCharacterSet(CharacterSet);
  68. }
  69. class _DllDecl SDP_ADDRESS_TEXT_LIST:
  70. public SDP_VALUE_LIST,
  71. public SDP_ADDRESS_TEXT_SAFEARRAY
  72. {
  73. public:
  74. inline SDP_ADDRESS_TEXT_LIST();
  75. inline void SetCharacterSet(
  76. IN SDP_CHARACTER_SET CharacterSet
  77. );
  78. protected:
  79. SDP_CHARACTER_SET m_CharacterSet;
  80. };
  81. inline
  82. SDP_ADDRESS_TEXT_LIST::SDP_ADDRESS_TEXT_LIST(
  83. )
  84. : SDP_ADDRESS_TEXT_SAFEARRAY(*this)
  85. {
  86. }
  87. // no need to check if the character set value is acceptable
  88. // the check is performed in the list member
  89. inline void
  90. SDP_ADDRESS_TEXT_LIST::SetCharacterSet(
  91. IN SDP_CHARACTER_SET CharacterSet
  92. )
  93. {
  94. m_CharacterSet = CharacterSet;
  95. }
  96. class _DllDecl SDP_PHONE: public SDP_ADDRESS_TEXT
  97. {
  98. public:
  99. SDP_PHONE();
  100. protected:
  101. virtual BOOL GetField(
  102. OUT SDP_FIELD *&Field,
  103. OUT BOOL &AddToArray
  104. );
  105. };
  106. class _DllDecl SDP_PHONE_LIST : public SDP_ADDRESS_TEXT_LIST
  107. {
  108. protected:
  109. virtual SDP_VALUE *CreateElement();
  110. };
  111. class _DllDecl SDP_EMAIL: public SDP_ADDRESS_TEXT
  112. {
  113. public:
  114. SDP_EMAIL();
  115. protected:
  116. virtual BOOL GetField(
  117. OUT SDP_FIELD *&Field,
  118. OUT BOOL &AddToArray
  119. );
  120. };
  121. class _DllDecl SDP_EMAIL_LIST : public SDP_ADDRESS_TEXT_LIST
  122. {
  123. protected:
  124. virtual SDP_VALUE *CreateElement();
  125. };
  126. #endif // __SDP_ADDRESS_TEXT__