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.

229 lines
7.6 KiB

  1. //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
  2. //
  3. // xmlutil.h
  4. //
  5. // XML item helper functions.
  6. //
  7. // History:
  8. //
  9. // 4/1/97 edwardp Created.
  10. //
  11. ////////////////////////////////////////////////////////////////////////////////
  12. //
  13. // Check for previous includes of this file.
  14. //
  15. #ifndef _XMLUTIL_H_
  16. #define _XMLUTIL_H_
  17. //
  18. // Attribute enumeration. Contains the attributes supported by
  19. // the XML_GetAttribute function.
  20. //
  21. typedef enum _tagXML_ATTRIBUTE
  22. {
  23. XML_TITLE = 0,
  24. XML_TITLE_ATTR = 1,
  25. XML_HREF = 2,
  26. XML_ABSTRACT = 3,
  27. XML_ABSTRACT_ATTR = 4,
  28. XML_ICON = 5,
  29. XML_LOGO = 6,
  30. XML_LOGO_DEFAULT = 7,
  31. XML_SELF = 8,
  32. XML_SELF_OLD = 9,
  33. XML_BASE = 10,
  34. XML_USAGE = 11,
  35. XML_USAGE_CHANNEL = 12,
  36. XML_USAGE_DSKCMP = 13,
  37. XML_WIDTH = 14,
  38. XML_HEIGHT = 15,
  39. XML_CANRESIZE = 16,
  40. XML_CANRESIZEX = 17,
  41. XML_CANRESIZEY = 18,
  42. XML_PREFERREDLEFT = 19,
  43. XML_PREFERREDTOP = 20,
  44. XML_OPENAS = 21,
  45. XML_SHOW = 22,
  46. XML_SHOW_CHANNEL = 23,
  47. XML_SHOW_DSKCMP = 24,
  48. XML_A_HREF = 25,
  49. XML_INFOURI = 26,
  50. XML_LOGO_WIDE = 27,
  51. XML_LOGIN = 28,
  52. XML_USAGE_SOFTWAREUPDATE = 29,
  53. XML_SHOW_SOFTWAREUPDATE = 30,
  54. XML_ITEMSTATE = 31,
  55. XML_NULL = 99
  56. } XML_ATTRIBUTE;
  57. //
  58. // XML document types.
  59. //
  60. typedef enum _tagXMLDOCTYPE {
  61. DOC_CHANNEL,
  62. DOC_DESKTOPCOMPONENT,
  63. DOC_SOFTWAREUPDATE,
  64. DOC_UNKNOWN
  65. } XMLDOCTYPE;
  66. //
  67. // Cdf string constants used in XML files.
  68. //
  69. #define WSTR_EMPTY L""
  70. // Elements
  71. #define WSTR_A L"A"
  72. #define WSTR_ABSTRACT L"ABSTRACT"
  73. #define WSTR_RESIZE L"CANRESIZE"
  74. #define WSTR_RESIZEX L"CANRESIZEX"
  75. #define WSTR_RESIZEY L"CANRESIZEY"
  76. #define WSTR_CHANNEL L"CHANNEL"
  77. #define WSTR_DSKCMP L"DESKTOPCOMPONENT"
  78. #define WSTR_HEIGHT L"HEIGHT"
  79. #define WSTR_ITEM L"ITEM"
  80. #define WSTR_LOGIN L"LOGIN"
  81. #define WSTR_LOGO L"LOGO"
  82. #define WSTR_OPENAS L"OPENAS"
  83. #define WSTR_PREFLEFT L"PREFERREDLEFT"
  84. #define WSTR_PREFTOP L"PREFERREDTOP"
  85. #define WSTR_SCRNSAVE L"SCREENSAVER"
  86. #define WSTR_SELF L"SELF"
  87. #define WSTR_SHOW L"SHOW"
  88. #define WSTR_SMARTSCRN L"SMARTSCREEN"
  89. #define WSTR_SOFTDIST L"SOFTPKG"
  90. #define WSTR_TITLE L"TITLE"
  91. #define WSTR_USAGE L"USAGE"
  92. #define WSTR_WIDTH L"WIDTH"
  93. #define WSTR_SOFTWAREUPDATE L"SOFTWAREUPDATE"
  94. #define WSTR_ITEMSTATE L"ITEMSTATE"
  95. // Attributes
  96. #define WSTR_BASE L"BASE"
  97. #define WSTR_HREF L"HREF"
  98. #define WSTR_INFOURI L"INFOURI"
  99. #define WSTR_STYLE L"STYLE"
  100. #define WSTR_VALUE L"VALUE"
  101. // Attribute values.
  102. #define WSTR_ICON L"ICON"
  103. #define WSTR_IMAGE L"IMAGE"
  104. #define WSTR_IMAGEW L"IMAGE-WIDE"
  105. #define WSTR_ZERO L"0"
  106. #define WSTR_YES L"YES"
  107. #define WSTR_HTML L"HTML"
  108. #define WSTR_NORMAL L"NORMAL"
  109. #define WSTR_SPLITSCREEN L"SPLITSCREEN"
  110. #define WSTR_FULLSCREEN L"FULLSCREEN"
  111. //
  112. // Function protoypes.
  113. //
  114. HRESULT XML_SynchronousParse(IXMLDocument* pIXMLDocument,
  115. LPTSTR szPath);
  116. HRESULT XML_DownloadLogo(IXMLDocument* pIXMLDocument);
  117. HRESULT XML_DownloadImages(IXMLDocument* pIXMLDocument);
  118. HRESULT XML_RecursiveImageDownload(IXMLElement* pIXMLElement);
  119. HRESULT XML_DownloadImage(LPCWSTR pwszURL);
  120. XMLDOCTYPE XML_GetDocType(IXMLDocument* pIXMLDocument);
  121. HRESULT XML_GetChildElementCollection(
  122. IXMLElementCollection *pParentIXMLElementCollection,
  123. LONG nIndex,
  124. IXMLElementCollection** ppIXMLElementCollection);
  125. HRESULT XML_GetFirstChannelElement(IXMLDocument* pIXMLDocument,
  126. IXMLElement** ppIXMLElement,
  127. PLONG pnIndex);
  128. HRESULT XML_GetDesktopElementFromChannelElement(
  129. IXMLElement* pChannelIXMLElement,
  130. IXMLElement** ppIXMLElement,
  131. PLONG pnIndex);
  132. HRESULT XML_GetFirstDesktopComponentElement(IXMLDocument* pIXMLDocument,
  133. IXMLElement** ppIXMLElement,
  134. PLONG pnIndex);
  135. HRESULT XML_GetFirstDesktopComponentUsageElement(
  136. IXMLDocument* pIXMLDocument,
  137. IXMLElement** ppIXMLElement);
  138. HRESULT XML_GetDesktopComponentInfo(IXMLDocument* pIXMLDocument,
  139. COMPONENT* pInfo);
  140. HRESULT XML_GetElementByIndex(IXMLElementCollection* pIXMLElementCollection,
  141. LONG nIndex,
  142. IXMLElement** ppIXMLElement);
  143. HRESULT XML_GetElementByName(IXMLElementCollection* pIXMLElementCollection,
  144. LPWSTR szNameW,
  145. IXMLElement** ppIXMLElement);
  146. BSTR XML_GetAttribute(IXMLElement *pIXMLElement,
  147. XML_ATTRIBUTE attribute);
  148. BSTR XML_GetChildAttribute(IXMLElement *pIXMLElement,
  149. LPWSTR szChildW,
  150. LPWSTR szAttributeW,
  151. LPWSTR szQualifierW,
  152. LPWSTR szQualifierValueW);
  153. BSTR XML_GetElementAttribute(IXMLElement *pIXMLElement,
  154. LPWSTR szAttributeW,
  155. LPWSTR szQualifierW,
  156. LPWSTR szQualifierValueW);
  157. HRESULT XML_GetSubscriptionInfo(IXMLElement* pIXMLElement,
  158. SUBSCRIPTIONINFO* psi);
  159. HRESULT XML_GetScreenSaverElement(IXMLElement* pIXMLElement,
  160. IXMLElement** ppScreenSaverElement);
  161. BSTR XML_GetBaseURL(IXMLElement* pIXMLElement);
  162. BSTR XML_CombineURL(BSTR bstrBaseURL, BSTR bstrRelURL);
  163. BOOL XML_IsCdfDisplayable(IXMLElement* pIXMLElement);
  164. BOOL XML_IsSoftDistDisplayable(IXMLElement* pIXMLEelement);
  165. BOOL XML_IsUsageChannel(IXMLElement* pIXMLElement);
  166. BOOL XML_IsScreenSaver(IXMLElement* pIXMLElement);
  167. BOOL XML_IsFolder(IXMLElement* pIXMLElement);
  168. BOOL XML_ContainsFolder(IXMLElementCollection* pIXMLElementCollection);
  169. BOOL XML_ChildContainsFolder(
  170. IXMLElementCollection* pIXMLElementCollectionParent,
  171. ULONG nIndexChild);
  172. BOOL XML_IsChannel(IXMLElement* pIXMLElement);
  173. BOOL XML_IsDesktopComponent(IXMLElement* pIXMLElement);
  174. BOOL XML_IsDesktopComponentUsage(IXMLElement* pIXMLElement);
  175. BOOL XML_IsCdfidlMemberOf(IXMLElementCollection* pIXMLElementCollection,
  176. PCDFITEMIDLIST pcdfidl);
  177. BSTR XML_GetGrandChildContent(IXMLElement* pIXMLElement,
  178. LPWSTR szChildW);
  179. BOOL inline XML_IsStrEqualW(LPWSTR p1, LPWSTR p2);
  180. HRESULT XML_MarkCacheEntrySticky(LPTSTR lpszURL);
  181. HRESULT XML_GetScreenSaverURL(IXMLDocument* pXMLDocument, BSTR* pbstrSSURL);
  182. #endif // _XMLUTIL_H_