2001-09-26 04:47:52 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
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/. */
|
1999-08-21 03:57:51 +04:00
|
|
|
|
2010-08-18 14:17:12 +04:00
|
|
|
#ifndef nsEntityConverter_h__
|
|
|
|
#define nsEntityConverter_h__
|
|
|
|
|
1999-08-21 03:57:51 +04:00
|
|
|
#include "nsIEntityConverter.h"
|
2002-06-23 20:05:35 +04:00
|
|
|
#include "nsIStringBundle.h"
|
|
|
|
#include "nsCOMPtr.h"
|
1999-10-19 02:33:14 +04:00
|
|
|
|
1999-08-21 03:57:51 +04:00
|
|
|
class nsEntityConverter: public nsIEntityConverter
|
|
|
|
{
|
|
|
|
public:
|
2015-04-22 07:21:00 +03:00
|
|
|
//
|
|
|
|
// implementation methods
|
|
|
|
//
|
|
|
|
nsEntityConverter();
|
1999-08-21 03:57:51 +04:00
|
|
|
|
2015-04-22 07:21:00 +03:00
|
|
|
//
|
|
|
|
// nsISupports
|
|
|
|
//
|
|
|
|
NS_DECL_ISUPPORTS
|
1999-10-19 02:33:14 +04:00
|
|
|
|
2015-04-22 07:21:00 +03:00
|
|
|
NS_IMETHOD ConvertUTF32ToEntity(uint32_t character, uint32_t entityVersion, char **_retval) override;
|
|
|
|
NS_IMETHOD ConvertToEntity(char16_t character, uint32_t entityVersion, char **_retval) override;
|
|
|
|
NS_IMETHOD ConvertToEntities(const char16_t *inString, uint32_t entityVersion, char16_t **_retval) override;
|
1999-08-21 03:57:51 +04:00
|
|
|
|
|
|
|
protected:
|
2015-04-22 07:21:00 +03:00
|
|
|
// map version number to a string bundle
|
|
|
|
nsIStringBundle* GetVersionBundleInstance(uint32_t versionNumber);
|
|
|
|
|
|
|
|
// load a string bundle file
|
|
|
|
already_AddRefed<nsIStringBundle> LoadEntityBundle(const char *fileName);
|
|
|
|
|
|
|
|
const char* kHTML40LATIN1 = "html40Latin1.properties";
|
|
|
|
const char* kHTML40SYMBOLS = "html40Symbols.properties";
|
|
|
|
const char* kHTML40SPECIAL = "html40Special.properties";
|
|
|
|
const char* kMATHML20 = "mathml20.properties";
|
|
|
|
nsCOMPtr<nsIStringBundle> mHTML40Latin1Bundle;
|
|
|
|
nsCOMPtr<nsIStringBundle> mHTML40SymbolsBundle;
|
|
|
|
nsCOMPtr<nsIStringBundle> mHTML40SpecialBundle;
|
|
|
|
nsCOMPtr<nsIStringBundle> mMathML20Bundle;
|
|
|
|
|
|
|
|
virtual ~nsEntityConverter();
|
1999-10-19 02:33:14 +04:00
|
|
|
};
|
2010-08-18 14:17:12 +04:00
|
|
|
|
|
|
|
#endif
|