extensions/spellcheck/src/mozSpellI18NManager.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/extensions/spellcheck/src/mozSpellI18NManager.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "mozSpellI18NManager.h"
    1.10 +#include "mozEnglishWordUtils.h"
    1.11 +#include "mozGenericWordUtils.h"
    1.12 +#include "nsString.h"
    1.13 +
    1.14 +NS_IMPL_ISUPPORTS(mozSpellI18NManager, mozISpellI18NManager)
    1.15 +
    1.16 +mozSpellI18NManager::mozSpellI18NManager()
    1.17 +{
    1.18 +  /* member initializers and constructor code */
    1.19 +}
    1.20 +
    1.21 +mozSpellI18NManager::~mozSpellI18NManager()
    1.22 +{
    1.23 +  /* destructor code */
    1.24 +}
    1.25 +
    1.26 +/* mozISpellI18NUtil GetUtil (in wstring language); */
    1.27 +NS_IMETHODIMP mozSpellI18NManager::GetUtil(const char16_t *aLanguage, mozISpellI18NUtil **_retval)
    1.28 +{
    1.29 + if( nullptr == _retval) {
    1.30 +   return NS_ERROR_NULL_POINTER;
    1.31 + }
    1.32 + *_retval = nullptr;
    1.33 + nsAutoString lang;
    1.34 + lang.Assign(aLanguage);
    1.35 + if(lang.EqualsLiteral("en")){
    1.36 +   *_retval = new mozEnglishWordUtils;
    1.37 + }
    1.38 + else{
    1.39 +   *_retval = new mozEnglishWordUtils;   
    1.40 + }
    1.41 +
    1.42 + NS_IF_ADDREF(*_retval);
    1.43 + return NS_OK;
    1.44 +}

mercurial