Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsCharsetMenu.cpp File Reference
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "rdf.h"
#include "nsIRDFDataSource.h"
#include "nsIRDFService.h"
#include "nsIRDFContainerUtils.h"
#include "nsRDFCID.h"
#include "nsXPIDLString.h"
#include "nsCharsetMenu.h"
#include "nsICharsetConverterManager.h"
#include "nsICollation.h"
#include "nsCollationCID.h"
#include "nsLocaleCID.h"
#include "nsILocaleService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranch2.h"
#include "nsIPrefLocalizedString.h"
#include "nsICurrentCharsetListener.h"
#include "nsQuickSort.h"
#include "nsIObserver.h"
#include "nsStringEnumerator.h"
#include "nsVoidArray.h"
#include "nsIObserverService.h"
#include "nsIRequestObserver.h"
#include "nsITimelineService.h"
#include "nsCRT.h"
#include "prmem.h"

Go to the source code of this file.

Classes

class  nsMenuEntry
 A little class holding all data needed for a menu item. More...
class  nsCharsetMenu
 The Charset Converter menu. More...
struct  charsetMenuSortRecord
class  nsCharsetMenuObserver

Defines

#define kBrowserStaticPrefKey   "intl.charsetmenu.browser.static"
#define kBrowserCachePrefKey   "intl.charsetmenu.browser.cache"
#define kBrowserCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"
#define kMailviewStaticPrefKey   "intl.charsetmenu.browser.static"
#define kMailviewCachePrefKey   "intl.charsetmenu.mailview.cache"
#define kMailviewCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"
#define kComposerStaticPrefKey   "intl.charsetmenu.browser.static"
#define kComposerCachePrefKey   "intl.charsetmenu.composer.cache"
#define kComposerCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"
#define kMaileditPrefKey   "intl.charsetmenu.mailedit"

Functions

static NS_DEFINE_CID (kRDFServiceCID, NS_RDFSERVICE_CID)
static NS_DEFINE_CID (kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID)
static NS_DEFINE_CID (kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID)
static NS_DEFINE_CID (kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID)
static NS_DEFINE_CID (kRDFContainerCID, NS_RDFCONTAINER_CID)
static NS_DEFINE_CID (kCollationFactoryCID, NS_COLLATIONFACTORY_CID)
static NS_DEFINE_CID (kLocaleServiceCID, NS_LOCALESERVICE_CID)
 DEFINE_RDF_VOCAB (NC_NAMESPACE_URI, NC, Name)
 DEFINE_RDF_VOCAB (NC_NAMESPACE_URI, NC, Checked)
 DEFINE_RDF_VOCAB (NC_NAMESPACE_URI, NC, BookmarkSeparator)
 DEFINE_RDF_VOCAB (NC_NAMESPACE_URI, NC, CharsetDetector)
 DEFINE_RDF_VOCAB (RDF_NAMESPACE_URI, NC, type)
static void CloneCStringArray (const nsCStringArray &src, nsCStringArray &dest)
NS_IMETHODIMP NS_NewCharsetMenu (nsISupports *aOuter, const nsIID &aIID, void **aResult)
static int PR_CALLBACK CompareMenuItems (const void *aArg1, const void *aArg2, void *data)

Variables

