Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsXULCommandDispatcher Class Reference

#include <nsXULCommandDispatcher.h>

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

List of all members.

Classes

class  Updater

Public Member Functions

void Disconnect ()
void addCommandUpdater (in nsIDOMElement updater, in DOMString events, in DOMString targets)
void removeCommandUpdater (in nsIDOMElement updater)
void updateCommands (in DOMString eventName)
nsIController getControllerForCommand (in string command)
nsIControllers getControllers ()
void advanceFocus ()
void rewindFocus ()
void advanceFocusIntoSubtree (in nsIDOMElement elt)

Static Public Member Functions

static NS_IMETHODIMP Create (nsIDocument *aDocument, nsXULCommandDispatcher **aResult)

Public Attributes

attribute nsIDOMElement focusedElement
attribute nsIDOMWindow focusedWindow
attribute boolean suppressFocusScroll

Protected Member Functions

 nsXULCommandDispatcher (nsIDocument *aDocument)
virtual ~nsXULCommandDispatcher ()
void EnsureFocusController ()
PRBool Matches (const nsString &aList, const nsAString &aElement)

Protected Attributes

nsIFocusControllermFocusController
nsIDocumentmDocument
UpdatermUpdaters

Detailed Description

Definition at line 60 of file nsXULCommandDispatcher.h.


Constructor & Destructor Documentation

Definition at line 79 of file nsXULCommandDispatcher.cpp.

    : mFocusController(nsnull), mDocument(aDocument), mUpdaters(nsnull)
{

#ifdef PR_LOGGING
  if (! gLog)
    gLog = PR_NewLogModule("nsXULCommandDispatcher");
#endif
}

Definition at line 89 of file nsXULCommandDispatcher.cpp.

{
  while (mUpdaters) {
    Updater* doomed = mUpdaters;
    mUpdaters = mUpdaters->mNext;
    delete doomed;
  }
}

Member Function Documentation

void nsIDOMXULCommandDispatcher::addCommandUpdater ( in nsIDOMElement  updater,
in DOMString  events,
in DOMString  targets 
) [inherited]

Definition at line 112 of file nsXULCommandDispatcher.cpp.

{
  nsXULCommandDispatcher* dispatcher = new nsXULCommandDispatcher(aDoc);
  if (!dispatcher)
    return NS_ERROR_OUT_OF_MEMORY;

  *aResult = dispatcher;
  NS_ADDREF(*aResult);
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 73 of file nsXULCommandDispatcher.h.

Definition at line 124 of file nsXULCommandDispatcher.cpp.

{
  if (!mFocusController && mDocument) {
    nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(mDocument->GetScriptGlobalObject()));
  
    // An inelegant way to retrieve this to be sure, but we are
    // guaranteed that the focus controller outlives us, so it
    // is safe to hold on to it (since we can't die until it has
    // died).
    mFocusController = win->GetRootFocusController(); // Store as a weak ptr.
  }
}

Here is the call graph for this function:

PRBool nsXULCommandDispatcher::Matches ( const nsString aList,
const nsAString &  aElement 
) [protected]

Definition at line 441 of file nsXULCommandDispatcher.cpp.

{
  if (aList.EqualsLiteral("*"))
    return PR_TRUE; // match _everything_!

  PRInt32 indx = aList.Find(PromiseFlatString(aElement));
  if (indx == -1)
    return PR_FALSE; // not in the list at all

  // okay, now make sure it's not a substring snafu; e.g., 'ur'
  // found inside of 'blur'.
  if (indx > 0) {
    PRUnichar ch = aList[indx - 1];
    if (! nsCRT::IsAsciiSpace(ch) && ch != PRUnichar(','))
      return PR_FALSE;
  }

  if (indx + aElement.Length() < aList.Length()) {
    PRUnichar ch = aList[indx + aElement.Length()];
    if (! nsCRT::IsAsciiSpace(ch) && ch != PRUnichar(','))
      return PR_FALSE;
  }

  return PR_TRUE;
}
void nsIDOMXULCommandDispatcher::updateCommands ( in DOMString  eventName) [inherited]

Member Data Documentation

Definition at line 51 of file nsIDOMXULCommandDispatcher.idl.

Definition at line 52 of file nsIDOMXULCommandDispatcher.idl.

Definition at line 87 of file nsXULCommandDispatcher.h.

Definition at line 86 of file nsXULCommandDispatcher.h.

Definition at line 106 of file nsXULCommandDispatcher.h.

Definition at line 67 of file nsIDOMXULCommandDispatcher.idl.


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