Back to index

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

Implement Navigator Find Dialog. More...

#include <nsImageInspectorDialog.h>

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

List of all members.

Public Member Functions

 nsImageInspectorDialog (nsBrowserWindow *aBrowserWindow, nsIDOMDocument *aDoc)
virtual ~nsImageInspectorDialog ()
virtual void DoClose ()
virtual void MouseClick (nsIDOMEvent *aMouseEvent, nsIXPBaseWindow *aWindow, PRBool &aStatus)
 Method called when the user clicks the mouse.
virtual void Initialize (nsIXPBaseWindow *aWindow)
 Method called After the URL passed to the dialog box or window has completed loading.
virtual void Destroy (nsIXPBaseWindow *aWindow)
 Method called when dialog box or window is no longer visibleg.

Protected Member Functions

PRBool IsChecked (const nsAString &aName)
PRBool IsChecked (nsIDOMElement *aNode)
void SetChecked (nsIDOMElement *aNode, PRBool aValue)
void SetChecked (const nsAString &aName, PRBool aValue)
void GetText (nsIDOMElement *aNode, nsAString &aStr)
void GetText (const nsAString &aName, nsAString &aStr)
float GetFloat (nsString &aStr)
void SetText (nsIDOMElement *aNode, const nsAString &aValue)
void SetText (const nsAString &aName, const nsAString &aStr)

Protected Attributes

nsIDOMElementmOKBtn
nsIDOMDocumentmDOMDoc
nsBrowserWindowmBrowserWindow
nsIXPBaseWindowmWindow
nsIDOMElementmCancelBtn

Detailed Description

Implement Navigator Find Dialog.

Definition at line 50 of file nsImageInspectorDialog.h.


Constructor & Destructor Documentation

Definition at line 56 of file nsImageInspectorDialog.cpp.

                                                                                                      :
  nsBaseDialog(aBrowserWindow),
  mOKBtn(nsnull),
  mDOMDoc(aDoc)
{
}

Definition at line 64 of file nsImageInspectorDialog.cpp.

{
}

Member Function Documentation

Method called when dialog box or window is no longer visibleg.

Parameters:
aWindowthe window which is about to be destroyed

Reimplemented from nsBaseDialog.

Definition at line 200 of file nsImageInspectorDialog.cpp.

{
  // Unregister event listeners that were registered in the
  // Initialize here. 
  // XXX: Should change code in XPBaseWindow to automatically unregister
  // all event listening, That way this code will not be necessary.
  aWindow->RemoveEventListener(mOKBtn);
}

Here is the call graph for this function:

Reimplemented from nsBaseDialog.

Definition at line 211 of file nsImageInspectorDialog.cpp.

Here is the call graph for this function:

float nsBaseDialog::GetFloat ( nsString aStr) [protected, inherited]

Definition at line 241 of file nsBaseDialog.cpp.

{

  return (float)0.0;
}

Here is the caller graph for this function:

void nsBaseDialog::GetText ( nsIDOMElement aNode,
nsAString &  aStr 
) [protected, inherited]

Definition at line 189 of file nsBaseDialog.cpp.

{
  nsIDOMHTMLInputElement * element;
  if (NS_OK == aNode->QueryInterface(kIDOMHTMLInputElementIID, (void**) &element)) {
    element->GetValue(aStr);
    NS_RELEASE(element);
  }
}

Here is the caller graph for this function:

void nsBaseDialog::GetText ( const nsAString &  aName,
nsAString &  aStr 
) [protected, inherited]

Definition at line 199 of file nsBaseDialog.cpp.

{
  nsIDOMElement      * node;
  nsIDOMHTMLDocument * doc = nsnull;
  mWindow->GetDocument(doc);
  if (nsnull != doc) {
    if (NS_OK == doc->GetElementById(aName,   &node)) {
      GetText(node, aStr);
      NS_RELEASE(node);
    }
    NS_RELEASE(doc);
  }
}

Here is the call graph for this function:

Method called After the URL passed to the dialog box or window has completed loading.

Usually it is used to set place the initial settings in form elements.

Parameters:
aWindowthe window to initialize form element settings for.

Reimplemented from nsBaseDialog.

Definition at line 69 of file nsImageInspectorDialog.cpp.

{
  nsBaseDialog::Initialize(aWindow);

  nsIDOMHTMLDocument *doc = nsnull;
  mWindow->GetDocument(doc);
  if (nsnull != doc) {
    doc->GetElementById(NS_LITERAL_STRING("ok"), &mOKBtn);

    // XXX: Register event listening on each dom element. We should change this so
    // all DOM events are automatically passed through.
    mWindow->AddEventListener(mOKBtn);
    //SetChecked(mMatchCaseCB, PR_FALSE);
    
    NS_RELEASE(doc);
  }
}

Here is the call graph for this function:

