1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * the Mozilla Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2006
20 * the Initial Developer. All Rights Reserved.
23 * Boris Zbarsky <bzbarsky@mit.edu> (Original author)
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
40 * URI class to be used for cases when a simple URI actually resolves to some
41 * other sort of URI, with the latter being what's loaded when the load
42 * happens. All objects of this class should always be immutable, so that the
43 * inner URI and this URI don't get out of sync. The Clone() implementation
44 * will guarantee this for the clone, but it's up to the protocol handlers
45 * creating these URIs to ensure that in the first place. The innerURI passed
46 * to this URI will be set immutable if possible.
49 #ifndef nsSimpleNestedURI_h__
50 #define nsSimpleNestedURI_h__
53 #include "nsSimpleURI.h"
54 #include "nsINestedURI.h"
56 class nsSimpleNestedURI
: public nsSimpleURI
,
60 // To be used by deserialization only. Leaves this object in an
61 // uninitialized state that will throw on most accesses.
67 // Constructor that should generally be used when constructing an object of
68 // this class with |operator new|.
69 nsSimpleNestedURI(nsIURI
* innerURI
);
71 NS_DECL_ISUPPORTS_INHERITED
74 // Overrides for various methods nsSimpleURI implements follow.
77 NS_IMETHOD
Equals(nsIURI
* other
, PRBool
*result
);
78 virtual nsSimpleURI
* StartClone();
80 // nsISerializable overrides
81 NS_IMETHOD
Read(nsIObjectInputStream
* aStream
);
82 NS_IMETHOD
Write(nsIObjectOutputStream
* aStream
);
84 // Override the nsIClassInfo method GetClassIDNoAlloc to make sure our
85 // nsISerializable impl works right.
86 NS_IMETHOD
GetClassIDNoAlloc(nsCID
*aClassIDNoAlloc
);
89 nsCOMPtr
<nsIURI
> mInnerURI
;
92 #endif /* nsSimpleNestedURI_h__ */