Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
nsSHEntry Class Reference

#include <nsSHEntry.h>

Inheritance diagram for nsSHEntry:
Inheritance graph
[legend]
Collaboration diagram for nsSHEntry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsSHEntry ()
 nsSHEntry (const nsSHEntry &other)
NS_DECL_ISUPPORTS
NS_DECL_NSIHISTORYENTRY
NS_DECL_NSISHENTRY
NS_DECL_NSISHENTRY_MOZILLA_1_8_BRANCH
NS_DECL_NSISHENTRY_MOZILLA_1_8_BRANCH2
NS_DECL_NSISHCONTAINER
NS_DECL_NSIDOCUMENTOBSERVER
void 
DropPresentationState ()
virtual void BeginUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is beginning.
virtual void EndUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is finished.
virtual void BeginLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load is beginning.
virtual void EndLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load has finished.
virtual void BeginReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is being reflowed in the given presentation shell.
virtual void EndReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is done being reflowed in the given presentation shell.
virtual void CharacterDataChanged (nsIDocument *aDocument, nsIContent *aContent, PRBool aAppend)=0
 Notification that the content model has changed.
virtual void ContentStatesChanged (nsIDocument *aDocument, nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)=0
 Notification that the state of a content node has changed.
virtual void AttributeChanged (nsIDocument *aDocument, nsIContent *aContent, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)=0
 Notification that the content model has changed.
virtual void ContentAppended (nsIDocument *aDocument, nsIContent *aContainer, PRInt32 aNewIndexInContainer)=0
 Notifcation that the content model has had data appended to the given content object.
virtual void ContentInserted (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
 Notification that content has been inserted.
virtual void ContentRemoved (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)=0
 Content has just been removed.
virtual void StyleSheetAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been added to the document.
virtual void StyleSheetRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been removed from the document.
virtual void StyleSheetApplicableStateChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aApplicable)=0
 A StyleSheet has just changed its applicable state.
virtual void StyleRuleChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)=0
 A StyleRule has just been modified within a style sheet.
virtual void StyleRuleAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been added to a style sheet.
virtual void StyleRuleRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been removed from a style sheet.
virtual void DocumentWillBeDestroyed (nsIDocument *aDocument)=0
 The document is in the process of being destroyed.

Private Member Functions

 ~nsSHEntry ()
void RemoveDocumentObserver ()
void DocumentMutated ()

Private Attributes

nsCOMPtr< nsIURImURI
nsCOMPtr< nsIURImReferrerURI
nsCOMPtr< nsIContentViewermContentViewer
nsCOMPtr< nsIDocumentmDocument
nsString mTitle
nsCOMPtr< nsIInputStreammPostData
nsCOMPtr< nsILayoutHistoryStatemLayoutHistoryState
nsCOMArray< nsISHEntrymChildren
PRUint32 mLoadType
PRUint32 mID
PRUint32 mPageIdentifier
PRInt32 mScrollPositionX
PRInt32 mScrollPositionY
PRPackedBool mIsFrameNavigation
PRPackedBool mSaveLayoutState
PRPackedBool mExpired
PRPackedBool mSticky
nsCString mContentType
nsCOMPtr< nsISupports > mCacheKey
nsISHEntrymParent
nsCOMPtr< nsISupports > mWindowState
nsRect mViewerBounds
nsCOMArray< nsIDocShellTreeItemmChildShells
nsCOMPtr< nsISupportsArraymRefreshURIList
nsCOMPtr< nsISupports > mOwner

Detailed Description

Definition at line 62 of file nsSHEntry.h.


Constructor & Destructor Documentation

Definition at line 80 of file nsSHEntry.cpp.

  : mURI(other.mURI)
  , mReferrerURI(other.mReferrerURI)
  // XXX why not copy mDocument?
  , mTitle(other.mTitle)
  , mPostData(other.mPostData)
  , mLayoutHistoryState(other.mLayoutHistoryState)
  , mLoadType(0)         // XXX why not copy?
  , mID(other.mID)
  , mPageIdentifier(other.mPageIdentifier)
  , mScrollPositionX(0)  // XXX why not copy?
  , mScrollPositionY(0)  // XXX why not copy?
  , mIsFrameNavigation(other.mIsFrameNavigation)
  , mSaveLayoutState(other.mSaveLayoutState)
  , mExpired(other.mExpired)
  , mSticky(PR_TRUE)
  // XXX why not copy mContentType?
  , mCacheKey(other.mCacheKey)
  , mParent(other.mParent)
  , mViewerBounds(0, 0, 0, 0)
  , mOwner(other.mOwner)
{
}
nsSHEntry::~nsSHEntry ( ) [private]

