Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nsXFormsChoicesElement Class Reference
Inheritance diagram for nsXFormsChoicesElement:
Inheritance graph
[legend]
Collaboration diagram for nsXFormsChoicesElement:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsXFormsChoicesElement ()
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD 
OnCreated (nsIXTFBindableElementWrapper *aWrapper)
NS_IMETHOD ParentChanged (nsIDOMElement *aNewParent)
NS_IMETHOD ChildInserted (nsIDOMNode *aChild, PRUint32 aIndex)
NS_IMETHOD ChildAppended (nsIDOMNode *aChild)
NS_IMETHOD ChildRemoved (PRUint32 aIndex)
NS_IMETHOD BeginAddingChildren ()
NS_IMETHOD DoneAddingChildren ()
void onCreated (in nsIXTFBindableElementWrapper wrapper)
 onCreated will be called before any notifications are sent to the xtf element.
void onDestroyed ()
void getScriptingInterfaces (out unsigned long count,[array, size_is(count), retval] out nsIIDPtr array)
void willChangeDocument (in nsIDOMDocument newDoc)
void documentChanged (in nsIDOMDocument newDoc)
void willChangeParent (in nsIDOMElement newParent)
void parentChanged (in nsIDOMElement newParent)
void willInsertChild (in nsIDOMNode child, in unsigned long index)
void childInserted (in nsIDOMNode child, in unsigned long index)
void willAppendChild (in nsIDOMNode child)
void childAppended (in nsIDOMNode child)
void willRemoveChild (in unsigned long index)
void childRemoved (in unsigned long index)
void willSetAttribute (in nsIAtom name, in AString newValue)
void attributeSet (in nsIAtom name, in AString newValue)
void willRemoveAttribute (in nsIAtom name)
void attributeRemoved (in nsIAtom name)
void beginAddingChildren ()
void doneAddingChildren ()
boolean handleDefault (in nsIDOMEvent aEvent)
void cloneState (in nsIDOMElement aElement)
nsIDOMNode selectItemByValue (in AString value)
nsIDOMNode selectItemByNode (in nsIDOMNode aNode)

Public Attributes

const unsigned long ELEMENT_TYPE_GENERIC_ELEMENT = 0
const unsigned long ELEMENT_TYPE_SVG_VISUAL = 1
const unsigned long ELEMENT_TYPE_XML_VISUAL = 2
const unsigned long ELEMENT_TYPE_XUL_VISUAL = 3
const unsigned long ELEMENT_TYPE_BINDABLE = 4
readonly attribute unsigned long elementType
readonly attribute boolean isAttributeHandler
const unsigned long NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001
const unsigned long NOTIFY_DOCUMENT_CHANGED = 0x00000002
const unsigned long NOTIFY_WILL_CHANGE_PARENT = 0x00000004
const unsigned long NOTIFY_PARENT_CHANGED = 0x00000008
const unsigned long NOTIFY_WILL_INSERT_CHILD = 0x00000010
const unsigned long NOTIFY_CHILD_INSERTED = 0x00000020
const unsigned long NOTIFY_WILL_APPEND_CHILD = 0x00000040
const unsigned long NOTIFY_CHILD_APPENDED = 0x00000080
const unsigned long NOTIFY_WILL_REMOVE_CHILD = 0x00000100
const unsigned long NOTIFY_CHILD_REMOVED = 0x00000200
const unsigned long NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400
const unsigned long NOTIFY_ATTRIBUTE_SET = 0x00000800
const unsigned long NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000
const unsigned long NOTIFY_ATTRIBUTE_REMOVED = 0x00002000
const unsigned long NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000
const unsigned long NOTIFY_DONE_ADDING_CHILDREN = 0x00008000
const unsigned long NOTIFY_HANDLE_DEFAULT = 0x00010000

Private Member Functions

void Refresh ()

Private Attributes

nsIDOMElementmElement
PRBool mDoneAddingChildren

Detailed Description

Definition at line 50 of file nsXFormsChoicesElement.cpp.


Constructor & Destructor Documentation


Member Function Documentation

void nsIXTFElement::attributeSet ( in nsIAtom  name,
in AString  newValue 
) [inherited]

Definition at line 158 of file nsXFormsChoicesElement.cpp.

