Back to index

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

#include <nsGlobalHistory2Adapter.h>

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

List of all members.

Public Member Functions

 NS_DEFINE_STATIC_CID_ACCESSOR (NS_GLOBALHISTORY2ADAPTER_CID)
void addPage (in string aURL)
 addPage Add a page to the history
boolean isVisited (in string aURL)
 isVisited Checks to see if the given page is in history

Static Public Member Functions

NS_DECL_ISUPPORTS static
NS_DECL_NSIGLOBALHISTORY
NS_METHOD 
Create (nsISupports *aOuter, REFNSIID aIID, void **aResult)
static NS_METHOD RegisterSelf (nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)

Private Member Functions

 nsGlobalHistory2Adapter ()
 ~nsGlobalHistory2Adapter ()
nsresult Init ()

Private Attributes

nsCOMPtr< nsIGlobalHistory2mHistory

Detailed Description

Definition at line 52 of file nsGlobalHistory2Adapter.h.


Constructor & Destructor Documentation

Definition at line 110 of file nsGlobalHistory2Adapter.cpp.

{ }

Here is the caller graph for this function:

Definition at line 113 of file nsGlobalHistory2Adapter.cpp.

{ }

Member Function Documentation

void nsIGlobalHistory::addPage ( in string  aURL) [inherited]

addPage Add a page to the history

Parameters:
aURLthe url to the page
nsresult nsGlobalHistory2Adapter::Create ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 52 of file nsGlobalHistory2Adapter.cpp.

{
  nsresult rv;

  if (aOuter) {
    rv = NS_ERROR_NO_AGGREGATION;
    return rv;
  }

  nsGlobalHistory2Adapter* adapter = new nsGlobalHistory2Adapter();
  if (!adapter) {
    rv = NS_ERROR_OUT_OF_MEMORY;
    return rv;
  }

  NS_ADDREF(adapter);
  rv = adapter->Init();
  if (NS_SUCCEEDED(rv)) {
    rv = adapter->QueryInterface(aIID, aResult);
  }
  NS_RELEASE(adapter);

  return rv;
}

Here is the call graph for this function:

Definition at line 117 of file nsGlobalHistory2Adapter.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIComponentRegistrar> compReg;
  rv = NS_GetComponentRegistrar(getter_AddRefs(compReg));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCID *cid;
  rv = compReg->ContractIDToCID(NS_GLOBALHISTORY2_CONTRACTID, &cid);
  if (NS_FAILED(rv)) {
    rv = NS_ERROR_FACTORY_NOT_REGISTERED;
    return rv;
  }

  if (cid->Equals(nsGlobalHistoryAdapter::GetCID())) {
    rv = NS_ERROR_FACTORY_NOT_REGISTERED;
    return rv;
  }

  NS_WARNING("Using nsIGlobalHistory->nsIGlobalHistory2 adapter.");
  mHistory = do_GetService(NS_GLOBALHISTORY2_CONTRACTID, &rv);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

isVisited Checks to see if the given page is in history

Returns:
true if a page has been passed into addPage().
Parameters:
aURLthe url to the page
nsresult nsGlobalHistory2Adapter::RegisterSelf ( nsIComponentManager aCompMgr,
nsIFile aPath,
const char *  aLoaderStr,
const char *  aType,
const nsModuleComponentInfo aInfo 
) [static]

Definition at line 80 of file nsGlobalHistory2Adapter.cpp.

{
  nsresult rv;
  PRBool registered;
  nsCOMPtr<nsIComponentRegistrar> compReg( do_QueryInterface(aCompMgr) );
  if (!compReg) {
    rv = NS_ERROR_UNEXPECTED;
    return rv;
  }

  rv = compReg->IsContractIDRegistered(NS_GLOBALHISTORY_CONTRACTID, &registered);
  if (NS_FAILED(rv)) return rv;

  // If the embedder has already registered the contractID, we don't want to
  // register ourself. Ideally the component manager would handle this for us.
  if (registered) {
    rv = NS_OK;
    return rv;
  }

  return compReg->RegisterFactoryLocation(GetCID(),
                                          "nsGlobalHistory2Adapter",
                                          NS_GLOBALHISTORY_CONTRACTID,
                                          aPath, aLoaderStr, aType);
}                                     

Here is the call graph for this function:


Member Data Documentation

Definition at line 75 of file nsGlobalHistory2Adapter.h.


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