mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
e193f90a5f
IGNORE IDL --HG-- extra : rebase_source : 823a82df0b5590799b7e3e010c9f0aff8141f091 extra : histedit_source : 7a16332b7c8955a4b097467829b4300a128c59f8
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
/* -*- 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
|