2001-10-16 16:30:44 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-10-16 16:30:44 +04:00
|
|
|
|
2017-03-23 07:42:49 +03:00
|
|
|
#ifndef nsCollation_h_
|
|
|
|
#define nsCollation_h_
|
2001-10-16 16:30:44 +04:00
|
|
|
|
2017-02-07 23:52:03 +03:00
|
|
|
#include "mozilla/Attributes.h"
|
2001-10-16 16:30:44 +04:00
|
|
|
#include "nsICollation.h"
|
2017-03-23 07:42:00 +03:00
|
|
|
#include "nsCollationFactory.h"
|
2017-02-07 23:52:03 +03:00
|
|
|
#include "nsString.h"
|
2014-10-08 18:43:47 +04:00
|
|
|
|
2017-03-23 07:43:38 +03:00
|
|
|
#ifdef ENABLE_INTL_API
|
2014-10-08 18:43:47 +04:00
|
|
|
#include "unicode/ucol.h"
|
2017-03-23 07:43:38 +03:00
|
|
|
#endif
|
2002-02-13 01:17:19 +03:00
|
|
|
|
2017-03-23 07:42:49 +03:00
|
|
|
class nsCollation final : public nsICollation {
|
2001-10-16 16:30:44 +04:00
|
|
|
|
2015-12-16 11:27:44 +03:00
|
|
|
public:
|
2017-03-23 07:42:49 +03:00
|
|
|
nsCollation();
|
2001-10-16 16:30:44 +04:00
|
|
|
|
2004-08-25 02:50:33 +04:00
|
|
|
// nsISupports interface
|
|
|
|
NS_DECL_ISUPPORTS
|
2001-10-16 16:30:44 +04:00
|
|
|
|
2004-08-25 02:50:33 +04:00
|
|
|
// nsICollation interface
|
|
|
|
NS_DECL_NSICOLLATION
|
2001-10-16 16:30:44 +04:00
|
|
|
|
|
|
|
protected:
|
2017-03-23 07:42:49 +03:00
|
|
|
~nsCollation();
|
2014-07-06 19:25:31 +04:00
|
|
|
|
2017-03-23 07:43:38 +03:00
|
|
|
#ifdef ENABLE_INTL_API
|
2014-10-08 18:43:47 +04:00
|
|
|
nsresult ConvertStrength(const int32_t aStrength,
|
|
|
|
UCollationStrength* aStrengthOut,
|
|
|
|
UColAttributeValue* aCaseLevelOut);
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult EnsureCollator(const int32_t newStrength);
|
2014-10-08 18:43:47 +04:00
|
|
|
nsresult CleanUpCollator(void);
|
2001-10-16 16:30:44 +04:00
|
|
|
|
|
|
|
private:
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mInit;
|
|
|
|
bool mHasCollator;
|
2017-02-07 23:52:03 +03:00
|
|
|
nsCString mLocale;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mLastStrength;
|
2014-10-08 18:43:47 +04:00
|
|
|
UCollator* mCollatorICU;
|
2017-03-23 07:43:38 +03:00
|
|
|
#endif
|
2001-10-16 16:30:44 +04:00
|
|
|
};
|
|
|
|
|
2017-03-23 07:42:49 +03:00
|
|
|
#endif /* nsCollation_h_ */
|