Back to index

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

#include <nsWindowDataSource.h>

Inheritance diagram for nsWindowDataSource:
Inheritance graph
Collaboration diagram for nsWindowDataSource:
Collaboration graph

List of all members.

Public Member Functions

 nsWindowDataSource ()
virtual ~nsWindowDataSource ()
nsresult Init ()
nsIDOMWindowInternal getWindowForResource (in string inResource)
 for the given resource name, return the window

Private Attributes

nsSupportsHashtable mWindowResources
nsCOMPtr< nsIRDFDataSourcemInner
nsCOMPtr< nsIRDFContainermContainer

Static Private Attributes

static PRUint32 windowCount = 0
static PRUint32 gRefCnt = 0
static nsIRDFResourcekNC_Name = nsnull
static nsIRDFResourcekNC_KeyIndex = nsnull
static nsIRDFResourcekNC_WindowRoot = nsnull
static nsIRDFServicegRDFService = nsnull

Detailed Description

Definition at line 56 of file nsWindowDataSource.h.

Constructor & Destructor Documentation

Definition at line 62 of file nsWindowDataSource.h.

{ }

Member Function Documentation

for the given resource name, return the window

Definition at line 67 of file nsWindowDataSource.cpp.

    nsresult rv;

    if (gRefCnt++ == 0) {
        rv = CallGetService(";1", &gRDFService);
        if (NS_FAILED(rv)) return rv;

        gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_WindowRoot), &kNC_WindowRoot);
        gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_Name),       &kNC_Name);
        gRDFService->GetResource(NS_LITERAL_CSTRING(kURINC_KeyIndex),   &kNC_KeyIndex);

    mInner = do_CreateInstance(";1?name=in-memory-datasource", &rv);
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIRDFContainerUtils> rdfc =
        do_GetService(";1", &rv);
    if (NS_FAILED(rv)) return rv;

    rv = rdfc->MakeSeq(this, kNC_WindowRoot, getter_AddRefs(mContainer));
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIWindowMediator> windowMediator =
        do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv);
    if (NS_FAILED(rv)) return rv;

    rv = windowMediator->AddListener(this);
    if (NS_FAILED(rv)) return rv;

    nsCOMPtr<nsIObserverService> observerService =
        do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
    if (NS_SUCCEEDED(rv)) {
        rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID,
    return NS_OK;

Here is the call graph for this function:

Member Data Documentation

Definition at line 87 of file nsWindowDataSource.h.

PRUint32 nsWindowDataSource::gRefCnt = 0 [static, private]

Definition at line 79 of file nsWindowDataSource.h.

Definition at line 85 of file nsWindowDataSource.h.

Definition at line 84 of file nsWindowDataSource.h.

Definition at line 86 of file nsWindowDataSource.h.

Definition at line 82 of file nsWindowDataSource.h.

Definition at line 81 of file nsWindowDataSource.h.

nsSupportsHashtable nsWindowDataSource::mWindowResources [private]

Definition at line 76 of file nsWindowDataSource.h.

Definition at line 78 of file nsWindowDataSource.h.

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