static const char kURINC_BrowserAutodetMenuRoot [] = "NC:BrowserAutodetMenuRoot"
static const char kURINC_BrowserCharsetMenuRoot [] = "NC:BrowserCharsetMenuRoot"
static const char kURINC_BrowserMoreCharsetMenuRoot [] = "NC:BrowserMoreCharsetMenuRoot"
static const char kURINC_BrowserMore1CharsetMenuRoot [] = "NC:BrowserMore1CharsetMenuRoot"
static const char kURINC_BrowserMore2CharsetMenuRoot [] = "NC:BrowserMore2CharsetMenuRoot"
static const char kURINC_BrowserMore3CharsetMenuRoot [] = "NC:BrowserMore3CharsetMenuRoot"
static const char kURINC_BrowserMore4CharsetMenuRoot [] = "NC:BrowserMore4CharsetMenuRoot"
static const char kURINC_BrowserMore5CharsetMenuRoot [] = "NC:BrowserMore5CharsetMenuRoot"
static const char kURINC_BrowserUnicodeCharsetMenuRoot [] = "NC:BrowserUnicodeCharsetMenuRoot"
static const char kURINC_MaileditCharsetMenuRoot [] = "NC:MaileditCharsetMenuRoot"
static const char kURINC_MailviewCharsetMenuRoot [] = "NC:MailviewCharsetMenuRoot"
static const char kURINC_ComposerCharsetMenuRoot [] = "NC:ComposerCharsetMenuRoot"
static const char kURINC_DecodersRoot [] = "NC:DecodersRoot"
static const char kURINC_EncodersRoot [] = "NC:EncodersRoot"

Class Documentation

struct charsetMenuSortRecord

Definition at line 353 of file nsCharsetMenu.cpp.

Collaboration diagram for charsetMenuSortRecord:
Class Members
nsMenuEntry * item
PRUint8 * key
PRUint32 len

Define Documentation

#define kBrowserCachePrefKey   "intl.charsetmenu.browser.cache"

Definition at line 103 of file nsCharsetMenu.cpp.

#define kBrowserCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"

Definition at line 104 of file nsCharsetMenu.cpp.

#define kBrowserStaticPrefKey   "intl.charsetmenu.browser.static"

Definition at line 102 of file nsCharsetMenu.cpp.

#define kComposerCachePrefKey   "intl.charsetmenu.composer.cache"

Definition at line 111 of file nsCharsetMenu.cpp.

#define kComposerCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"

Definition at line 112 of file nsCharsetMenu.cpp.

#define kComposerStaticPrefKey   "intl.charsetmenu.browser.static"

Definition at line 110 of file nsCharsetMenu.cpp.

#define kMaileditPrefKey   "intl.charsetmenu.mailedit"

Definition at line 114 of file nsCharsetMenu.cpp.

#define kMailviewCachePrefKey   "intl.charsetmenu.mailview.cache"

Definition at line 107 of file nsCharsetMenu.cpp.

#define kMailviewCacheSizePrefKey   "intl.charsetmenu.browser.cache.size"

Definition at line 108 of file nsCharsetMenu.cpp.

#define kMailviewStaticPrefKey   "intl.charsetmenu.browser.static"

Definition at line 106 of file nsCharsetMenu.cpp.


Function Documentation

static void CloneCStringArray ( const nsCStringArray &  src,
nsCStringArray &  dest 
) [static]

Definition at line 116 of file nsCharsetMenu.cpp.

{
  PRUint32 count = src.Count();
  PRUint32 i;
  for (i=0; i<count; i++) {
    dest.AppendCString(*src.CStringAt(i));
  }
}

Here is the caller graph for this function:

static int PR_CALLBACK CompareMenuItems ( const void aArg1,
const void aArg2,
void data 
) [static]

Definition at line 360 of file nsCharsetMenu.cpp.

{
  PRInt32 res; 
  nsICollation * collation = (nsICollation *) data;
  charsetMenuSortRecord *rec1 = (charsetMenuSortRecord *) aArg1;
  charsetMenuSortRecord *rec2 = (charsetMenuSortRecord *) aArg2;

  collation->CompareRawSortKey(rec1->key, rec1->len, rec2->key, rec2->len, &res);

  return res;
}

Here is the caller graph for this function:

