Back to index

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

editor Implementation of the FocusListener interface More...

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

List of all members.

Public Member Functions

 nsDocViewerFocusListener ()
 default constructor
virtual ~nsDocViewerFocusListener ()
 default destructor
NS_DECL_ISUPPORTS NS_IMETHOD HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD Focus (nsIDOMEvent *aEvent)
 Processes a focus event.
NS_IMETHOD Blur (nsIDOMEvent *aEvent)
 Processes a blur event.
nsresult Init (DocumentViewerImpl *aDocViewer)
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Private Attributes

DocumentViewerImplmDocViewer

Detailed Description

editor Implementation of the FocusListener interface

Definition at line 269 of file nsDocumentViewer.cpp.


Constructor & Destructor Documentation

default constructor

default destructor

Definition at line 3356 of file nsDocumentViewer.cpp.

{}

Member Function Documentation

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 3390 of file nsDocumentViewer.cpp.

{
  nsCOMPtr<nsIPresShell> shell;
  if(!mDocViewer)
    return NS_ERROR_FAILURE;

  nsresult result = mDocViewer->GetPresShell(getter_AddRefs(shell));
  if(NS_FAILED(result) || !shell)
    return result?result:NS_ERROR_FAILURE;
  nsCOMPtr<nsISelectionController> selCon;
  selCon = do_QueryInterface(shell);
  PRInt16 selectionStatus;
  selCon->GetDisplaySelection(&selectionStatus);

  // If selection was on, disable it.
  if(selectionStatus == nsISelectionController::SELECTION_ON ||
     selectionStatus == nsISelectionController::SELECTION_ATTENTION)
  {
    selCon->SetDisplaySelection(nsISelectionController::SELECTION_DISABLED);
    selCon->RepaintSelection(nsISelectionController::SELECTION_NORMAL);
  }
  return result;
}

Here is the call graph for this function:

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 3365 of file nsDocumentViewer.cpp.

{
  nsCOMPtr<nsIPresShell> shell;
  if(!mDocViewer)
    return NS_ERROR_FAILURE;

  nsresult result = mDocViewer->GetPresShell(getter_AddRefs(shell));
  if(NS_FAILED(result) || !shell)
    return result?result:NS_ERROR_FAILURE;
  nsCOMPtr<nsISelectionController> selCon;
  selCon = do_QueryInterface(shell);
  PRInt16 selectionStatus;
  selCon->GetDisplaySelection(&selectionStatus);

  // If selection was disabled, re-enable it.
  if(selectionStatus == nsISelectionController::SELECTION_DISABLED ||
     selectionStatus == nsISelectionController::SELECTION_HIDDEN)
  {
    selCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
    selCon->RepaintSelection(nsISelectionController::SELECTION_NORMAL);
  }
  return result;
}

Here is the call graph for this function:

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.

Definition at line 3359 of file nsDocumentViewer.cpp.

{
  return NS_OK;
}

Definition at line 3416 of file nsDocumentViewer.cpp.

{
  mDocViewer = aDocViewer;
  return NS_OK;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 291 of file nsDocumentViewer.cpp.


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