Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
nsEditorParserObserver Class Reference

#include <nsEditorParserObserver.h>

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

List of all members.

Public Types

enum  { IS_DOCUMENT_WRITE = 1U }

Public Member Functions

 nsEditorParserObserver ()
virtual ~nsEditorParserObserver ()
NS_DECL_ISUPPORTS NS_IMETHOD Notify (PRUint32 aDocumentID, eHTMLTags aTag, PRUint32 numOfAttributes, const PRUnichar *nameArray[], const PRUnichar *valueArray[])
NS_IMETHOD Notify (PRUint32 aDocumentID, const PRUnichar *aTag, PRUint32 numOfAttributes, const PRUnichar *nameArray[], const PRUnichar *valueArray[])
NS_IMETHOD Notify (nsISupports *aWebShell, nsISupports *aChannel, const PRUnichar *aTag, const nsStringArray *aKeys, const nsStringArray *aValues, const PRUint32 aFlags)
NS_DECL_NSIOBSERVER NS_IMETHOD Start (eHTMLTags *aWatchTags)
NS_IMETHOD End ()
NS_IMETHOD GetBadTagFound (PRBool *aFound)
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Protected Member Functions

virtual void Notify ()

Protected Attributes

PRBool mBadTagFound

Detailed Description

Definition at line 46 of file nsEditorParserObserver.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
IS_DOCUMENT_WRITE 

Definition at line 63 of file nsIElementObserver.h.


Constructor & Destructor Documentation

Definition at line 53 of file nsEditorParserObserver.cpp.

Definition at line 58 of file nsEditorParserObserver.cpp.

{
}

Member Function Documentation

Definition at line 126 of file nsEditorParserObserver.cpp.

{
  nsresult res = NS_OK;
  nsCOMPtr<nsIParserService> parserService(do_GetService("@mozilla.org/parser/parser-service;1"));

  if (!parserService) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
   
  res = parserService->UnregisterObserver(this,
                                          NS_LITERAL_STRING("text/html"));
  return res;
}

Here is the call graph for this function:

Definition at line 140 of file nsEditorParserObserver.cpp.

{
  NS_ENSURE_ARG_POINTER(aFound);
  *aFound = mBadTagFound;
  return NS_OK; 
}
NS_IMETHODIMP nsEditorParserObserver::Notify ( PRUint32  aDocumentID,
eHTMLTags  aTag,
PRUint32  numOfAttributes,
const PRUnichar nameArray[],
const PRUnichar valueArray[] 
) [virtual]

Implements nsIElementObserver.

Definition at line 74 of file nsEditorParserObserver.cpp.

{
  if (eHTMLTag_frameset == aTag)
  {
    Notify();
    return NS_OK;
  }
  else
    return NS_ERROR_ILLEGAL_VALUE;
}

Here is the call graph for this function:

NS_IMETHODIMP nsEditorParserObserver::Notify ( PRUint32  aDocumentID,
const PRUnichar aTag,
PRUint32  numOfAttributes,
const PRUnichar nameArray[],
const PRUnichar valueArray[] 
) [virtual]

Implements nsIElementObserver.

Definition at line 62 of file nsEditorParserObserver.cpp.

{
  // XXX based on aTag...
  Notify();
  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsEditorParserObserver::Notify ( nsISupports *  aWebShell,
nsISupports *  aChannel,
const PRUnichar aTag,
const nsStringArray *  aKeys,
const nsStringArray *  aValues,
const PRUint32  aFlags 
) [virtual]

Implements nsIElementObserver.

Definition at line 89 of file nsEditorParserObserver.cpp.

{
  Notify();
  return NS_OK;
}

Here is the call graph for this function:

void nsEditorParserObserver::Notify ( ) [protected, virtual]

Definition at line 105 of file nsEditorParserObserver.cpp.

Here is the caller graph for this function:

void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.

Definition at line 110 of file nsEditorParserObserver.cpp.

{
  nsresult res = NS_OK;
  
  nsCOMPtr<nsIParserService> parserService(do_GetService("@mozilla.org/parser/parser-service;1"));
    
  if (!parserService) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  res = parserService->RegisterObserver(this,
                                        NS_LITERAL_STRING("text/html"),
                                        aWatchTags);
  return res;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 85 of file nsEditorParserObserver.h.


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