PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIURL.h

http://firefox-mac-pdf.googlecode.com/
C Header | 372 lines | 184 code | 44 blank | 144 comment | 0 complexity | 50f050858c7bdc338a554883beb7f567 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/netwerk/base/public/nsIURL.idl
  3. */
  4. #ifndef __gen_nsIURL_h__
  5. #define __gen_nsIURL_h__
  6. #ifndef __gen_nsIURI_h__
  7. #include "nsIURI.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /* starting interface: nsIURL */
  14. #define NS_IURL_IID_STR "d6116970-8034-11d3-9399-00104ba0fd40"
  15. #define NS_IURL_IID \
  16. {0xd6116970, 0x8034, 0x11d3, \
  17. { 0x93, 0x99, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
  18. /**
  19. * The nsIURL interface provides convenience methods that further
  20. * break down the path portion of nsIURI:
  21. *
  22. * http://host/directory/fileBaseName.fileExtension?query
  23. * http://host/directory/fileBaseName.fileExtension#ref
  24. * http://host/directory/fileBaseName.fileExtension;param
  25. * \ \ /
  26. * \ -----------------------
  27. * \ | /
  28. * \ fileName /
  29. * ----------------------------
  30. * |
  31. * filePath
  32. *
  33. * @status FROZEN
  34. */
  35. class NS_NO_VTABLE NS_SCRIPTABLE nsIURL : public nsIURI {
  36. public:
  37. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURL_IID)
  38. /*************************************************************************
  39. * The URL path is broken down into the following principal components:
  40. */
  41. /**
  42. * Returns a path including the directory and file portions of a
  43. * URL. For example, the filePath of "http://host/foo/bar.html#baz"
  44. * is "/foo/bar.html".
  45. *
  46. * Some characters may be escaped.
  47. */
  48. /* attribute AUTF8String filePath; */
  49. NS_SCRIPTABLE NS_IMETHOD GetFilePath(nsACString & aFilePath) = 0;
  50. NS_SCRIPTABLE NS_IMETHOD SetFilePath(const nsACString & aFilePath) = 0;
  51. /**
  52. * Returns the parameters specified after the ; in the URL.
  53. *
  54. * Some characters may be escaped.
  55. */
  56. /* attribute AUTF8String param; */
  57. NS_SCRIPTABLE NS_IMETHOD GetParam(nsACString & aParam) = 0;
  58. NS_SCRIPTABLE NS_IMETHOD SetParam(const nsACString & aParam) = 0;
  59. /**
  60. * Returns the query portion (the part after the "?") of the URL.
  61. * If there isn't one, an empty string is returned.
  62. *
  63. * Some characters may be escaped.
  64. */
  65. /* attribute AUTF8String query; */
  66. NS_SCRIPTABLE NS_IMETHOD GetQuery(nsACString & aQuery) = 0;
  67. NS_SCRIPTABLE NS_IMETHOD SetQuery(const nsACString & aQuery) = 0;
  68. /**
  69. * Returns the reference portion (the part after the "#") of the URL.
  70. * If there isn't one, an empty string is returned.
  71. *
  72. * Some characters may be escaped.
  73. */
  74. /* attribute AUTF8String ref; */
  75. NS_SCRIPTABLE NS_IMETHOD GetRef(nsACString & aRef) = 0;
  76. NS_SCRIPTABLE NS_IMETHOD SetRef(const nsACString & aRef) = 0;
  77. /*************************************************************************
  78. * The URL filepath is broken down into the following sub-components:
  79. */
  80. /**
  81. * Returns the directory portion of a URL. If the URL denotes a path to a
  82. * directory and not a file, e.g. http://host/foo/bar/, then the Directory
  83. * attribute accesses the complete /foo/bar/ portion, and the FileName is
  84. * the empty string. If the trailing slash is omitted, then the Directory
  85. * is /foo/ and the file is bar (i.e. this is a syntactic, not a semantic
  86. * breakdown of the Path). And hence don't rely on this for something to
  87. * be a definitely be a file. But you can get just the leading directory
  88. * portion for sure.
  89. *
  90. * Some characters may be escaped.
  91. */
  92. /* attribute AUTF8String directory; */
  93. NS_SCRIPTABLE NS_IMETHOD GetDirectory(nsACString & aDirectory) = 0;
  94. NS_SCRIPTABLE NS_IMETHOD SetDirectory(const nsACString & aDirectory) = 0;
  95. /**
  96. * Returns the file name portion of a URL. If the URL denotes a path to a
  97. * directory and not a file, e.g. http://host/foo/bar/, then the Directory
  98. * attribute accesses the complete /foo/bar/ portion, and the FileName is
  99. * the empty string. Note that this is purely based on searching for the
  100. * last trailing slash. And hence don't rely on this to be a definite file.
  101. *
  102. * Some characters may be escaped.
  103. */
  104. /* attribute AUTF8String fileName; */
  105. NS_SCRIPTABLE NS_IMETHOD GetFileName(nsACString & aFileName) = 0;
  106. NS_SCRIPTABLE NS_IMETHOD SetFileName(const nsACString & aFileName) = 0;
  107. /*************************************************************************
  108. * The URL filename is broken down even further:
  109. */
  110. /**
  111. * Returns the file basename portion of a filename in a url.
  112. *
  113. * Some characters may be escaped.
  114. */
  115. /* attribute AUTF8String fileBaseName; */
  116. NS_SCRIPTABLE NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) = 0;
  117. NS_SCRIPTABLE NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) = 0;
  118. /**
  119. * Returns the file extension portion of a filename in a url. If a file
  120. * extension does not exist, the empty string is returned.
  121. *
  122. * Some characters may be escaped.
  123. */
  124. /* attribute AUTF8String fileExtension; */
  125. NS_SCRIPTABLE NS_IMETHOD GetFileExtension(nsACString & aFileExtension) = 0;
  126. NS_SCRIPTABLE NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) = 0;
  127. /**
  128. * This method takes a uri and compares the two. The common uri portion
  129. * is returned as a string. The minimum common uri portion is the
  130. * protocol, and any of these if present: login, password, host and port
  131. * If no commonality is found, "" is returned. If they are identical, the
  132. * whole path with file/ref/etc. is returned. For file uris, it is
  133. * expected that the common spec would be at least "file:///" since '/' is
  134. * a shared common root.
  135. *
  136. * Examples:
  137. * this.spec aURIToCompare.spec result
  138. * 1) http://mozilla.org/ http://www.mozilla.org/ ""
  139. * 2) http://foo.com/bar/ ftp://foo.com/bar/ ""
  140. * 3) http://foo.com:8080/ http://foo.com/bar/ ""
  141. * 4) ftp://user@foo.com/ ftp://user:pw@foo.com/ ""
  142. * 5) ftp://foo.com/bar/ ftp://foo.com/bar ftp://foo.com/
  143. * 6) ftp://foo.com/bar/ ftp://foo.com/bar/b.html ftp://foo.com/bar/
  144. * 7) http://foo.com/a.htm#i http://foo.com/b.htm http://foo.com/
  145. * 8) ftp://foo.com/c.htm#i ftp://foo.com/c.htm ftp://foo.com/c.htm
  146. * 9) file:///a/b/c.html file:///d/e/c.html file:///
  147. */
  148. /* AUTF8String getCommonBaseSpec (in nsIURI aURIToCompare); */
  149. NS_SCRIPTABLE NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) = 0;
  150. /**
  151. * This method takes a uri and returns a substring of this if it can be
  152. * made relative to the uri passed in. If no commonality is found, the
  153. * entire uri spec is returned. If they are identical, "" is returned.
  154. * Filename, query, etc are always returned except when uris are identical.
  155. */
  156. /* AUTF8String getRelativeSpec (in nsIURI aURIToCompare); */
  157. NS_SCRIPTABLE NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) = 0;
  158. };
  159. NS_DEFINE_STATIC_IID_ACCESSOR(nsIURL, NS_IURL_IID)
  160. /* Use this macro when declaring classes that implement this interface. */
  161. #define NS_DECL_NSIURL \
  162. NS_SCRIPTABLE NS_IMETHOD GetFilePath(nsACString & aFilePath); \
  163. NS_SCRIPTABLE NS_IMETHOD SetFilePath(const nsACString & aFilePath); \
  164. NS_SCRIPTABLE NS_IMETHOD GetParam(nsACString & aParam); \
  165. NS_SCRIPTABLE NS_IMETHOD SetParam(const nsACString & aParam); \
  166. NS_SCRIPTABLE NS_IMETHOD GetQuery(nsACString & aQuery); \
  167. NS_SCRIPTABLE NS_IMETHOD SetQuery(const nsACString & aQuery); \
  168. NS_SCRIPTABLE NS_IMETHOD GetRef(nsACString & aRef); \
  169. NS_SCRIPTABLE NS_IMETHOD SetRef(const nsACString & aRef); \
  170. NS_SCRIPTABLE NS_IMETHOD GetDirectory(nsACString & aDirectory); \
  171. NS_SCRIPTABLE NS_IMETHOD SetDirectory(const nsACString & aDirectory); \
  172. NS_SCRIPTABLE NS_IMETHOD GetFileName(nsACString & aFileName); \
  173. NS_SCRIPTABLE NS_IMETHOD SetFileName(const nsACString & aFileName); \
  174. NS_SCRIPTABLE NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName); \
  175. NS_SCRIPTABLE NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName); \
  176. NS_SCRIPTABLE NS_IMETHOD GetFileExtension(nsACString & aFileExtension); \
  177. NS_SCRIPTABLE NS_IMETHOD SetFileExtension(const nsACString & aFileExtension); \
  178. NS_SCRIPTABLE NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval); \
  179. NS_SCRIPTABLE NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval);
  180. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  181. #define NS_FORWARD_NSIURL(_to) \
  182. NS_SCRIPTABLE NS_IMETHOD GetFilePath(nsACString & aFilePath) { return _to GetFilePath(aFilePath); } \
  183. NS_SCRIPTABLE NS_IMETHOD SetFilePath(const nsACString & aFilePath) { return _to SetFilePath(aFilePath); } \
  184. NS_SCRIPTABLE NS_IMETHOD GetParam(nsACString & aParam) { return _to GetParam(aParam); } \
  185. NS_SCRIPTABLE NS_IMETHOD SetParam(const nsACString & aParam) { return _to SetParam(aParam); } \
  186. NS_SCRIPTABLE NS_IMETHOD GetQuery(nsACString & aQuery) { return _to GetQuery(aQuery); } \
  187. NS_SCRIPTABLE NS_IMETHOD SetQuery(const nsACString & aQuery) { return _to SetQuery(aQuery); } \
  188. NS_SCRIPTABLE NS_IMETHOD GetRef(nsACString & aRef) { return _to GetRef(aRef); } \
  189. NS_SCRIPTABLE NS_IMETHOD SetRef(const nsACString & aRef) { return _to SetRef(aRef); } \
  190. NS_SCRIPTABLE NS_IMETHOD GetDirectory(nsACString & aDirectory) { return _to GetDirectory(aDirectory); } \
  191. NS_SCRIPTABLE NS_IMETHOD SetDirectory(const nsACString & aDirectory) { return _to SetDirectory(aDirectory); } \
  192. NS_SCRIPTABLE NS_IMETHOD GetFileName(nsACString & aFileName) { return _to GetFileName(aFileName); } \
  193. NS_SCRIPTABLE NS_IMETHOD SetFileName(const nsACString & aFileName) { return _to SetFileName(aFileName); } \
  194. NS_SCRIPTABLE NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) { return _to GetFileBaseName(aFileBaseName); } \
  195. NS_SCRIPTABLE NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) { return _to SetFileBaseName(aFileBaseName); } \
  196. NS_SCRIPTABLE NS_IMETHOD GetFileExtension(nsACString & aFileExtension) { return _to GetFileExtension(aFileExtension); } \
  197. NS_SCRIPTABLE NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) { return _to SetFileExtension(aFileExtension); } \
  198. NS_SCRIPTABLE NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) { return _to GetCommonBaseSpec(aURIToCompare, _retval); } \
  199. NS_SCRIPTABLE NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) { return _to GetRelativeSpec(aURIToCompare, _retval); }
  200. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  201. #define NS_FORWARD_SAFE_NSIURL(_to) \
  202. NS_SCRIPTABLE NS_IMETHOD GetFilePath(nsACString & aFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilePath(aFilePath); } \
  203. NS_SCRIPTABLE NS_IMETHOD SetFilePath(const nsACString & aFilePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilePath(aFilePath); } \
  204. NS_SCRIPTABLE NS_IMETHOD GetParam(nsACString & aParam) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParam(aParam); } \
  205. NS_SCRIPTABLE NS_IMETHOD SetParam(const nsACString & aParam) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetParam(aParam); } \
  206. NS_SCRIPTABLE NS_IMETHOD GetQuery(nsACString & aQuery) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetQuery(aQuery); } \
  207. NS_SCRIPTABLE NS_IMETHOD SetQuery(const nsACString & aQuery) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetQuery(aQuery); } \
  208. NS_SCRIPTABLE NS_IMETHOD GetRef(nsACString & aRef) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRef(aRef); } \
  209. NS_SCRIPTABLE NS_IMETHOD SetRef(const nsACString & aRef) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef); } \
  210. NS_SCRIPTABLE NS_IMETHOD GetDirectory(nsACString & aDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDirectory(aDirectory); } \
  211. NS_SCRIPTABLE NS_IMETHOD SetDirectory(const nsACString & aDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDirectory(aDirectory); } \
  212. NS_SCRIPTABLE NS_IMETHOD GetFileName(nsACString & aFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileName(aFileName); } \
  213. NS_SCRIPTABLE NS_IMETHOD SetFileName(const nsACString & aFileName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileName(aFileName); } \
  214. NS_SCRIPTABLE NS_IMETHOD GetFileBaseName(nsACString & aFileBaseName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileBaseName(aFileBaseName); } \
  215. NS_SCRIPTABLE NS_IMETHOD SetFileBaseName(const nsACString & aFileBaseName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileBaseName(aFileBaseName); } \
  216. NS_SCRIPTABLE NS_IMETHOD GetFileExtension(nsACString & aFileExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileExtension(aFileExtension); } \
  217. NS_SCRIPTABLE NS_IMETHOD SetFileExtension(const nsACString & aFileExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileExtension(aFileExtension); } \
  218. NS_SCRIPTABLE NS_IMETHOD GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCommonBaseSpec(aURIToCompare, _retval); } \
  219. NS_SCRIPTABLE NS_IMETHOD GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeSpec(aURIToCompare, _retval); }
  220. #if 0
  221. /* Use the code below as a template for the implementation class for this interface. */
  222. /* Header file */
  223. class nsURL : public nsIURL
  224. {
  225. public:
  226. NS_DECL_ISUPPORTS
  227. NS_DECL_NSIURL
  228. nsURL();
  229. private:
  230. ~nsURL();
  231. protected:
  232. /* additional members */
  233. };
  234. /* Implementation file */
  235. NS_IMPL_ISUPPORTS1(nsURL, nsIURL)
  236. nsURL::nsURL()
  237. {
  238. /* member initializers and constructor code */
  239. }
  240. nsURL::~nsURL()
  241. {
  242. /* destructor code */
  243. }
  244. /* attribute AUTF8String filePath; */
  245. NS_IMETHODIMP nsURL::GetFilePath(nsACString & aFilePath)
  246. {
  247. return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249. NS_IMETHODIMP nsURL::SetFilePath(const nsACString & aFilePath)
  250. {
  251. return NS_ERROR_NOT_IMPLEMENTED;
  252. }
  253. /* attribute AUTF8String param; */
  254. NS_IMETHODIMP nsURL::GetParam(nsACString & aParam)
  255. {
  256. return NS_ERROR_NOT_IMPLEMENTED;
  257. }
  258. NS_IMETHODIMP nsURL::SetParam(const nsACString & aParam)
  259. {
  260. return NS_ERROR_NOT_IMPLEMENTED;
  261. }
  262. /* attribute AUTF8String query; */
  263. NS_IMETHODIMP nsURL::GetQuery(nsACString & aQuery)
  264. {
  265. return NS_ERROR_NOT_IMPLEMENTED;
  266. }
  267. NS_IMETHODIMP nsURL::SetQuery(const nsACString & aQuery)
  268. {
  269. return NS_ERROR_NOT_IMPLEMENTED;
  270. }
  271. /* attribute AUTF8String ref; */
  272. NS_IMETHODIMP nsURL::GetRef(nsACString & aRef)
  273. {
  274. return NS_ERROR_NOT_IMPLEMENTED;
  275. }
  276. NS_IMETHODIMP nsURL::SetRef(const nsACString & aRef)
  277. {
  278. return NS_ERROR_NOT_IMPLEMENTED;
  279. }
  280. /* attribute AUTF8String directory; */
  281. NS_IMETHODIMP nsURL::GetDirectory(nsACString & aDirectory)
  282. {
  283. return NS_ERROR_NOT_IMPLEMENTED;
  284. }
  285. NS_IMETHODIMP nsURL::SetDirectory(const nsACString & aDirectory)
  286. {
  287. return NS_ERROR_NOT_IMPLEMENTED;
  288. }
  289. /* attribute AUTF8String fileName; */
  290. NS_IMETHODIMP nsURL::GetFileName(nsACString & aFileName)
  291. {
  292. return NS_ERROR_NOT_IMPLEMENTED;
  293. }
  294. NS_IMETHODIMP nsURL::SetFileName(const nsACString & aFileName)
  295. {
  296. return NS_ERROR_NOT_IMPLEMENTED;
  297. }
  298. /* attribute AUTF8String fileBaseName; */
  299. NS_IMETHODIMP nsURL::GetFileBaseName(nsACString & aFileBaseName)
  300. {
  301. return NS_ERROR_NOT_IMPLEMENTED;
  302. }
  303. NS_IMETHODIMP nsURL::SetFileBaseName(const nsACString & aFileBaseName)
  304. {
  305. return NS_ERROR_NOT_IMPLEMENTED;
  306. }
  307. /* attribute AUTF8String fileExtension; */
  308. NS_IMETHODIMP nsURL::GetFileExtension(nsACString & aFileExtension)
  309. {
  310. return NS_ERROR_NOT_IMPLEMENTED;
  311. }
  312. NS_IMETHODIMP nsURL::SetFileExtension(const nsACString & aFileExtension)
  313. {
  314. return NS_ERROR_NOT_IMPLEMENTED;
  315. }
  316. /* AUTF8String getCommonBaseSpec (in nsIURI aURIToCompare); */
  317. NS_IMETHODIMP nsURL::GetCommonBaseSpec(nsIURI *aURIToCompare, nsACString & _retval)
  318. {
  319. return NS_ERROR_NOT_IMPLEMENTED;
  320. }
  321. /* AUTF8String getRelativeSpec (in nsIURI aURIToCompare); */
  322. NS_IMETHODIMP nsURL::GetRelativeSpec(nsIURI *aURIToCompare, nsACString & _retval)
  323. {
  324. return NS_ERROR_NOT_IMPLEMENTED;
  325. }
  326. /* End of implementation class template. */
  327. #endif
  328. #endif /* __gen_nsIURL_h__ */