summaryrefslogtreecommitdiffstats
path: root/intl/unicharutil/nsEntityConverter.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /intl/unicharutil/nsEntityConverter.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'intl/unicharutil/nsEntityConverter.h')
-rw-r--r--intl/unicharutil/nsEntityConverter.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/intl/unicharutil/nsEntityConverter.h b/intl/unicharutil/nsEntityConverter.h
new file mode 100644
index 000000000..cb78d9bfe
--- /dev/null
+++ b/intl/unicharutil/nsEntityConverter.h
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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/. */
+
+#ifndef nsEntityConverter_h__
+#define nsEntityConverter_h__
+
+#include "nsIEntityConverter.h"
+#include "nsIStringBundle.h"
+#include "nsCOMPtr.h"
+
+class nsEntityConverter: public nsIEntityConverter
+{
+public:
+ //
+ // implementation methods
+ //
+ nsEntityConverter();
+
+ //
+ // nsISupports
+ //
+ NS_DECL_ISUPPORTS
+
+ 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;
+
+protected:
+ // 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();
+};
+
+#endif