extensions/spellcheck/src/mozEnglishWordUtils.h
author Birunthan Mohanathas <birunthan@mohanathas.com>
Mon, 25 Aug 2014 12:17:28 -0700
changeset 223096 7afb7c612b5af06164e8495b12fa126b071c2a0e
parent 211154 97477a6da3b18642ea72637c408f69b49ac057dc
child 412434 e155fa765af299f0e8cfb42e0a1709e5b04928b9
permissions -rw-r--r--
Bug 1046841 - Convert remaining files in xpcom/{ds,glue,sample}/ to Gecko style. r=froydnj

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 mozEnglishWordUtils_h__
#define mozEnglishWordUtils_h__

#include "nsCOMPtr.h"
#include "mozISpellI18NUtil.h"
#include "nsIUnicodeEncoder.h"
#include "nsIUnicodeDecoder.h"
#include "nsString.h"

#include "mozITXTToHTMLConv.h" 
#include "nsCycleCollectionParticipant.h"

class mozEnglishWordUtils : public mozISpellI18NUtil
{
public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_MOZISPELLI18NUTIL
  NS_DECL_CYCLE_COLLECTION_CLASS(mozEnglishWordUtils)

  mozEnglishWordUtils();
  /* additional members */
  enum myspCapitalization{
    NoCap,InitCap,AllCap,HuhCap
  };  

protected:
  virtual ~mozEnglishWordUtils();

  mozEnglishWordUtils::myspCapitalization captype(const nsString &word);
  bool ucIsAlpha(char16_t aChar);

  nsString mLanguage;
  nsString mCharset;
  nsCOMPtr<mozITXTToHTMLConv> mURLDetector; // used to detect urls so the spell checker can skip them.
};

#endif