michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #ifndef nsUnicodeNormalizer_h__ michael@0: #define nsUnicodeNormalizer_h__ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsISupports.h" michael@0: michael@0: #include "nsIUnicodeNormalizer.h" michael@0: michael@0: nsresult NS_NewUnicodeNormalizer(nsISupports** oResult); michael@0: michael@0: michael@0: class nsUnicodeNormalizer : public nsIUnicodeNormalizer { michael@0: public: michael@0: nsUnicodeNormalizer(); michael@0: virtual ~nsUnicodeNormalizer(); michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: NS_IMETHOD NormalizeUnicodeNFD( const nsAString& aSrc, nsAString& aDest); michael@0: NS_IMETHOD NormalizeUnicodeNFC( const nsAString& aSrc, nsAString& aDest); michael@0: NS_IMETHOD NormalizeUnicodeNFKD( const nsAString& aSrc, nsAString& aDest); michael@0: NS_IMETHOD NormalizeUnicodeNFKC( const nsAString& aSrc, nsAString& aDest); michael@0: michael@0: // low-level access to the composition data needed for HarfBuzz callbacks michael@0: static bool Compose(uint32_t a, uint32_t b, uint32_t *ab); michael@0: static bool DecomposeNonRecursively(uint32_t comp, uint32_t *c1, uint32_t *c2); michael@0: }; michael@0: michael@0: #endif //nsUnicodeNormalizer_h__ michael@0: