diff options
Diffstat (limited to 'Source/WebCore/editing/TextCheckingHelper.h')
-rw-r--r-- | Source/WebCore/editing/TextCheckingHelper.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/WebCore/editing/TextCheckingHelper.h b/Source/WebCore/editing/TextCheckingHelper.h index a90c9c8b3..d8df24e66 100644 --- a/Source/WebCore/editing/TextCheckingHelper.h +++ b/Source/WebCore/editing/TextCheckingHelper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2014 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * This library is free software; you can redistribute it and/or @@ -18,18 +18,17 @@ * Boston, MA 02110-1301, USA. */ -#ifndef TextCheckingHelper_h -#define TextCheckingHelper_h +#pragma once #include "EditorClient.h" -#include "ExceptionCode.h" +#include "ExceptionOr.h" #include "TextChecking.h" -#include <wtf/text/WTFString.h> namespace WebCore { -class Range; class Position; +class Range; + struct TextCheckingResult; class TextCheckingParagraph { @@ -40,17 +39,18 @@ public: int rangeLength() const; PassRefPtr<Range> subrange(int characterOffset, int characterCount) const; - int offsetTo(const Position&, ExceptionCode&) const; + ExceptionOr<int> offsetTo(const Position&) const; void expandRangeToNextEnd(); + // FIXME: Consider changing this to return a StringView. + const String& text() const; + + // FIXME: Consider removing these and just having the caller use text() directly. int textLength() const { return text().length(); } String textSubstring(unsigned pos, unsigned len = UINT_MAX) const { return text().substring(pos, len); } - const UChar* textDeprecatedCharacters() const { return text().deprecatedCharacters(); } UChar textCharAt(int index) const { return text()[static_cast<unsigned>(index)]; } bool isEmpty() const; - bool isTextEmpty() const { return text().isEmpty(); } - bool isRangeEmpty() const { return checkingStart() >= checkingEnd(); } int checkingStart() const; int checkingEnd() const; @@ -64,9 +64,7 @@ public: private: void invalidateParagraphRangeValues(); - PassRefPtr<Range> checkingRange() const { return m_checkingRange; } PassRefPtr<Range> offsetAsRange() const; - const String& text() const; RefPtr<Range> m_checkingRange; mutable RefPtr<Range> m_paragraphRange; @@ -103,11 +101,8 @@ private: #endif }; -void checkTextOfParagraph(TextCheckerClient*, const UChar* text, int length, - TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results); +void checkTextOfParagraph(TextCheckerClient&, StringView, TextCheckingTypeMask, Vector<TextCheckingResult>&, const VisibleSelection& currentSelection); bool unifiedTextCheckerEnabled(const Frame*); } // namespace WebCore - -#endif // TextCheckingHelper_h |