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