Source code of Windows XP (NT5)
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.

226 lines
5.6 KiB

  1. #if !defined( calltoResolver_h )
  2. #define calltoResolver_h
  3. //--------------------------------------------------------------------------//
  4. //--------------------------------------------------------------------------//
  5. // Application Header Files. //
  6. //--------------------------------------------------------------------------//
  7. #include "callto.h"
  8. #include "calltoContext.h"
  9. //--------------------------------------------------------------------------//
  10. // interface IResolver. //
  11. //--------------------------------------------------------------------------//
  12. class IResolver
  13. {
  14. protected: // protected constructors --------------------------------//
  15. IResolver(){};
  16. public: // public destructor ------------------------------------//
  17. virtual
  18. ~IResolver(){};
  19. public: // public methods ----------------------------------------//
  20. virtual
  21. HRESULT
  22. resolve
  23. (
  24. IMutableCalltoCollection * const calltoCollection,
  25. TCHAR * const url
  26. ) = 0;
  27. }; // End of interface IResolver.
  28. //--------------------------------------------------------------------------//
  29. // class CPhoneResolver. //
  30. //--------------------------------------------------------------------------//
  31. class CPhoneResolver: public IResolver
  32. {
  33. public: // public methods (IResolver) ----------------------------//
  34. virtual
  35. HRESULT
  36. resolve
  37. (
  38. IMutableCalltoCollection * const calltoCollection,
  39. TCHAR * const url
  40. );
  41. }; // End of CPhoneResolver.
  42. //--------------------------------------------------------------------------//
  43. // class CEMailResolver. //
  44. //--------------------------------------------------------------------------//
  45. class CEMailResolver: public IResolver
  46. {
  47. public: // public methods (IResolver) ----------------------------//
  48. virtual
  49. HRESULT
  50. resolve
  51. (
  52. IMutableCalltoCollection * const calltoCollection,
  53. TCHAR * const url
  54. );
  55. }; // End of CEMailResolver.
  56. //--------------------------------------------------------------------------//
  57. // class CIPResolver. //
  58. //--------------------------------------------------------------------------//
  59. class CIPResolver: public IResolver
  60. {
  61. public: // public methods (IResolver) ----------------------------//
  62. virtual
  63. HRESULT
  64. resolve
  65. (
  66. IMutableCalltoCollection * const calltoCollection,
  67. TCHAR * const url
  68. );
  69. }; // End of CIPResolver.
  70. //--------------------------------------------------------------------------//
  71. // class CComputerResolver. //
  72. //--------------------------------------------------------------------------//
  73. class CComputerResolver: public IResolver
  74. {
  75. public: // public methods (IResolver) ----------------------------//
  76. virtual
  77. HRESULT
  78. resolve
  79. (
  80. IMutableCalltoCollection * const calltoCollection,
  81. TCHAR * const url
  82. );
  83. }; // End of CComputerResolver.
  84. //--------------------------------------------------------------------------//
  85. // class CILSResolver. //
  86. //--------------------------------------------------------------------------//
  87. class CILSResolver: public IResolver
  88. {
  89. public: // public methods (IResolver) ----------------------------//
  90. virtual
  91. HRESULT
  92. resolve
  93. (
  94. IMutableCalltoCollection * const calltoCollection,
  95. TCHAR * const url
  96. );
  97. }; // End of CILSResolver.
  98. //--------------------------------------------------------------------------//
  99. // class CUnrecognizedTypeResolver. //
  100. //--------------------------------------------------------------------------//
  101. class CUnrecognizedTypeResolver: public IResolver
  102. {
  103. public: // public methods (IResolver) ----------------------------//
  104. virtual
  105. HRESULT
  106. resolve
  107. (
  108. IMutableCalltoCollection * const calltoCollection,
  109. TCHAR * const url
  110. );
  111. }; // End of CUnrecognizedTypeResolver.
  112. //--------------------------------------------------------------------------//
  113. // class CStringResolver. //
  114. //--------------------------------------------------------------------------//
  115. class CStringResolver: public IResolver
  116. {
  117. public: // public methods (IResolver) ----------------------------//
  118. virtual
  119. HRESULT
  120. resolve
  121. (
  122. IMutableCalltoCollection * const calltoCollection,
  123. TCHAR * const url
  124. );
  125. }; // End of CStringResolver.
  126. //--------------------------------------------------------------------------//
  127. // class CCalltoResolver. //
  128. //--------------------------------------------------------------------------//
  129. class CCalltoResolver
  130. {
  131. public: // public constructors ------------------------------------//
  132. CCalltoResolver();
  133. public: // public destructor ------------------------------------//
  134. ~CCalltoResolver();
  135. public: // public methods ----------------------------------------//
  136. HRESULT
  137. resolve
  138. (
  139. ICalltoContext * const calltoContext,
  140. CCalltoProperties * const calltoProperties,
  141. CCalltoCollection * const resolvedCalltoCollection,
  142. const TCHAR * url,
  143. const bool strict
  144. );
  145. private: // private methods ----------------------------------------//
  146. bool
  147. addResolver
  148. (
  149. IResolver * const resolver
  150. );
  151. const bool
  152. strictCheck
  153. (
  154. const TCHAR * const url
  155. ) const;
  156. private: // private members ----------------------------------------//
  157. CPhoneResolver m_phoneResolver;
  158. CEMailResolver m_emailResolver;
  159. CIPResolver m_ipResolver;
  160. CComputerResolver m_computerResolver;
  161. CILSResolver m_ilsResolver;
  162. CUnrecognizedTypeResolver m_unrecognizedTypeResolver;
  163. CStringResolver m_stringResolver;
  164. IResolver * m_resolvers[ 7 ];
  165. int m_registeredResolvers;
  166. }; // End of class CCalltoResolver.
  167. //--------------------------------------------------------------------------//
  168. #endif // !defined( calltoResolver_h )