Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsWidgetSupport.cpp File Reference
#include "nsWidgetSupport.h"
#include "nsRect.h"
#include "nsIButton.h"
#include "nsITextWidget.h"
#include "nsILabel.h"
#include "nsIWidget.h"
#include "nsICheckButton.h"

Go to the source code of this file.

Defines

#define WIDGET_SUPPORT_EXPORT(returnType)   returnType

Functions

 NS_CreateButton (nsISupports *aParent, nsIButton *aButton, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, const nsFont *aFont)
 NS_CreateCheckButton (nsISupports *aParent, nsICheckButton *aCheckButton, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, const nsFont *aFont)
 NS_CreateLabel (nsISupports *aParent, nsILabel *aLabel, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, const nsFont *aFont)
 NS_CreateTextWidget (nsISupports *aParent, nsITextWidget *aWidget, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, const nsFont *aFont)
 NS_ShowWidget (nsISupports *aWidget, PRBool aShow)
 NS_MoveWidget (nsISupports *aWidget, PRUint32 aX, PRUint32 aY)
 NS_EnableWidget (nsISupports *aWidget, PRBool aEnable)
 NS_SetFocusToWidget (nsISupports *aWidget)
 NS_GetWidgetNativeData (nsISupports *aWidget, void **aNativeData)

Define Documentation

#define WIDGET_SUPPORT_EXPORT (   returnType)    returnType

Definition at line 50 of file nsWidgetSupport.cpp.


Function Documentation

NS_CreateButton ( nsISupports *  aParent,
nsIButton aButton,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
const nsFont aFont 
)

Definition at line 55 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> parent = do_QueryInterface(aParent);
  if (parent) {
    nsCOMPtr<nsIWidget> widget = do_QueryInterface(aButton);
    if (widget) {
      widget->Create(parent, aRect, aHandleEventFunction, nsnull);
      widget->Show(PR_TRUE);
      if (aFont) {
        widget->SetFont(*aFont);
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_CreateCheckButton ( nsISupports *  aParent,
nsICheckButton aCheckButton,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
const nsFont aFont 
)

Definition at line 77 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> parent = do_QueryInterface(aParent);
  if (parent) {
    nsCOMPtr<nsIWidget> widget = do_QueryInterface(aCheckButton);
    if (widget) {
      widget->Create(parent, aRect, aHandleEventFunction, nsnull);
      widget->Show(PR_TRUE);
      if (aFont) {
        widget->SetFont(*aFont);
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_CreateLabel ( nsISupports *  aParent,
nsILabel aLabel,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
const nsFont aFont 
)

Definition at line 99 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> parent = do_QueryInterface(aParent);
  if (parent) {
    nsCOMPtr<nsIWidget> widget = do_QueryInterface(aLabel);
    if (widget) {
      widget->Create(parent, aRect, aHandleEventFunction, NULL);
      widget->Show(PR_TRUE);
      if (aFont) {
        widget->SetFont(*aFont);
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_CreateTextWidget ( nsISupports *  aParent,
nsITextWidget aWidget,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
const nsFont aFont 
)

Definition at line 121 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> parent = do_QueryInterface(aParent);
  if (parent) {
    nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
    if (widget) {
      widget->Create(parent, aRect, aHandleEventFunction, NULL);
      widget->Show(PR_TRUE);
      if (aFont) {
        widget->SetFont(*aFont);
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_EnableWidget ( nsISupports *  aWidget,
PRBool  aEnable 
)

Definition at line 165 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
  if (widget) {
    widget->Enable(aEnable);
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_GetWidgetNativeData ( nsISupports *  aWidget,
void **  aNativeData 
)

Definition at line 187 of file nsWidgetSupport.cpp.

{
  void *result = nsnull;
  nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
  if (widget) {
    result = widget->GetNativeData(NS_NATIVE_WIDGET);
  }

  *aNativeData = result;

  return NS_OK;
}

Here is the call graph for this function:

NS_MoveWidget ( nsISupports *  aWidget,
PRUint32  aX,
PRUint32  aY 
)

Definition at line 154 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
  if (widget) {
    widget->Move(aX, aY);
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_SetFocusToWidget ( nsISupports *  aWidget)

Definition at line 176 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
  if (widget) {
    widget->SetFocus();
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_ShowWidget ( nsISupports *  aWidget,
PRBool  aShow 
)

Definition at line 143 of file nsWidgetSupport.cpp.

{
  nsCOMPtr<nsIWidget> widget = do_QueryInterface(aWidget);
  if (widget) {
    widget->Show(aShow);
  }

  return NS_OK;
}

Here is the call graph for this function: