author Carsten "Tomcat" Book <>
Fri, 21 Nov 2014 11:05:45 +0100
changeset 241220 1ff8792d5db27809e855ea14430b7b56450f2034
parent 217668 80aec550b1e06b59ccd4c0f1a33420221421141e
child 248167 cdbe4d2202d7b7451398a92a2e73b9b341d89d27
permissions -rw-r--r--
Backed out changeset d917152c263d (bug 920938) for build warning/failures

/* -*- 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 */

#ifndef nsEntityConverter_h__
#define nsEntityConverter_h__

#include "nsIEntityConverter.h"
#include "nsIStringBundle.h"
#include "nsCOMPtr.h"


class nsEntityVersionList
    nsEntityVersionList() {}
    uint32_t mVersion;
    char16_t mEntityListName[kVERSION_STRING_LEN+1];
    nsCOMPtr<nsIStringBundle> mEntities;

class nsEntityConverter: public nsIEntityConverter
	// implementation methods

	// nsISupports

	// nsIEntityConverter
	NS_IMETHOD ConvertUTF32ToEntity(uint32_t character, uint32_t entityVersion, char **_retval);
	NS_IMETHOD ConvertToEntity(char16_t character, uint32_t entityVersion, char **_retval);

	NS_IMETHOD ConvertToEntities(const char16_t *inString, uint32_t entityVersion, char16_t **_retval);


  // load a version property file and generate a version list (number/name pair)
  NS_IMETHOD LoadVersionPropertyFile();

  // map version number to version string
  const char16_t* GetVersionName(uint32_t versionNumber);

  // map version number to a string bundle
  nsIStringBundle* GetVersionBundleInstance(uint32_t versionNumber);

  // load a string bundle file
  already_AddRefed<nsIStringBundle> LoadEntityBundle(uint32_t version);

  nsEntityVersionList *mVersionList;            // array of version number/name pairs
  uint32_t mVersionListLength;                  // number of supported versions

  virtual ~nsEntityConverter();