Definition at line 113 of file nsSHEntry.cpp.

{
  // Since we never really remove kids from SHEntrys, we need to null
  // out the mParent pointers on all our kids.
  mChildren.EnumerateForwards(ClearParentPtr, nsnull);
  mChildren.Clear();
  RemoveDocumentObserver();
  if (mContentViewer)
    mContentViewer->Destroy();
}

Here is the call graph for this function:


Member Function Documentation

virtual void nsIDocumentObserver::AttributeChanged ( nsIDocument aDocument,
nsIContent aContent,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [pure virtual, inherited]

Notification that the content model has changed.

This method is called automatically by content objects when an attribute's value has changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers document observers.

Parameters:
aDocumentThe document being observed
aContentthe piece of content whose attribute changed
aAttributethe atom name of the attribute
aModTypeWhether or not the attribute was added, changed, or removed. The constants are defined in nsIDOMMutationEvent.h.

Implemented in PresShell, nsContentList, nsXULContentBuilder, nsXULTemplateBuilder, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::BeginLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load is beginning.

Implemented in PresShell.

virtual void nsIDocumentObserver::BeginReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::BeginUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is beginning.

This call can be nested.

Implemented in nsFragmentObserver, PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::CharacterDataChanged ( nsIDocument aDocument,
nsIContent aContent,
PRBool  aAppend 
) [pure virtual, inherited]

Notification that the content model has changed.

This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document (the other notifications are used for that).

Parameters:
aDocumentThe document being observed
aContentthe piece of content that changed
aAppendWhether the change was an append

Implemented in PresShell.

virtual void nsIDocumentObserver::ContentAppended ( nsIDocument aDocument,
nsIContent aContainer,
PRInt32  aNewIndexInContainer 
) [pure virtual, inherited]

Notifcation that the content model has had data appended to the given content object.

This method is called automatically by the content container objects when a new content object is appended to the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a new child appended
aNewIndexInContainerthe index in the container of the first new child

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentInserted ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [pure virtual, inherited]

Notification that content has been inserted.

This method is called automatically by the content container objects when a new content object is inserted in the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that now contains aChild
aChildthe child that was inserted
aIndexInContainerthe index of the child in the container

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentRemoved ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [pure virtual, inherited]

Content has just been removed.

This method is called automatically by content container objects when a content object has just been removed from the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a child removed
aChildthe child that was just removed
aIndexInContainerthe index of the child in the container before it was removed

Implemented in PresShell, nsContentList, nsBindingManager, nsImageMap, nsTreeContentView, and nsXMLPrettyPrinter.

virtual void nsIDocumentObserver::ContentStatesChanged ( nsIDocument aDocument,
nsIContent aContent1,
nsIContent aContent2,
PRInt32  aStateMask 
) [pure virtual, inherited]

Notification that the state of a content node has changed.

(ie: gained or lost focus, became active or hovered over) This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document or the content itself changed (the other notifications are used for that).

The optional second content node is to allow optimization of the case where state moves from one node to another (as is likely for :focus and :hover)

Either content node may be nsnull, but not both

Parameters:
aDocumentThe document being observed
aContent1the piece of content that changed
aContent2optional second piece of content that changed

Implemented in PresShell, and nsTreeContentView.

Definition at line 781 of file nsSHEntry.cpp.

{
  NS_ASSERTION(mContentViewer && mDocument,
               "we shouldn't still be observing the doc");

  // Release the reference to the contentviewer asynconously so that the
  // document doesn't get nuked mid-mutation.
  nsCOMPtr<nsIEventQueue> uiThreadQueue;
  NS_GetMainEventQ(getter_AddRefs(uiThreadQueue));
  if (!uiThreadQueue) {
    return;
  }

  PLEvent *evt = new DestroyViewerEvent(mContentViewer, mDocument);
  if (!evt) {
    return;
  }

  nsresult rv = uiThreadQueue->PostEvent(evt);
  if (NS_FAILED(rv)) {
    PL_DestroyEvent(evt);
  }
  else {
    // Drop presentation. Also ensures that we don't post more then one
    // PLEvent. Only do this if we succeeded in posting the event since
    // otherwise the document could be torn down mid mutation causing crashes.
    DropPresentationState();
  }
  // Warning! The call to DropPresentationState could have dropped the last
  // reference to this nsSHEntry, so no accessing members beyond here.
}

Here is the call graph for this function:

virtual void nsIDocumentObserver::DocumentWillBeDestroyed ( nsIDocument aDocument) [pure virtual, inherited]

The document is in the process of being destroyed.

This method is called automatically during document destruction.

Parameters:
aDocumentThe document being observed

Implemented in nsFragmentObserver, nsDOMStyleSheetList, nsContentList, nsBindingManager, nsXULContentBuilder, nsXULTreeBuilder, nsXULTemplateBuilder, nsTreeContentView, and nsXMLPrettyPrinter.

Definition at line 665 of file nsSHEntry.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::EndLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load has finished.

Note that the associated reflow of the document will be done before EndLoad is invoked, not after.

Implemented in PresShell.

virtual void nsIDocumentObserver::EndReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is done being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::EndUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is finished.

This call can be nested.

Implemented in PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

Definition at line 683 of file nsSHEntry.cpp.

{
  if (mDocument) {
    mDocument->RemoveObserver(this);
    mDocument = nsnull;
  }
}

Here is the caller graph for this function:

virtual void nsIDocumentObserver::StyleRuleAdded ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [pure virtual, inherited]

A StyleRule has just been added to a style sheet.

This method is called automatically when the rule gets added to the sheet. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been modified
aStyleRulethe rule that was added

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleRuleChanged ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aOldStyleRule,
nsIStyleRule aNewStyleRule 
) [pure virtual, inherited]

