OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef Hyphenation_h |
| 6 #define Hyphenation_h |
| 7 |
| 8 #include "platform/PlatformExport.h" |
| 9 #include "wtf/Forward.h" |
| 10 #include "wtf/HashMap.h" |
| 11 #include "wtf/RefCounted.h" |
| 12 #include "wtf/text/AtomicStringHash.h" |
| 13 #include "wtf/text/StringHash.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class StringView; |
| 18 |
| 19 class PLATFORM_EXPORT Hyphenation : public RefCounted<Hyphenation> { |
| 20 public: |
| 21 virtual ~Hyphenation() {} |
| 22 |
| 23 static Hyphenation* get(const AtomicString& locale); |
| 24 |
| 25 virtual size_t lastHyphenLocation(const StringView&, size_t beforeIndex, con
st AtomicString& locale) const = 0; |
| 26 |
| 27 static void setForTesting(const AtomicString& locale, PassRefPtr<Hyphenation
>); |
| 28 static void clearForTesting(); |
| 29 |
| 30 private: |
| 31 using HyphenationMap = HashMap<AtomicString, RefPtr<Hyphenation>, CaseFoldin
gHash>; |
| 32 |
| 33 static HyphenationMap& getHyphenationMap(); |
| 34 static PassRefPtr<Hyphenation> platformGetHyphenation(const AtomicString& lo
cale); |
| 35 }; |
| 36 |
| 37 } // namespace blink |
| 38 |
| 39 #endif // Hyphenation_h |
OLD | NEW |