michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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 nsChangeObserver_h_ michael@0: #define nsChangeObserver_h_ michael@0: michael@0: class nsIContent; michael@0: class nsIDocument; michael@0: class nsIAtom; michael@0: michael@0: #define NS_DECL_CHANGEOBSERVER \ michael@0: void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute); \ michael@0: void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, int32_t aIndexInContainer); \ michael@0: void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild); michael@0: michael@0: // Something that wants to be alerted to changes in attributes or changes in michael@0: // its corresponding content object. michael@0: // michael@0: // This interface is used by our menu code so we only have to have one michael@0: // nsIDocumentObserver. michael@0: // michael@0: // Any class that implements this interface must take care to unregister itself michael@0: // on deletion. michael@0: class nsChangeObserver michael@0: { michael@0: public: michael@0: // XXX use dom::Element michael@0: virtual void ObserveAttributeChanged(nsIDocument* aDocument, michael@0: nsIContent* aContent, michael@0: nsIAtom* aAttribute)=0; michael@0: michael@0: virtual void ObserveContentRemoved(nsIDocument* aDocument, michael@0: nsIContent* aChild, michael@0: int32_t aIndexInContainer)=0; michael@0: michael@0: virtual void ObserveContentInserted(nsIDocument* aDocument, michael@0: nsIContent* aContainer, michael@0: nsIContent* aChild)=0; michael@0: }; michael@0: michael@0: #endif // nsChangeObserver_h_