DEFINE_RDF_VOCAB ( NC_NAMESPACE_URI  ,
NC  ,
Name   
)
DEFINE_RDF_VOCAB ( NC_NAMESPACE_URI  ,
NC  ,
Checked   
)
DEFINE_RDF_VOCAB ( NC_NAMESPACE_URI  ,
NC  ,
BookmarkSeparator   
)
DEFINE_RDF_VOCAB ( NC_NAMESPACE_URI  ,
NC  ,
CharsetDetector   
)
static NS_DEFINE_CID ( kRDFServiceCID  ,
NS_RDFSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kCharsetConverterManagerCID  ,
NS_ICHARSETCONVERTERMANAGER_CID   
) [static]
static NS_DEFINE_CID ( kRDFInMemoryDataSourceCID  ,
NS_RDFINMEMORYDATASOURCE_CID   
) [static]
static NS_DEFINE_CID ( kRDFContainerUtilsCID  ,
NS_RDFCONTAINERUTILS_CID   
) [static]
static NS_DEFINE_CID ( kRDFContainerCID  ,
NS_RDFCONTAINER_CID   
) [static]
static NS_DEFINE_CID ( kCollationFactoryCID  ,
NS_COLLATIONFACTORY_CID   
) [static]
static NS_DEFINE_CID ( kLocaleServiceCID  ,
NS_LOCALESERVICE_CID   
) [static]
NS_IMETHODIMP NS_NewCharsetMenu ( nsISupports *  aOuter,
const nsIID aIID,
void **  aResult 
)

Definition at line 330 of file nsCharsetMenu.cpp.

{
  if (!aResult) {
    return NS_ERROR_NULL_POINTER;
  }
  if (aOuter) {
    *aResult = nsnull;
    return NS_ERROR_NO_AGGREGATION;
  }
  nsCharsetMenu* inst = new nsCharsetMenu();
  if (!inst) {
    *aResult = nsnull;
    return NS_ERROR_OUT_OF_MEMORY;
  }
  nsresult res = inst->QueryInterface(aIID, aResult);
  if (NS_FAILED(res)) {
    *aResult = nsnull;
    delete inst;
  }
  return res;
}

Variable Documentation

const char kURINC_BrowserAutodetMenuRoot[] = "NC:BrowserAutodetMenuRoot" [static]

Definition at line 79 of file nsCharsetMenu.cpp.

const char kURINC_BrowserCharsetMenuRoot[] = "NC:BrowserCharsetMenuRoot" [static]

Definition at line 80 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMore1CharsetMenuRoot[] = "NC:BrowserMore1CharsetMenuRoot" [static]

Definition at line 82 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMore2CharsetMenuRoot[] = "NC:BrowserMore2CharsetMenuRoot" [static]

Definition at line 83 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMore3CharsetMenuRoot[] = "NC:BrowserMore3CharsetMenuRoot" [static]

Definition at line 84 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMore4CharsetMenuRoot[] = "NC:BrowserMore4CharsetMenuRoot" [static]

Definition at line 85 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMore5CharsetMenuRoot[] = "NC:BrowserMore5CharsetMenuRoot" [static]

Definition at line 86 of file nsCharsetMenu.cpp.

const char kURINC_BrowserMoreCharsetMenuRoot[] = "NC:BrowserMoreCharsetMenuRoot" [static]

Definition at line 81 of file nsCharsetMenu.cpp.

const char kURINC_BrowserUnicodeCharsetMenuRoot[] = "NC:BrowserUnicodeCharsetMenuRoot" [static]

Definition at line 87 of file nsCharsetMenu.cpp.

const char kURINC_ComposerCharsetMenuRoot[] = "NC:ComposerCharsetMenuRoot" [static]

Definition at line 90 of file nsCharsetMenu.cpp.

const char kURINC_DecodersRoot[] = "NC:DecodersRoot" [static]

Definition at line 91 of file nsCharsetMenu.cpp.

const char kURINC_EncodersRoot[] = "NC:EncodersRoot" [static]

Definition at line 92 of file nsCharsetMenu.cpp.

const char kURINC_MaileditCharsetMenuRoot[] = "NC:MaileditCharsetMenuRoot" [static]

Definition at line 88 of file nsCharsetMenu.cpp.

const char kURINC_MailviewCharsetMenuRoot[] = "NC:MailviewCharsetMenuRoot" [static]

Definition at line 89 of file nsCharsetMenu.cpp.