Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsWindowMediator.cpp File Reference
#include "nsCOMPtr.h"
#include "nsAutoLock.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsVoidArray.h"
#include "nsIBaseWindow.h"
#include "nsIWidget.h"
#include "nsIDOMWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDOMElement.h"
#include "nsIDocumentViewer.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIServiceManager.h"
#include "nsISimpleEnumerator.h"
#include "nsAppShellWindowEnumerator.h"
#include "nsWindowMediator.h"
#include "nsIWindowMediatorListener.h"
#include "nsXPIDLString.h"
#include "nsIDocShell.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIXULWindow.h"

Go to the source code of this file.

Classes

struct  windowData

Functions

static nsresult GetDOMWindow (nsIXULWindow *inWindow, nsCOMPtr< nsIDOMWindowInternal > &outDOMWindow)
static PRBool notifyOpenWindow (nsISupports *aElement, void *aData)
static PRBool notifyCloseWindow (nsISupports *aElement, void *aData)
static PRBool notifyWindowTitleChange (nsISupports *aElement, void *aData)

Class Documentation

struct windowData

Definition at line 75 of file nsWindowMediator.cpp.

Collaboration diagram for windowData:
Class Members
const PRUnichar * mTitle
nsIXULWindow * mWindow

Function Documentation

nsresult GetDOMWindow ( nsIXULWindow inWindow,
nsCOMPtr< nsIDOMWindowInternal > &  outDOMWindow 
) [static]

Definition at line 82 of file nsWindowMediator.cpp.

{
  nsCOMPtr<nsIDocShell> docShell;

  inWindow->GetDocShell(getter_AddRefs(docShell));
   outDOMWindow = do_GetInterface(docShell);
   return outDOMWindow ? NS_OK : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

PRBool notifyCloseWindow ( nsISupports *  aElement,
void aData 
) [static]

Definition at line 849 of file nsWindowMediator.cpp.

{
  nsIWindowMediatorListener* listener =
    NS_REINTERPRET_CAST(nsIWindowMediatorListener*, aElement);
  windowData* winData = (windowData*) aData;
  
  listener->OnCloseWindow(winData->mWindow);
  return PR_TRUE;
}
PRBool notifyOpenWindow ( nsISupports *  aElement,
void aData 
) [static]

Definition at line 839 of file nsWindowMediator.cpp.

{
  nsIWindowMediatorListener* listener =
    NS_REINTERPRET_CAST(nsIWindowMediatorListener*, aElement);
  windowData* winData = (windowData*) aData;

  listener->OnOpenWindow(winData->mWindow);
  return PR_TRUE;
}
PRBool notifyWindowTitleChange ( nsISupports *  aElement,
void aData 
) [static]

Definition at line 859 of file nsWindowMediator.cpp.

{
  nsIWindowMediatorListener* listener =
    NS_REINTERPRET_CAST(nsIWindowMediatorListener*, aElement);

  windowData* titleData =
    NS_REINTERPRET_CAST(windowData*, aData);
  listener->OnWindowTitleChange(titleData->mWindow,
                                titleData->mTitle);

  return PR_TRUE;
}