зеркало из https://github.com/mozilla/gecko-dev.git
COMized API; added Begin/End reflow and Begin/End Load methods
This commit is contained in:
Родитель
627dc37066
Коммит
c9660cdcf8
|
@ -20,13 +20,12 @@
|
|||
|
||||
#include "nsISupports.h"
|
||||
class nsIContent;
|
||||
class nsISubContent;
|
||||
class nsIPresShell;
|
||||
class nsIStyleSheet;
|
||||
class nsString;
|
||||
|
||||
#define NS_IDOCUMENTOBSERVER_IID \
|
||||
{ 0xb3f92460, 0x944c, 0x11d1, \
|
||||
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
#define NS_IDOCUMENT_OBSERVER_IID \
|
||||
{ 0xb3f92460, 0x944c, 0x11d1, {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
// Document observer interface
|
||||
class nsIDocumentObserver : public nsISupports {
|
||||
|
@ -40,13 +39,37 @@ public:
|
|||
* Notify that a content model update is beginning. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void BeginUpdate() = 0;
|
||||
NS_IMETHOD BeginUpdate() = 0;
|
||||
|
||||
/**
|
||||
* Notify that a content model update is finished. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void EndUpdate() = 0;
|
||||
NS_IMETHOD EndUpdate() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load is beginning.
|
||||
*/
|
||||
NS_IMETHOD BeginLoad() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load has finished. Note that
|
||||
* the associated reflow of the document will be done <b>before</b>
|
||||
* EndLoad is invoked, not after.
|
||||
*/
|
||||
NS_IMETHOD EndLoad() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that the document is being reflowed in
|
||||
* the given presentation shell.
|
||||
*/
|
||||
NS_IMETHOD BeginReflow(nsIPresShell* aShell) = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that the document is done being reflowed in
|
||||
* the given presentation shell.
|
||||
*/
|
||||
NS_IMETHOD EndReflow(nsIPresShell* aShell) = 0;
|
||||
|
||||
/**
|
||||
* Notification that the content model has changed. This method is
|
||||
|
@ -64,8 +87,8 @@ public:
|
|||
* @param aSubContent subrange information about the piece of content
|
||||
* that changed
|
||||
*/
|
||||
virtual void ContentChanged(nsIContent* aContent,
|
||||
nsISupports* aSubContent) = 0;
|
||||
NS_IMETHOD ContentChanged(nsIContent* aContent,
|
||||
nsISupports* aSubContent) = 0;
|
||||
|
||||
/**
|
||||
* Notifcation that the content model has had data appended to the
|
||||
|
@ -77,7 +100,7 @@ public:
|
|||
*
|
||||
* @param aContainer the container that had a new child appended
|
||||
*/
|
||||
virtual void ContentAppended(nsIContent* aContainer) = 0;
|
||||
NS_IMETHOD ContentAppended(nsIContent* aContainer) = 0;
|
||||
|
||||
/**
|
||||
* Notification that content has been inserted. This method is called
|
||||
|
@ -90,9 +113,9 @@ public:
|
|||
* @param aChild the child that was inserted
|
||||
* @param aIndexInContainer the index of the child in the container
|
||||
*/
|
||||
virtual void ContentInserted(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentInserted(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Notification that content has been replaced. This method is called
|
||||
|
@ -107,10 +130,10 @@ public:
|
|||
* @param aIndexInContainer the index of the old and new child in the
|
||||
* container
|
||||
*/
|
||||
virtual void ContentReplaced(nsIContent* aContainer,
|
||||
nsIContent* aOldChild,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentReplaced(nsIContent* aContainer,
|
||||
nsIContent* aOldChild,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Content is going to be removed immediately after this call. This
|
||||
|
@ -123,9 +146,9 @@ public:
|
|||
* @param aChild the child that will be removed
|
||||
* @param aIndexInContainer the index of the child in the container
|
||||
*/
|
||||
virtual void ContentWillBeRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentWillBeRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Content has just been removed. This method is called automatically
|
||||
|
@ -139,9 +162,9 @@ public:
|
|||
* @param aIndexInContainer the index of the child in the container
|
||||
* before it was removed
|
||||
*/
|
||||
virtual void ContentHasBeenRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentHasBeenRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* A StyleSheet has just been added to the document.
|
||||
|
@ -151,7 +174,7 @@ public:
|
|||
*
|
||||
* @param aStyleSheet the StyleSheet that has been added
|
||||
*/
|
||||
virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet) = 0;
|
||||
NS_IMETHOD StyleSheetAdded(nsIStyleSheet* aStyleSheet) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIDocumentObserver_h___ */
|
||||
|
|
|
@ -20,13 +20,12 @@
|
|||
|
||||
#include "nsISupports.h"
|
||||
class nsIContent;
|
||||
class nsISubContent;
|
||||
class nsIPresShell;
|
||||
class nsIStyleSheet;
|
||||
class nsString;
|
||||
|
||||
#define NS_IDOCUMENTOBSERVER_IID \
|
||||
{ 0xb3f92460, 0x944c, 0x11d1, \
|
||||
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
#define NS_IDOCUMENT_OBSERVER_IID \
|
||||
{ 0xb3f92460, 0x944c, 0x11d1, {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
||||
// Document observer interface
|
||||
class nsIDocumentObserver : public nsISupports {
|
||||
|
@ -40,13 +39,37 @@ public:
|
|||
* Notify that a content model update is beginning. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void BeginUpdate() = 0;
|
||||
NS_IMETHOD BeginUpdate() = 0;
|
||||
|
||||
/**
|
||||
* Notify that a content model update is finished. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void EndUpdate() = 0;
|
||||
NS_IMETHOD EndUpdate() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load is beginning.
|
||||
*/
|
||||
NS_IMETHOD BeginLoad() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load has finished. Note that
|
||||
* the associated reflow of the document will be done <b>before</b>
|
||||
* EndLoad is invoked, not after.
|
||||
*/
|
||||
NS_IMETHOD EndLoad() = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that the document is being reflowed in
|
||||
* the given presentation shell.
|
||||
*/
|
||||
NS_IMETHOD BeginReflow(nsIPresShell* aShell) = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that the document is done being reflowed in
|
||||
* the given presentation shell.
|
||||
*/
|
||||
NS_IMETHOD EndReflow(nsIPresShell* aShell) = 0;
|
||||
|
||||
/**
|
||||
* Notification that the content model has changed. This method is
|
||||
|
@ -64,8 +87,8 @@ public:
|
|||
* @param aSubContent subrange information about the piece of content
|
||||
* that changed
|
||||
*/
|
||||
virtual void ContentChanged(nsIContent* aContent,
|
||||
nsISupports* aSubContent) = 0;
|
||||
NS_IMETHOD ContentChanged(nsIContent* aContent,
|
||||
nsISupports* aSubContent) = 0;
|
||||
|
||||
/**
|
||||
* Notifcation that the content model has had data appended to the
|
||||
|
@ -77,7 +100,7 @@ public:
|
|||
*
|
||||
* @param aContainer the container that had a new child appended
|
||||
*/
|
||||
virtual void ContentAppended(nsIContent* aContainer) = 0;
|
||||
NS_IMETHOD ContentAppended(nsIContent* aContainer) = 0;
|
||||
|
||||
/**
|
||||
* Notification that content has been inserted. This method is called
|
||||
|
@ -90,9 +113,9 @@ public:
|
|||
* @param aChild the child that was inserted
|
||||
* @param aIndexInContainer the index of the child in the container
|
||||
*/
|
||||
virtual void ContentInserted(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentInserted(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Notification that content has been replaced. This method is called
|
||||
|
@ -107,10 +130,10 @@ public:
|
|||
* @param aIndexInContainer the index of the old and new child in the
|
||||
* container
|
||||
*/
|
||||
virtual void ContentReplaced(nsIContent* aContainer,
|
||||
nsIContent* aOldChild,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentReplaced(nsIContent* aContainer,
|
||||
nsIContent* aOldChild,
|
||||
nsIContent* aNewChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Content is going to be removed immediately after this call. This
|
||||
|
@ -123,9 +146,9 @@ public:
|
|||
* @param aChild the child that will be removed
|
||||
* @param aIndexInContainer the index of the child in the container
|
||||
*/
|
||||
virtual void ContentWillBeRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentWillBeRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* Content has just been removed. This method is called automatically
|
||||
|
@ -139,9 +162,9 @@ public:
|
|||
* @param aIndexInContainer the index of the child in the container
|
||||
* before it was removed
|
||||
*/
|
||||
virtual void ContentHasBeenRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
NS_IMETHOD ContentHasBeenRemoved(nsIContent* aContainer,
|
||||
nsIContent* aChild,
|
||||
PRInt32 aIndexInContainer) = 0;
|
||||
|
||||
/**
|
||||
* A StyleSheet has just been added to the document.
|
||||
|
@ -151,7 +174,7 @@ public:
|
|||
*
|
||||
* @param aStyleSheet the StyleSheet that has been added
|
||||
*/
|
||||
virtual void StyleSheetAdded(nsIStyleSheet* aStyleSheet) = 0;
|
||||
NS_IMETHOD StyleSheetAdded(nsIStyleSheet* aStyleSheet) = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIDocumentObserver_h___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче