Back to index

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

#include <nsOEStringBundle.h>

Collaboration diagram for nsOEStringBundle:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static PRUnicharGetStringByID (PRInt32 stringID, nsIStringBundle *pBundle=nsnull)
static void GetStringByID (PRInt32 stringID, nsString &result, nsIStringBundle *pBundle=nsnull)
static nsIStringBundleGetStringBundle (void)
static void FreeString (PRUnichar *pStr)
static void Cleanup (void)
static nsIStringBundleGetStringBundleProxy (void)

Static Private Attributes

static nsIStringBundlem_pBundle = nsnull

Detailed Description

Definition at line 45 of file nsOEStringBundle.h.


Member Function Documentation

Definition at line 122 of file nsOEStringBundle.cpp.

{
       if (m_pBundle)
              m_pBundle->Release();
       m_pBundle = nsnull;
}

Here is the caller graph for this function:

static void nsOEStringBundle::FreeString ( PRUnichar pStr) [inline, static]

Definition at line 50 of file nsOEStringBundle.h.

{ nsCRT::free( pStr);}

Here is the caller graph for this function:

Definition at line 53 of file nsOEStringBundle.cpp.

{
       if (m_pBundle)
              return( m_pBundle);

       nsresult                    rv;
       char*                       propertyURL = OE_MSGS_URL;
       nsIStringBundle*     sBundle = nsnull;


       nsCOMPtr<nsIStringBundleService> sBundleService = 
                do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); 
       if (NS_SUCCEEDED(rv) && (nsnull != sBundleService)) {
              rv = sBundleService->CreateBundle(propertyURL, &sBundle);
       }

       m_pBundle = sBundle;

       return( sBundle);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 74 of file nsOEStringBundle.cpp.

{
       if (!m_pBundle)
              return( nsnull);

       nsIStringBundle *strProxy = nsnull;
       nsresult rv;
       // create a proxy object if we aren't on the same thread?
       nsCOMPtr<nsIProxyObjectManager> proxyMgr = 
                do_GetService(kProxyObjectManagerCID, &rv);
       if (NS_SUCCEEDED(rv)) {
              rv = proxyMgr->GetProxyForObject( NS_UI_THREAD_EVENTQ, NS_GET_IID(nsIStringBundle),
                                                                      m_pBundle, PROXY_SYNC | PROXY_ALWAYS, (void **) &strProxy);
       }

       return( strProxy);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRUnichar * nsOEStringBundle::GetStringByID ( PRInt32  stringID,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 100 of file nsOEStringBundle.cpp.

{
       if (!pBundle) {
              pBundle = GetStringBundle();
       }
       
       if (pBundle) {
              PRUnichar *ptrv = nsnull;
              nsresult rv = pBundle->GetStringFromID(stringID, &ptrv);
                            
              if (NS_SUCCEEDED( rv) && ptrv)
                     return( ptrv);
       }

       nsString resultString;
       resultString.AppendLiteral("[StringID ");
       resultString.AppendInt(stringID);
       resultString.AppendLiteral("?]");

       return( ToNewUnicode(resultString));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsOEStringBundle::GetStringByID ( PRInt32  stringID,
nsString result,
nsIStringBundle pBundle = nsnull 
) [static]

Definition at line 92 of file nsOEStringBundle.cpp.

{
       
       PRUnichar *ptrv = GetStringByID( stringID, pBundle);    
       result = ptrv;
       FreeString( ptrv);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 55 of file nsOEStringBundle.h.


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