content/base/public/nsIAttribute.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:3b370aeeb0b8
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #ifndef nsIAttribute_h___
7 #define nsIAttribute_h___
8
9 #include "nsINode.h"
10
11 class nsDOMAttributeMap;
12 class nsIContent;
13
14 #define NS_IATTRIBUTE_IID \
15 { 0x233a9c4d, 0xb27f, 0x4662, \
16 { 0xbd, 0x90, 0xba, 0xd6, 0x2e, 0x76, 0xc8, 0xe1 } }
17
18 class nsIAttribute : public nsINode
19 {
20 public:
21 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)
22
23 virtual void SetMap(nsDOMAttributeMap *aMap) = 0;
24
25 nsDOMAttributeMap *GetMap()
26 {
27 return mAttrMap;
28 }
29
30 nsINodeInfo *NodeInfo() const
31 {
32 return mNodeInfo;
33 }
34
35 /**
36 * Called when our ownerElement is moved into a new document.
37 * Updates the nodeinfo of this node.
38 */
39 virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0;
40
41 protected:
42 #ifdef MOZILLA_INTERNAL_API
43 nsIAttribute(nsDOMAttributeMap *aAttrMap,
44 already_AddRefed<nsINodeInfo>& aNodeInfo,
45 bool aNsAware);
46 #endif //MOZILLA_INTERNAL_API
47 virtual ~nsIAttribute();
48
49 nsRefPtr<nsDOMAttributeMap> mAttrMap;
50 bool mNsAware;
51 };
52
53 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAttribute, NS_IATTRIBUTE_IID)
54
55 #endif /* nsIAttribute_h___ */

mercurial