{
  // Suppress child notifications until we're done getting children.
  nsCOMPtr<nsIXTFElementWrapper> wrapper = do_QueryInterface(mElement);
  NS_ASSERTION(wrapper, "huh? our element must be an xtf wrapper");

  wrapper->SetNotificationMask(nsIXTFElement::NOTIFY_PARENT_CHANGED |
                               nsIXTFElement::NOTIFY_DONE_ADDING_CHILDREN);

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 133 of file nsXFormsChoicesElement.cpp.

{
  nsCOMPtr<nsIXFormsSelectChild> item = do_QueryInterface(aChild);
  if (item) {
    // XXX get anonymous nodes and insert them at the correct place
  } else if (nsXFormsUtils::IsLabelElement(aChild)) {
    // If a label child was inserted, we need to clone it into our
    // anonymous content.
    Refresh();
  }

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 118 of file nsXFormsChoicesElement.cpp.

{
  nsCOMPtr<nsIXFormsSelectChild> item = do_QueryInterface(aChild);
  if (item) {
    // XXX get anonymous nodes and insert them at the correct place
  } else if (nsXFormsUtils::IsLabelElement(aChild)) {
    // If a label child was inserted, we need to clone it into our
    // anonymous content.
    Refresh();
  }
    
  return NS_OK;
}

Here is the call graph for this function:

void nsIXTFElement::childInserted ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]

Definition at line 148 of file nsXFormsChoicesElement.cpp.

{
  // XXX: only need to Refresh() when a label child is removed, but it's
  // not possible to get ahold of the actual removed child at this point.

  Refresh();
  return NS_OK;
}

Here is the call graph for this function:

void nsIXTFElement::childRemoved ( in unsigned long  index) [inherited]
void nsIXTFElement::cloneState ( in nsIDOMElement  aElement) [inherited]

Definition at line 171 of file nsXFormsChoicesElement.cpp.

{
  mDoneAddingChildren = PR_TRUE;

  // Unsuppress notifications
  nsCOMPtr<nsIXTFElementWrapper> wrapper = do_QueryInterface(mElement);
  NS_ASSERTION(wrapper, "huh? our element must be an xtf wrapper");

  wrapper->SetNotificationMask(nsIXTFElement::NOTIFY_PARENT_CHANGED |
                               nsIXTFElement::NOTIFY_CHILD_INSERTED |
                               nsIXTFElement::NOTIFY_CHILD_APPENDED |
                               nsIXTFElement::NOTIFY_CHILD_REMOVED);

  // Assume that we've got something worth refreshing now.
  Refresh();
  return NS_OK;
}

Here is the call graph for this function:

void nsIXTFElement::getScriptingInterfaces ( out unsigned long  count,
[array, size_is(count), retval] out nsIIDPtr  array 
) [inherited]

onCreated will be called before any notifications are sent to the xtf element.

Parameters:
wrapperis a weak proxy to the wrapping element (i.e. holding a reference to this will not create a cycle).

Definition at line 109 of file nsXFormsChoicesElement.cpp.

{
  if (aNewParent) {
    Refresh();
  }
  return NS_OK;
}

Here is the call graph for this function:

void nsIXTFElement::parentChanged ( in nsIDOMElement  newParent) [inherited]

Definition at line 253 of file nsXFormsChoicesElement.cpp.

{
  if (mDoneAddingChildren) {
    nsCOMPtr<nsIDOMNode> parent, current;
    current = mElement;
    do {
      current->GetParentNode(getter_AddRefs(parent));
      if (nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("select1")) ||
          nsXFormsUtils::IsXFormsElement(parent, NS_LITERAL_STRING("select"))) {
        nsCOMPtr<nsIXFormsControl> select(do_QueryInterface(parent));
        if (select) {
          select->Refresh();
        }
        return;
      }
      current = parent;
    } while(current);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIDOMNode nsIXFormsSelectChild::selectItemByValue ( in AString  value) [inherited]
void nsIXTFElement::willInsertChild ( in nsIDOMNode  child,
in unsigned long  index 
) [inherited]
void nsIXTFElement::willRemoveChild ( in unsigned long  index) [inherited]
void nsIXTFElement::willSetAttribute ( in nsIAtom  name,
in AString  newValue 
) [inherited]

Member Data Documentation

Definition at line 72 of file nsIXTFElement.idl.

Definition at line 56 of file nsIXTFElement.idl.

Definition at line 60 of file nsIXTFElement.idl.

Definition at line 64 of file nsIXTFElement.idl.

Definition at line 68 of file nsIXTFElement.idl.

readonly attribute unsigned long nsIXTFElement::elementType [inherited]

Definition at line 78 of file nsIXTFElement.idl.

Definition at line 86 of file nsIXTFElement.idl.

Definition at line 73 of file nsXFormsChoicesElement.cpp.

Definition at line 72 of file nsXFormsChoicesElement.cpp.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_REMOVED = 0x00002000 [inherited]

Definition at line 118 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_ATTRIBUTE_SET = 0x00000800 [inherited]

Definition at line 115 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_BEGIN_ADDING_CHILDREN = 0x00004000 [inherited]

Definition at line 120 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_APPENDED = 0x00000080 [inherited]

Definition at line 109 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_INSERTED = 0x00000020 [inherited]

Definition at line 106 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_CHILD_REMOVED = 0x00000200 [inherited]

Definition at line 112 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DOCUMENT_CHANGED = 0x00000002 [inherited]

Definition at line 100 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_DONE_ADDING_CHILDREN = 0x00008000 [inherited]

Definition at line 121 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_HANDLE_DEFAULT = 0x00010000 [inherited]

Definition at line 123 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_PARENT_CHANGED = 0x00000008 [inherited]

Definition at line 103 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_APPEND_CHILD = 0x00000040 [inherited]

Definition at line 108 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_DOCUMENT = 0x00000001 [inherited]

Definition at line 99 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_CHANGE_PARENT = 0x00000004 [inherited]

Definition at line 102 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_INSERT_CHILD = 0x00000010 [inherited]

Definition at line 105 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_ATTRIBUTE = 0x00001000 [inherited]

Definition at line 117 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_REMOVE_CHILD = 0x00000100 [inherited]

Definition at line 111 of file nsIXTFElement.idl.

const unsigned long nsIXTFElement::NOTIFY_WILL_SET_ATTRIBUTE = 0x00000400 [inherited]

Definition at line 114 of file nsIXTFElement.idl.


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