1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/base/CompositionStringSynthesizer.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_dom_compositionstringsynthesizer_h__ 1.10 +#define mozilla_dom_compositionstringsynthesizer_h__ 1.11 + 1.12 +#include "nsICompositionStringSynthesizer.h" 1.13 +#include "nsString.h" 1.14 +#include "nsWeakReference.h" 1.15 +#include "mozilla/Attributes.h" 1.16 +#include "mozilla/TextRange.h" 1.17 + 1.18 +class nsIWidget; 1.19 +class nsPIDOMWindow; 1.20 + 1.21 +namespace mozilla { 1.22 +namespace dom { 1.23 + 1.24 +class CompositionStringSynthesizer MOZ_FINAL : 1.25 + public nsICompositionStringSynthesizer 1.26 +{ 1.27 +public: 1.28 + CompositionStringSynthesizer(nsPIDOMWindow* aWindow); 1.29 + ~CompositionStringSynthesizer(); 1.30 + 1.31 + NS_DECL_ISUPPORTS 1.32 + NS_DECL_NSICOMPOSITIONSTRINGSYNTHESIZER 1.33 + 1.34 +private: 1.35 + nsWeakPtr mWindow; // refers an instance of nsPIDOMWindow 1.36 + nsString mString; 1.37 + nsRefPtr<TextRangeArray> mClauses; 1.38 + TextRange mCaret; 1.39 + 1.40 + nsIWidget* GetWidget(); 1.41 + void ClearInternal(); 1.42 +}; 1.43 + 1.44 +} // namespace dom 1.45 +} // namespace mozilla 1.46 + 1.47 +#endif // #ifndef mozilla_dom_compositionstringsynthesizer_h__