michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: #ifndef nsIAttribute_h___ michael@0: #define nsIAttribute_h___ michael@0: michael@0: #include "nsINode.h" michael@0: michael@0: class nsDOMAttributeMap; michael@0: class nsIContent; michael@0: michael@0: #define NS_IATTRIBUTE_IID \ michael@0: { 0x233a9c4d, 0xb27f, 0x4662, \ michael@0: { 0xbd, 0x90, 0xba, 0xd6, 0x2e, 0x76, 0xc8, 0xe1 } } michael@0: michael@0: class nsIAttribute : public nsINode michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID) michael@0: michael@0: virtual void SetMap(nsDOMAttributeMap *aMap) = 0; michael@0: michael@0: nsDOMAttributeMap *GetMap() michael@0: { michael@0: return mAttrMap; michael@0: } michael@0: michael@0: nsINodeInfo *NodeInfo() const michael@0: { michael@0: return mNodeInfo; michael@0: } michael@0: michael@0: /** michael@0: * Called when our ownerElement is moved into a new document. michael@0: * Updates the nodeinfo of this node. michael@0: */ michael@0: virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0; michael@0: michael@0: protected: michael@0: #ifdef MOZILLA_INTERNAL_API michael@0: nsIAttribute(nsDOMAttributeMap *aAttrMap, michael@0: already_AddRefed& aNodeInfo, michael@0: bool aNsAware); michael@0: #endif //MOZILLA_INTERNAL_API michael@0: virtual ~nsIAttribute(); michael@0: michael@0: nsRefPtr mAttrMap; michael@0: bool mNsAware; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIAttribute, NS_IATTRIBUTE_IID) michael@0: michael@0: #endif /* nsIAttribute_h___ */