A StyleRule has just been modified within a style sheet.

This method is called automatically when the rule gets modified. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Since nsIStyleRule objects are immutable, there is a new object replacing the old one. However, the use of this method (rather than StyleRuleAdded and StyleRuleRemoved) implies that the new rule matches the same elements and has the same priority (weight, origin, specificity) as the old one. (However, if it is a CSS style rule, there may be a change in whether it has an important rule.)

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that contians the rule
aOldStyleRuleThe rule being removed. This rule may not be fully valid anymore -- however, it can still be used for pointer comparison and |QueryInterface|.
aNewStyleRuleThe rule being added.

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleRuleRemoved ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [pure virtual, inherited]

A StyleRule has just been removed from a style sheet.

This method is called automatically when the rule gets removed from the sheet. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been modified
aStyleRulethe rule that was removed

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleSheetAdded ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aDocumentSheet 
) [pure virtual, inherited]

A StyleSheet has just been added to the document.

This method is called automatically when a StyleSheet gets added to the document, even if the stylesheet is not applicable. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been added
aDocumentSheetTrue if sheet is in document's style sheet list, false if sheet is not (i.e., UA or user sheet)

Implemented in PresShell, and nsDOMStyleSheetList.

virtual void nsIDocumentObserver::StyleSheetApplicableStateChanged ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aApplicable 
) [pure virtual, inherited]

A StyleSheet has just changed its applicable state.

This method is called automatically when the applicable state of a StyleSheet gets changed. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has changed state
aApplicablePR_TRUE if the sheet is applicable, PR_FALSE if it is not applicable

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleSheetRemoved ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aDocumentSheet 
) [pure virtual, inherited]

A StyleSheet has just been removed from the document.

This method is called automatically when a StyleSheet gets removed from the document, even if the stylesheet is not applicable. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been removed
aDocumentSheetTrue if sheet is in document's style sheet list, false if sheet is not (i.e., UA or user sheet)

Implemented in PresShell, and nsDOMStyleSheetList.


Member Data Documentation

nsCOMPtr<nsISupports> nsSHEntry::mCacheKey [private]

Definition at line 103 of file nsSHEntry.h.

Definition at line 92 of file nsSHEntry.h.

Definition at line 107 of file nsSHEntry.h.

Definition at line 102 of file nsSHEntry.h.

Definition at line 87 of file nsSHEntry.h.

Definition at line 88 of file nsSHEntry.h.

Definition at line 100 of file nsSHEntry.h.

Definition at line 94 of file nsSHEntry.h.

Definition at line 98 of file nsSHEntry.h.

Definition at line 91 of file nsSHEntry.h.

Definition at line 93 of file nsSHEntry.h.

nsCOMPtr<nsISupports> nsSHEntry::mOwner [private]

Definition at line 109 of file nsSHEntry.h.

Definition at line 95 of file nsSHEntry.h.

Definition at line 104 of file nsSHEntry.h.

Definition at line 90 of file nsSHEntry.h.

Definition at line 86 of file nsSHEntry.h.

Definition at line 108 of file nsSHEntry.h.

Definition at line 99 of file nsSHEntry.h.

Definition at line 96 of file nsSHEntry.h.

Definition at line 97 of file nsSHEntry.h.

Definition at line 101 of file nsSHEntry.h.

Definition at line 89 of file nsSHEntry.h.

Definition at line 85 of file nsSHEntry.h.

Definition at line 106 of file nsSHEntry.h.

nsCOMPtr<nsISupports> nsSHEntry::mWindowState [private]

Definition at line 105 of file nsSHEntry.h.


The documentation for this class was generated from the following files: