Back to index

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

#include <nsEditorEventListeners.h>

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

List of all members.

Public Member Functions

 nsTextEditorCompositionListener ()
 default constructor
virtual ~nsTextEditorCompositionListener ()
 default destructor
void SetEditor (nsIEditor *aEditor)
 SetEditor gives an address to the editor that will be accessed.
NS_DECL_ISUPPORTS NS_IMETHOD HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD HandleStartComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleEndComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleQueryComposition (nsIDOMEvent *aCompositionEvent)
NS_IMETHOD HandleQueryReconversion (nsIDOMEvent *aReconvertionEvent)
NS_IMETHOD HandleQueryCaretRect (nsIDOMEvent *aQueryCaretRectEvent)
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Protected Attributes

nsIEditorIMESupportmEditor

Detailed Description

Definition at line 128 of file nsEditorEventListeners.h.


Constructor & Destructor Documentation

default constructor

Definition at line 751 of file nsEditorEventListeners.cpp.

{
}

default destructor

Definition at line 755 of file nsEditorEventListeners.cpp.

{
}

Member Function Documentation

Implements nsIDOMCompositionListener.

Definition at line 811 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
   printf("nsTextEditorCompositionListener::HandleEndComposition\n");
#endif
   return mEditor->EndComposition();
}

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 762 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
   printf("nsTextEditorCompositionListener::HandleEvent\n");
#endif
  return NS_OK;
}

Implements nsIDOMCompositionListener.

Definition at line 839 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
  printf("nsTextEditorCompositionListener::HandleQueryCaretRect\n");
#endif
  nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aQueryCaretRectEvent);
  if (!pCompositionEvent)
    return NS_ERROR_FAILURE;

  nsQueryCaretRectEventReply* eventReply;
  nsresult rv = pCompositionEvent->GetQueryCaretRectReply(&eventReply);
  if (NS_FAILED(rv))
    return rv;

  return mEditor->GetQueryCaretRect(eventReply);
}

Here is the call graph for this function:

Implements nsIDOMCompositionListener.

Definition at line 795 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
   printf("nsTextEditorCompositionListener::HandleQueryComposition\n");
#endif
  nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
  if (!pCompositionEvent) return NS_ERROR_FAILURE;
  
  nsTextEventReply* eventReply;
  nsresult rv = pCompositionEvent->GetCompositionReply(&eventReply);
  if (NS_FAILED(rv)) return rv;

  return mEditor->QueryComposition(eventReply);
}

Here is the call graph for this function:

Implements nsIDOMCompositionListener.

Definition at line 821 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
  printf("nsTextEditorCompositionListener::HandleQueryReconversion\n");
#endif
  nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aReconversionEvent);
  if (!pCompositionEvent)
    return NS_ERROR_FAILURE;

  nsReconversionEventReply* eventReply;
  nsresult rv = pCompositionEvent->GetReconversionReply(&eventReply);
  if (NS_FAILED(rv))
    return rv;

  return mEditor->GetReconversionString(eventReply);
}

Here is the call graph for this function:

Implements nsIDOMCompositionListener.

Definition at line 780 of file nsEditorEventListeners.cpp.

{
#ifdef DEBUG_IME
   printf("nsTextEditorCompositionListener::HandleStartComposition\n");
#endif
  nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
  if (!pCompositionEvent) return NS_ERROR_FAILURE;
  
  nsTextEventReply* eventReply;
  nsresult rv = pCompositionEvent->GetCompositionReply(&eventReply);
  if (NS_FAILED(rv)) return rv;

  return mEditor->BeginComposition(eventReply);
}

Here is the call graph for this function:

SetEditor gives an address to the editor that will be accessed.

Parameters:
aEditorthe editor this listener calls for editing operations

Definition at line 770 of file nsEditorEventListeners.cpp.

{
  nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(aEditor);
  if (!imeEditor) return;      // should return an error here!
  
  // note that we don't hold an extra reference here.
  mEditor = imeEditor;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 156 of file nsEditorEventListeners.h.


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