PRBool nsBaseDialog::IsChecked ( const nsAString &  aName) [protected, inherited]

Definition at line 144 of file nsBaseDialog.cpp.

{
  nsIDOMElement      * node;
  nsIDOMHTMLDocument * doc = nsnull;
  mWindow->GetDocument(doc);
  if (nsnull != doc) {
    if (NS_OK == doc->GetElementById(aName, &node)) {
      PRBool value = IsChecked(node);
      NS_RELEASE(node);
      NS_RELEASE(doc);
      return value;
    }
    NS_RELEASE(doc);
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsBaseDialog::IsChecked ( nsIDOMElement aNode) [protected, inherited]

Definition at line 130 of file nsBaseDialog.cpp.

{
  nsIDOMHTMLInputElement * element;
  if (NS_OK == aNode->QueryInterface(kIDOMHTMLInputElementIID, (void**) &element)) {
    PRBool checked;
    element->GetChecked(&checked);
    NS_RELEASE(element);
    return checked;
  }
  return PR_FALSE;
}
void nsImageInspectorDialog::MouseClick ( nsIDOMEvent aMouseEvent,
nsIXPBaseWindow aWindow,
PRBool aStatus 
) [virtual]

Method called when the user clicks the mouse.

Clicks are only generated when the mouse-up event happens over a widget.

Parameters:
aMouseEventDOM event holding mouse click info.
aWindowWindow which generated the mouse click event

Reimplemented from nsBaseDialog.

Definition at line 176 of file nsImageInspectorDialog.cpp.

{
   // Event Dispatch. This method should not contain
   // anything but calls to methods. This idea is that this dispatch
   // mechanism may be replaced by JavaScript EventHandlers which call the idl'ed
   // interfaces to perform the same operation that is currently being handled by
   // this C++ code.

  nsBaseDialog::MouseClick(aMouseEvent, aWindow, aStatus);
  if (!aStatus) { // is not consumed
    nsCOMPtr<nsIDOMEventTarget> target;
    aMouseEvent->GetTarget(getter_AddRefs(target));
    if (target) {
      nsCOMPtr<nsIDOMElement> node(do_QueryInterface(target));
      if (node.get() == mOKBtn) {
        nsString str;
        GetText(NS_LITERAL_STRING("url"), str);
        //DoClose();
      } 
    }
  }
}

Here is the call graph for this function:

void nsBaseDialog::SetChecked ( nsIDOMElement aNode,
PRBool  aValue 
) [protected, inherited]

Definition at line 163 of file nsBaseDialog.cpp.

{
  nsIDOMHTMLInputElement * element;
  if (NS_OK == aNode->QueryInterface(kIDOMHTMLInputElementIID, (void**) &element)) {
    element->SetChecked(aValue);
    NS_RELEASE(element);
  }
}

Here is the caller graph for this function:

void nsBaseDialog::SetChecked ( const nsAString &  aName,
PRBool  aValue 
) [protected, inherited]

Definition at line 174 of file nsBaseDialog.cpp.

{
  nsIDOMElement      * node;
  nsIDOMHTMLDocument * doc = nsnull;
  mWindow->GetDocument(doc);
  if (nsnull != doc) {
    if (NS_OK == doc->GetElementById(aName,   &node)) {
      SetChecked(node, aValue);
      NS_RELEASE(node);
    }
    NS_RELEASE(doc);
  }
}

Here is the call graph for this function:

void nsBaseDialog::SetText ( nsIDOMElement aNode,
const nsAString &  aValue 
) [protected, inherited]

Definition at line 215 of file nsBaseDialog.cpp.

{
  nsIDOMHTMLInputElement * element;
  if (NS_OK == aNode->QueryInterface(kIDOMHTMLInputElementIID, (void**) &element)) {
    element->SetValue(aValue);
    NS_RELEASE(element);
  }
}

Here is the caller graph for this function:

void nsBaseDialog::SetText ( const nsAString &  aName,
const nsAString &  aStr 
) [protected, inherited]

Definition at line 226 of file nsBaseDialog.cpp.

{
  nsIDOMElement      * node;
  nsIDOMHTMLDocument * doc = nsnull;
  mWindow->GetDocument(doc);
  if (nsnull != doc) {
    if (NS_OK == doc->GetElementById(aName,   &node)) {
      SetText(node, aStr);
      NS_RELEASE(node);
    }
    NS_RELEASE(doc);
  }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 78 of file nsBaseDialog.h.

nsIDOMElement* nsBaseDialog::mCancelBtn [protected, inherited]

Definition at line 80 of file nsBaseDialog.h.

Definition at line 68 of file nsImageInspectorDialog.h.

Definition at line 67 of file nsImageInspectorDialog.h.

nsIXPBaseWindow* nsBaseDialog::mWindow [protected, inherited]

Definition at line 79 of file nsBaseDialog.h.


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