|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef nsChangeObserver_h_ |
|
8 #define nsChangeObserver_h_ |
|
9 |
|
10 class nsIContent; |
|
11 class nsIDocument; |
|
12 class nsIAtom; |
|
13 |
|
14 #define NS_DECL_CHANGEOBSERVER \ |
|
15 void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute); \ |
|
16 void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, int32_t aIndexInContainer); \ |
|
17 void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild); |
|
18 |
|
19 // Something that wants to be alerted to changes in attributes or changes in |
|
20 // its corresponding content object. |
|
21 // |
|
22 // This interface is used by our menu code so we only have to have one |
|
23 // nsIDocumentObserver. |
|
24 // |
|
25 // Any class that implements this interface must take care to unregister itself |
|
26 // on deletion. |
|
27 class nsChangeObserver |
|
28 { |
|
29 public: |
|
30 // XXX use dom::Element |
|
31 virtual void ObserveAttributeChanged(nsIDocument* aDocument, |
|
32 nsIContent* aContent, |
|
33 nsIAtom* aAttribute)=0; |
|
34 |
|
35 virtual void ObserveContentRemoved(nsIDocument* aDocument, |
|
36 nsIContent* aChild, |
|
37 int32_t aIndexInContainer)=0; |
|
38 |
|
39 virtual void ObserveContentInserted(nsIDocument* aDocument, |
|
40 nsIContent* aContainer, |
|
41 nsIContent* aChild)=0; |
|
42 }; |
|
43 |
|
44 #endif // nsChangeObserver_h_ |