2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsCollation_h__
8 #define nsCollation_h__
11 #include "nsICollation.h"
13 #include "mozilla/Attributes.h"
15 class nsIUnicodeEncoder
;
17 // Create a collation interface for an input locale.
19 class nsCollationFactory MOZ_FINAL
: public nsICollationFactory
{
21 ~nsCollationFactory() {}
26 NS_IMETHOD
CreateCollation(nsILocale
* locale
, nsICollation
** instancePtr
);
28 nsCollationFactory() {}
40 // normalize string before collation key generation
41 nsresult
NormalizeString(const nsAString
& stringIn
, nsAString
& stringOut
);
43 // charset conversion util, C string buffer is allocate by PR_Malloc, caller should call PR_Free
44 nsresult
SetCharset(const char* aCharset
);
45 nsresult
UnicodeToChar(const nsAString
& aSrc
, char** dst
);
48 nsCOMPtr
<nsIUnicodeEncoder
> mEncoder
;
51 #endif /* nsCollation_h__ */