michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * URI class to be used for cases when a simple URI actually resolves to some michael@0: * other sort of URI, with the latter being what's loaded when the load michael@0: * happens. All objects of this class should always be immutable, so that the michael@0: * inner URI and this URI don't get out of sync. The Clone() implementation michael@0: * will guarantee this for the clone, but it's up to the protocol handlers michael@0: * creating these URIs to ensure that in the first place. The innerURI passed michael@0: * to this URI will be set immutable if possible. michael@0: */ michael@0: michael@0: #ifndef nsSimpleNestedURI_h__ michael@0: #define nsSimpleNestedURI_h__ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsSimpleURI.h" michael@0: #include "nsINestedURI.h" michael@0: michael@0: class nsSimpleNestedURI : public nsSimpleURI, michael@0: public nsINestedURI michael@0: { michael@0: public: michael@0: // To be used by deserialization only. Leaves this object in an michael@0: // uninitialized state that will throw on most accesses. michael@0: nsSimpleNestedURI() michael@0: { michael@0: } michael@0: michael@0: // Constructor that should generally be used when constructing an object of michael@0: // this class with |operator new|. michael@0: nsSimpleNestedURI(nsIURI* innerURI); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_NSINESTEDURI michael@0: michael@0: // Overrides for various methods nsSimpleURI implements follow. michael@0: michael@0: // nsSimpleURI overrides michael@0: virtual nsresult EqualsInternal(nsIURI* other, michael@0: RefHandlingEnum refHandlingMode, michael@0: bool* result); michael@0: virtual nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode); michael@0: michael@0: // nsISerializable overrides michael@0: NS_IMETHOD Read(nsIObjectInputStream* aStream); michael@0: NS_IMETHOD Write(nsIObjectOutputStream* aStream); michael@0: michael@0: // Override the nsIClassInfo method GetClassIDNoAlloc to make sure our michael@0: // nsISerializable impl works right. michael@0: NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc); michael@0: michael@0: protected: michael@0: nsCOMPtr mInnerURI; michael@0: }; michael@0: michael@0: #endif /* nsSimpleNestedURI_h__ */