michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozSpellI18NManager.h" michael@0: #include "mozEnglishWordUtils.h" michael@0: #include "mozGenericWordUtils.h" michael@0: #include "nsString.h" michael@0: michael@0: NS_IMPL_ISUPPORTS(mozSpellI18NManager, mozISpellI18NManager) michael@0: michael@0: mozSpellI18NManager::mozSpellI18NManager() michael@0: { michael@0: /* member initializers and constructor code */ michael@0: } michael@0: michael@0: mozSpellI18NManager::~mozSpellI18NManager() michael@0: { michael@0: /* destructor code */ michael@0: } michael@0: michael@0: /* mozISpellI18NUtil GetUtil (in wstring language); */ michael@0: NS_IMETHODIMP mozSpellI18NManager::GetUtil(const char16_t *aLanguage, mozISpellI18NUtil **_retval) michael@0: { michael@0: if( nullptr == _retval) { michael@0: return NS_ERROR_NULL_POINTER; michael@0: } michael@0: *_retval = nullptr; michael@0: nsAutoString lang; michael@0: lang.Assign(aLanguage); michael@0: if(lang.EqualsLiteral("en")){ michael@0: *_retval = new mozEnglishWordUtils; michael@0: } michael@0: else{ michael@0: *_retval = new mozEnglishWordUtils; michael@0: } michael@0: michael@0: NS_IF_ADDREF(*_retval); michael@0: return NS_OK; michael@0: }