Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
mozMySpell.cpp File Reference
#include "mozMySpell.h"
#include "nsReadableUtils.h"
#include "nsXPIDLString.h"
#include "nsIObserverService.h"
#include "nsISimpleEnumerator.h"
#include "nsIDirectoryEnumerator.h"
#include "nsIFile.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "mozISpellI18NManager.h"
#include "nsICharsetConverterManager.h"
#include "nsUnicharUtilCIID.h"
#include "nsUnicharUtils.h"
#include "nsCRT.h"
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  AppendNewStruct

Functions

static NS_DEFINE_CID (kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID)
static NS_DEFINE_CID (kUnicharUtilCID, NS_UNICHARUTIL_CID)
 NS_IMPL_ISUPPORTS3 (mozMySpell, mozISpellCheckingEngine, nsIObserver, nsISupportsWeakReference) nsresult mozMySpell
static PLDHashOperator AppendNewString (const nsAString &aString, nsIFile *aFile, void *aClosure)

Class Documentation

struct AppendNewStruct

Definition at line 246 of file mozMySpell.cpp.

Class Members
PRUint32 count
PRUnichar ** dics
PRBool failed

Function Documentation

static PLDHashOperator AppendNewString ( const nsAString &  aString,
nsIFile aFile,
void aClosure 
) [static]

Definition at line 254 of file mozMySpell.cpp.

{
  AppendNewStruct *ans = (AppendNewStruct*) aClosure;
  ans->dics[ans->count] = ToNewUnicode(aString);
  if (!ans->dics[ans->count]) {
    ans->failed = PR_TRUE;
    return PL_DHASH_STOP;
  }

  ++ans->count;
  return PL_DHASH_NEXT;
}

Here is the call graph for this function:

static NS_DEFINE_CID ( kCharsetConverterManagerCID  ,
NS_ICHARSETCONVERTERMANAGER_CID   
) [static]
static NS_DEFINE_CID ( kUnicharUtilCID  ,
NS_UNICHARUTIL_CID   
) [static]

Definition at line 79 of file mozMySpell.cpp.

{
  if (!mDictionaries.Init())
    return NS_ERROR_OUT_OF_MEMORY;

  LoadDictionaryList();

  nsCOMPtr<nsIObserverService> obs =
    do_GetService("@mozilla.org/observer-service;1");
  if (obs) {
    obs->AddObserver(this, "profile-do-change", PR_TRUE);
  }

  return NS_OK;
}

Here is the call graph for this function: