1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/cocoa/nsChangeObserver.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsChangeObserver_h_ 1.11 +#define nsChangeObserver_h_ 1.12 + 1.13 +class nsIContent; 1.14 +class nsIDocument; 1.15 +class nsIAtom; 1.16 + 1.17 +#define NS_DECL_CHANGEOBSERVER \ 1.18 +void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute); \ 1.19 +void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, int32_t aIndexInContainer); \ 1.20 +void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild); 1.21 + 1.22 +// Something that wants to be alerted to changes in attributes or changes in 1.23 +// its corresponding content object. 1.24 +// 1.25 +// This interface is used by our menu code so we only have to have one 1.26 +// nsIDocumentObserver. 1.27 +// 1.28 +// Any class that implements this interface must take care to unregister itself 1.29 +// on deletion. 1.30 +class nsChangeObserver 1.31 +{ 1.32 +public: 1.33 + // XXX use dom::Element 1.34 + virtual void ObserveAttributeChanged(nsIDocument* aDocument, 1.35 + nsIContent* aContent, 1.36 + nsIAtom* aAttribute)=0; 1.37 + 1.38 + virtual void ObserveContentRemoved(nsIDocument* aDocument, 1.39 + nsIContent* aChild, 1.40 + int32_t aIndexInContainer)=0; 1.41 + 1.42 + virtual void ObserveContentInserted(nsIDocument* aDocument, 1.43 + nsIContent* aContainer, 1.44 + nsIContent* aChild)=0; 1.45 +}; 1.46 + 1.47 +#endif // nsChangeObserver_h_