|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "mozSpellI18NManager.h" |
|
7 #include "mozEnglishWordUtils.h" |
|
8 #include "mozGenericWordUtils.h" |
|
9 #include "nsString.h" |
|
10 |
|
11 NS_IMPL_ISUPPORTS(mozSpellI18NManager, mozISpellI18NManager) |
|
12 |
|
13 mozSpellI18NManager::mozSpellI18NManager() |
|
14 { |
|
15 /* member initializers and constructor code */ |
|
16 } |
|
17 |
|
18 mozSpellI18NManager::~mozSpellI18NManager() |
|
19 { |
|
20 /* destructor code */ |
|
21 } |
|
22 |
|
23 /* mozISpellI18NUtil GetUtil (in wstring language); */ |
|
24 NS_IMETHODIMP mozSpellI18NManager::GetUtil(const char16_t *aLanguage, mozISpellI18NUtil **_retval) |
|
25 { |
|
26 if( nullptr == _retval) { |
|
27 return NS_ERROR_NULL_POINTER; |
|
28 } |
|
29 *_retval = nullptr; |
|
30 nsAutoString lang; |
|
31 lang.Assign(aLanguage); |
|
32 if(lang.EqualsLiteral("en")){ |
|
33 *_retval = new mozEnglishWordUtils; |
|
34 } |
|
35 else{ |
|
36 *_retval = new mozEnglishWordUtils; |
|
37 } |
|
38 |
|
39 NS_IF_ADDREF(*_retval); |
|
40 return NS_OK; |
|
41 } |