Back to index

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

#include <nsFormFillController.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIFORMFILLCONTROLLER
NS_DECL_NSIAUTOCOMPLETESEARCH
NS_DECL_NSIAUTOCOMPLETEINPUT
NS_DECL_NSIAUTOCOMPLETEINPUT_MOZILLA_1_8_BRANCH
NS_DECL_NSIDOMEVENTLISTENER
NS_IMETHOD 
Focus (nsIDOMEvent *aEvent)
 Processes a focus event.
NS_IMETHOD Blur (nsIDOMEvent *aEvent)
 Processes a blur event.
NS_IMETHOD KeyDown (nsIDOMEvent *aKeyEvent)
 Processes a key pressed event.
NS_IMETHOD KeyUp (nsIDOMEvent *aKeyEvent)
 Processes a key release event.
NS_IMETHOD KeyPress (nsIDOMEvent *aKeyEvent)
 Processes a key typed event.
NS_IMETHOD HandleStartComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleEndComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleQueryComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleQueryReconversion (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleQueryCaretRect (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD Submit (nsIDOMEvent *aEvent)
 Processes a form submit event.
NS_IMETHOD Reset (nsIDOMEvent *aEvent)
 Processes a form reset event.
NS_IMETHOD Change (nsIDOMEvent *aEvent)
 Processes a form change event.
NS_IMETHOD Select (nsIDOMEvent *aEvent)
 Processes a form select event.
NS_IMETHOD Input (nsIDOMEvent *aEvent)
 Processes a form input event.
NS_IMETHOD MouseDown (nsIDOMEvent *aMouseEvent)
 Processes a mouse down event.
NS_IMETHOD MouseUp (nsIDOMEvent *aMouseEvent)
 Processes a mouse up event.
NS_IMETHOD MouseClick (nsIDOMEvent *aMouseEvent)
 Processes a mouse click event.
NS_IMETHOD MouseDblClick (nsIDOMEvent *aMouseEvent)
 Processes a mouse click event.
NS_IMETHOD MouseOver (nsIDOMEvent *aMouseEvent)
 Processes a mouse enter event.
NS_IMETHOD MouseOut (nsIDOMEvent *aMouseEvent)
 Processes a mouse leave event.
NS_IMETHOD Load (nsIDOMEvent *aLoadEvent)
 Processes a page or image load event.
NS_IMETHOD BeforeUnload (nsIDOMEvent *aLoadEvent)
 Processes a page beforeUnload event.
NS_IMETHOD Unload (nsIDOMEvent *aLoadEvent)
 Processes a page unload event.
NS_IMETHOD Abort (nsIDOMEvent *aLoadEvent)
 Processes a load abort event.
NS_IMETHOD Error (nsIDOMEvent *aLoadEvent)
 Processes an load error event.
NS_IMETHOD ContextMenu (nsIDOMEvent *aContextMenuEvent)
 Processes a context menu event.
 nsFormFillController ()
virtual ~nsFormFillController ()
void attachToBrowser (in nsIDocShell docShell, in nsIAutoCompletePopup popup)
void detachFromBrowser (in nsIDocShell docShell)
ACString getSearchAt (in unsigned long index)
void selectTextRange (in long startIndex, in long endIndex)
void onSearchComplete ()
boolean onTextEntered ()
boolean onTextReverted ()
void startSearch (in AString searchString, in AString searchParam, in nsIAutoCompleteResult previousResult, in nsIAutoCompleteObserver listener)
void stopSearch ()
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Public Attributes

readonly attribute boolean consumeRollupEvent
readonly attribute
nsIAutoCompletePopup 
popup
readonly attribute
nsIAutoCompleteController 
controller
attribute boolean popupOpen
attribute boolean disableAutoComplete
attribute boolean completeDefaultIndex
attribute boolean completeSelectedIndex
attribute boolean forceComplete
attribute unsigned long minResultsForPopup
attribute unsigned long maxRows
attribute unsigned long showCommentColumn
attribute unsigned long timeout
attribute AString searchParam
readonly attribute unsigned long searchCount
attribute AString textValue
readonly attribute long selectionStart
readonly attribute long selectionEnd

Protected Member Functions

void AddWindowListeners (nsIDOMWindow *aWindow)
void RemoveWindowListeners (nsIDOMWindow *aWindow)
void AddKeyListener (nsIDOMHTMLInputElement *aInput)
void RemoveKeyListener ()
void StartControllingInput (nsIDOMHTMLInputElement *aInput)
void StopControllingInput ()
PRBool RowMatch (nsFormHistory *aHistory, PRUint32 aIndex, const nsAString &aInputName, const nsAString &aInputValue)
nsIDocShellGetDocShellForInput (nsIDOMHTMLInputElement *aInput)
nsIDOMWindowGetWindowForDocShell (nsIDocShell *aDocShell)
PRInt32 GetIndexOfDocShell (nsIDocShell *aDocShell)

Protected Attributes

nsCOMPtr
< nsIAutoCompleteController
mController
nsCOMPtr< nsIDOMHTMLInputElementmFocusedInput
nsCOMPtr< nsIAutoCompletePopupmFocusedPopup
nsCOMPtr< nsISupportsArraymDocShells
nsCOMPtr< nsISupportsArraymPopups
PRUint32 mTimeout
PRUint32 mMinResultsForPopup
PRUint32 mMaxRows
PRPackedBool mDisableAutoComplete
PRPackedBool mCompleteDefaultIndex
PRPackedBool mCompleteSelectedIndex
PRPackedBool mForceComplete
PRPackedBool mSuppressOnInput
PRPackedBool mIgnoreClick

Detailed Description

Definition at line 63 of file nsFormFillController.h.


Constructor & Destructor Documentation

Definition at line 99 of file nsFormFillController.cpp.

                                           :
  mTimeout(50),
  mMinResultsForPopup(1),
  mMaxRows(0),
  mDisableAutoComplete(PR_FALSE), 
  mCompleteDefaultIndex(PR_FALSE),
  mCompleteSelectedIndex(PR_FALSE),
  mForceComplete(PR_FALSE),
  mSuppressOnInput(PR_FALSE)
{
  mController = do_CreateInstance("@mozilla.org/autocomplete/controller;1");

  mDocShells = do_CreateInstance("@mozilla.org/supports-array;1");
  mPopups = do_CreateInstance("@mozilla.org/supports-array;1");
}

Here is the call graph for this function:

Definition at line 115 of file nsFormFillController.cpp.

{
  // Remove ourselves as a focus listener from all cached docShells
  PRUint32 count;
  mDocShells->Count(&count);
  for (PRUint32 i = 0; i < count; ++i) {
    nsCOMPtr<nsIDocShell> docShell;
    mDocShells->GetElementAt(i, getter_AddRefs(docShell));
    nsCOMPtr<nsIDOMWindow> domWindow = GetWindowForDocShell(docShell);
    RemoveWindowListeners(domWindow);
  }
}

Here is the call graph for this function:


Member Function Documentation

Processes a load abort event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 922 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Definition at line 1053 of file nsFormFillController.cpp.

{
  if (!aInput)
    return;

    nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aInput);

    target->AddEventListener(NS_LITERAL_STRING("keypress"),
                             NS_STATIC_CAST(nsIDOMKeyListener *, this),
                             PR_TRUE);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 945 of file nsFormFillController.cpp.

{
  if (!aWindow)
    return;

  nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
  nsIChromeEventHandler* chromeEventHandler = nsnull;
  if (privateDOMWindow)
    chromeEventHandler = privateDOMWindow->GetChromeEventHandler();

  nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));

  if (!target)
    return;

  target->AddEventListener(NS_LITERAL_STRING("focus"),
                           NS_STATIC_CAST(nsIDOMFocusListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("blur"),
                           NS_STATIC_CAST(nsIDOMFocusListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("mousedown"),
                           NS_STATIC_CAST(nsIDOMMouseListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("click"),
                           NS_STATIC_CAST(nsIDOMMouseListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("input"),
                           NS_STATIC_CAST(nsIDOMFormListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("unload"),
                           NS_STATIC_CAST(nsIDOMLoadListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("compositionstart"),
                           NS_STATIC_CAST(nsIDOMCompositionListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("compositionend"),
                           NS_STATIC_CAST(nsIDOMCompositionListener *, this),
                           PR_TRUE);

  target->AddEventListener(NS_LITERAL_STRING("contextmenu"),
                           NS_STATIC_CAST(nsIDOMContextMenuListener *, this),
                           PR_TRUE);
}

Here is the call graph for this function:

Processes a page beforeUnload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 898 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a blur event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 616 of file nsFormFillController.cpp.

Here is the call graph for this function:

Processes a form change event.

Parameters:
aEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFormListener.

Definition at line 776 of file nsFormFillController.cpp.

{
  return NS_OK;
}
NS_IMETHODIMP nsFormFillController::ContextMenu ( nsIDOMEvent aContextMenuEvent) [virtual]

Processes a context menu event.

Parameters:
aContextMenuEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMContextMenuListener.

Definition at line 934 of file nsFormFillController.cpp.

{
  if (mFocusedPopup)
    mFocusedPopup->ClosePopup();
  return NS_OK;
}

Processes an load error event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 928 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a focus event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 583 of file nsFormFillController.cpp.

{
  nsCOMPtr<nsIDOMEventTarget> target;
  aEvent->GetTarget(getter_AddRefs(target));
  
  nsCOMPtr<nsIDOMHTMLInputElement> input = do_QueryInterface(target);
  if (!input)
    return NS_OK;
    
    nsAutoString type;
    input->GetType(type);

    PRBool isReadOnly = PR_FALSE;
    input->GetReadOnly(&isReadOnly);
                                  
    nsAutoString autocomplete; 
    input->GetAttribute(NS_LITERAL_STRING("autocomplete"), autocomplete);
    if (type.Equals(NS_LITERAL_STRING("text")) && !isReadOnly &&
        !autocomplete.EqualsIgnoreCase("off")) {

      nsCOMPtr<nsIDOMHTMLFormElement> form;
      input->GetForm(getter_AddRefs(form));
      if (form)
        form->GetAttribute(NS_LITERAL_STRING("autocomplete"), autocomplete);

      if (!form || !autocomplete.EqualsIgnoreCase("off"))
        StartControllingInput(input);
    }
    
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 1118 of file nsFormFillController.cpp.

{
  nsCOMPtr<nsIDOMDocument> domDoc;
  aInput->GetOwnerDocument(getter_AddRefs(domDoc));
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
  NS_ENSURE_TRUE(doc, nsnull);
  nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(doc->GetScriptGlobalObject());
  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
  return docShell;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 nsFormFillController::GetIndexOfDocShell ( nsIDocShell aDocShell) [inline, protected]

Definition at line 1146 of file nsFormFillController.cpp.

{
  if (!aDocShell)
    return -1;

  // Loop through our cached docShells looking for the given docShell
  PRUint32 count;
  mDocShells->Count(&count);
  for (PRUint32 i = 0; i < count; ++i) {
    nsCOMPtr<nsIDocShell> docShell;
    mDocShells->GetElementAt(i, getter_AddRefs(docShell));
    if (docShell == aDocShell)
      return i;
  }

  // Recursively check the parent docShell of this one
  nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(aDocShell);
  nsCOMPtr<nsIDocShellTreeItem> parentItem;
  treeItem->GetParent(getter_AddRefs(parentItem));
  if (parentItem) {
    nsCOMPtr<nsIDocShell> parentShell = do_QueryInterface(parentItem);
    return GetIndexOfDocShell(parentShell);
  }
    
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ACString nsIAutoCompleteInput::getSearchAt ( in unsigned long  index) [inherited]

Definition at line 1130 of file nsFormFillController.cpp.

{
  nsCOMPtr<nsIContentViewer> contentViewer;
  aDocShell->GetContentViewer(getter_AddRefs(contentViewer));
  NS_ENSURE_TRUE(contentViewer, nsnull);

  nsCOMPtr<nsIDOMDocument> domDoc;
  contentViewer->GetDOMDocument(getter_AddRefs(domDoc));
  nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
  NS_ENSURE_TRUE(doc, nsnull);

  nsCOMPtr<nsIDOMWindow> domWindow = do_QueryInterface(doc->GetScriptGlobalObject());
  return domWindow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements nsIDOMCompositionListener.

Definition at line 729 of file nsFormFillController.cpp.

{
  NS_ASSERTION(mController, "should have a controller!");

  if (mController && mFocusedInput)
    mController->HandleEndComposition();

  return NS_OK;
}

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Implements nsIDOMCompositionListener.

Definition at line 752 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Implements nsIDOMCompositionListener.

Definition at line 740 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Implements nsIDOMCompositionListener.

Definition at line 746 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Implements nsIDOMCompositionListener.

Definition at line 718 of file nsFormFillController.cpp.

{
  NS_ASSERTION(mController, "should have a controller!");

  if (mController && mFocusedInput)
    mController->HandleStartComposition();

  return NS_OK;
}

Processes a form input event.

Parameters:
aEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFormListener.

Definition at line 788 of file nsFormFillController.cpp.

{
  if (mSuppressOnInput || !mController || !mFocusedInput)
    return NS_OK;

  return mController->HandleText(PR_FALSE);
}

Processes a key pressed event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 628 of file nsFormFillController.cpp.

{
  return NS_OK;
} 

Processes a key typed event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 640 of file nsFormFillController.cpp.

{
  NS_ASSERTION(mController, "should have a controller!");
  if (!mFocusedInput || !mController)
    return NS_OK;

  nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
  if (!keyEvent)
    return NS_ERROR_FAILURE;

  PRBool cancel = PR_FALSE;

  PRUint32 k;
  keyEvent->GetKeyCode(&k);
  switch (k) {
  case nsIDOMKeyEvent::DOM_VK_DELETE:
#ifndef XP_MACOSX
    mController->HandleDelete(&cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_BACK_SPACE:
    mController->HandleText(PR_FALSE);
    break;
#else
  case nsIDOMKeyEvent::DOM_VK_BACK_SPACE:
    {
      PRBool isShift = PR_FALSE;
      keyEvent->GetShiftKey(&isShift);

      if (isShift)
        mController->HandleDelete(&cancel);
      else
        mController->HandleText(PR_FALSE);

      break;
    }
#endif
  case nsIDOMKeyEvent::DOM_VK_UP:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_UP, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_DOWN:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_DOWN, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_LEFT:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_LEFT, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_RIGHT:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_RIGHT, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_PAGE_UP:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_PAGE_UP, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_PAGE_DOWN:
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_PAGE_DOWN, &cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_ESCAPE:
    mController->HandleEscape(&cancel);
    break;
  case nsIDOMKeyEvent::DOM_VK_TAB:
    mController->HandleTab();
    cancel = PR_FALSE;
    break;
  case nsIDOMKeyEvent::DOM_VK_RETURN:
    mController->HandleEnter(&cancel);
    break;
  }
  
  if (cancel) {
    aEvent->StopPropagation();
    aEvent->PreventDefault();
  }
  
  return NS_OK;
}

Here is the call graph for this function:

Processes a key release event.

Parameters:
aKeyEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMKeyListener.

Definition at line 634 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a page or image load event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 892 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a mouse click event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 825 of file nsFormFillController.cpp.

{
  if (mIgnoreClick) {
    mIgnoreClick = PR_FALSE;
    return NS_OK;
  }

  if (!mFocusedInput)
    return NS_OK;

  nsCOMPtr<nsIDOMMouseEvent> mouseEvent(do_QueryInterface(aMouseEvent));
  if (!mouseEvent)
    return NS_ERROR_FAILURE;

  PRUint16 button;
  mouseEvent->GetButton(&button);
  if (button != 0)
    return NS_OK;

  PRBool isOpen = PR_FALSE;
  GetPopupOpen(&isOpen);
  if (isOpen)
    return NS_OK;

  nsCOMPtr<nsIAutoCompleteInput> input;
  mController->GetInput(getter_AddRefs(input));
  if (!input)
    return NS_OK;

  nsAutoString value;
  input->GetTextValue(value);
  if (value.Length() > 0) {
    // Show the popup with a filtered result set
    mController->SetSearchString(EmptyString());
    mController->HandleText(PR_TRUE);
  } else {
    // Show the popup with the complete result set.  Can't use HandleText()
    // because it doesn't display the popup if the input is blank.
    PRBool cancel = PR_FALSE;
    mController->HandleKeyNavigation(nsIAutoCompleteController::KEY_DOWN, &cancel);
  }

  return NS_OK;
}

Here is the call graph for this function:

Processes a mouse click event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 871 of file nsFormFillController.cpp.

{ 
    return NS_OK;
}

Processes a mouse down event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 800 of file nsFormFillController.cpp.

{
  mIgnoreClick = PR_FALSE;

  nsCOMPtr<nsIDOMEventTarget> target;
  aMouseEvent->GetTarget(getter_AddRefs(target));

  nsCOMPtr<nsIDOMHTMLInputElement> targetInput = do_QueryInterface(target);
  if (!targetInput || (targetInput && targetInput != mFocusedInput)) {
    // A new input will be taking focus.  Ignore the first click
    // so that the popup is not shown.
    mIgnoreClick = PR_TRUE;
    return NS_OK;
  }

  return NS_OK;
}

Here is the call graph for this function:

Processes a mouse leave event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 883 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a mouse enter event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 877 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Processes a mouse up event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMMouseListener.

Definition at line 819 of file nsFormFillController.cpp.

{
  return NS_OK;
}

Definition at line 1066 of file nsFormFillController.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 998 of file nsFormFillController.cpp.

{
  if (!aWindow)
    return;

  StopControllingInput();
  
  nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
  nsIChromeEventHandler* chromeEventHandler = nsnull;
  if (privateDOMWindow)
    chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
  
  nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));

  if (!target)
    return;

  target->RemoveEventListener(NS_LITERAL_STRING("focus"),
                              NS_STATIC_CAST(nsIDOMFocusListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("blur"),
                              NS_STATIC_CAST(nsIDOMFocusListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("mousedown"),
                              NS_STATIC_CAST(nsIDOMMouseListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("click"),
                              NS_STATIC_CAST(nsIDOMMouseListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("input"),
                              NS_STATIC_CAST(nsIDOMFormListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("unload"),
                              NS_STATIC_CAST(nsIDOMLoadListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("compositionstart"),
                              NS_STATIC_CAST(nsIDOMCompositionListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("compositionend"),
                              NS_STATIC_CAST(nsIDOMCompositionListener *, this),
                              PR_TRUE);

  target->RemoveEventListener(NS_LITERAL_STRING("contextmenu"),
                              NS_STATIC_CAST(nsIDOMContextMenuListener *, this),
                              PR_TRUE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Processes a form reset event.

Parameters:
aEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFormListener.

Definition at line 770 of file nsFormFillController.cpp.

{
  return NS_OK;
}
PRBool nsFormFillController::RowMatch ( nsFormHistory aHistory,
PRUint32  aIndex,
const nsAString &  aInputName,
const nsAString &  aInputValue 
) [protected]

Processes a form select event.

Parameters:
aEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFormListener.

Definition at line 782 of file nsFormFillController.cpp.

{
  return NS_OK;
}
void nsIAutoCompleteInput::selectTextRange ( in long  startIndex,
in long  endIndex 
) [inherited]

Definition at line 1079 of file nsFormFillController.cpp.

{
  // Make sure we're not still attached to an input
  StopControllingInput(); 

  // Find the currently focused docShell
  nsCOMPtr<nsIDocShell> docShell = GetDocShellForInput(aInput);
  PRInt32 index = GetIndexOfDocShell(docShell);
  if (index < 0)
    return;
  
  // Cache the popup for the focused docShell
  mPopups->GetElementAt(index, getter_AddRefs(mFocusedPopup));
  
  AddKeyListener(aInput);
  mFocusedInput = aInput;

  // Now we are the autocomplete controller's bitch
  mController->SetInput(this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIAutoCompleteSearch::startSearch ( in AString  searchString,
in AString  searchParam,
in nsIAutoCompleteResult  previousResult,
in nsIAutoCompleteObserver  listener 
) [inherited]

Definition at line 1101 of file nsFormFillController.cpp.

{
  RemoveKeyListener();

  // Reset the controller's input, but not if it has been switched
  // to another input already, which might happen if the user switches
  // focus by clicking another autocomplete textbox
  nsCOMPtr<nsIAutoCompleteInput> input;
  mController->GetInput(getter_AddRefs(input));
  if (input == this)
    mController->SetInput(nsnull);

  mFocusedInput = nsnull;
  mFocusedPopup = nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Processes a form submit event.

Parameters:
aEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFormListener.

Definition at line 761 of file nsFormFillController.cpp.

Here is the call graph for this function:

Processes a page unload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 904 of file nsFormFillController.cpp.

{
  if (mFocusedInput) {
    nsCOMPtr<nsIDOMEventTarget> target;
    aLoadEvent->GetTarget(getter_AddRefs(target));

    nsCOMPtr<nsIDOMDocument> eventDoc = do_QueryInterface(target);
    nsCOMPtr<nsIDOMDocument> inputDoc;
    mFocusedInput->GetOwnerDocument(getter_AddRefs(inputDoc));

    if (eventDoc == inputDoc)
      StopControllingInput();
  }

  return NS_OK;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 71 of file nsIAutoCompleteInput.idl.

Definition at line 77 of file nsIAutoCompleteInput.idl.

Definition at line 168 of file nsIAutoCompleteInput.idl.

Definition at line 54 of file nsIAutoCompleteInput.idl.

Definition at line 64 of file nsIAutoCompleteInput.idl.

Definition at line 83 of file nsIAutoCompleteInput.idl.

Definition at line 93 of file nsIAutoCompleteInput.idl.

Definition at line 155 of file nsFormFillController.h.

Definition at line 156 of file nsFormFillController.h.

Definition at line 144 of file nsFormFillController.h.

Definition at line 154 of file nsFormFillController.h.

Definition at line 148 of file nsFormFillController.h.

Definition at line 145 of file nsFormFillController.h.

Definition at line 146 of file nsFormFillController.h.

Definition at line 157 of file nsFormFillController.h.

Definition at line 159 of file nsFormFillController.h.

Definition at line 88 of file nsIAutoCompleteInput.idl.

Definition at line 153 of file nsFormFillController.h.

Definition at line 152 of file nsFormFillController.h.

Definition at line 149 of file nsFormFillController.h.

Definition at line 158 of file nsFormFillController.h.

Definition at line 151 of file nsFormFillController.h.

Definition at line 49 of file nsIAutoCompleteInput.idl.

Definition at line 59 of file nsIAutoCompleteInput.idl.

readonly attribute unsigned long nsIAutoCompleteInput::searchCount [inherited]

Definition at line 114 of file nsIAutoCompleteInput.idl.

Definition at line 109 of file nsIAutoCompleteInput.idl.

Definition at line 134 of file nsIAutoCompleteInput.idl.

Definition at line 129 of file nsIAutoCompleteInput.idl.

Definition at line 99 of file nsIAutoCompleteInput.idl.

Definition at line 124 of file nsIAutoCompleteInput.idl.

Definition at line 104 of file nsIAutoCompleteInput.idl.


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