oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 1 | /* |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 2 | * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
antti@apple.com | ef0fbfd | 2016-04-19 13:03:32 +0000 | [diff] [blame] | 26 | #pragma once |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 27 | |
antti@apple.com | 08ddc2e | 2015-01-13 23:57:50 +0000 | [diff] [blame] | 28 | #include "FontRanges.h" |
barraclough@apple.com | d218c2d | 2010-08-10 00:38:14 +0000 | [diff] [blame] | 29 | #include <wtf/Forward.h> |
ggaren@apple.com | 58ea1c1 | 2007-11-14 02:05:26 +0000 | [diff] [blame] | 30 | #include <wtf/RefCounted.h> |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 31 | |
| 32 | namespace WebCore { |
| 33 | |
antti@apple.com | 214b716 | 2015-09-16 00:16:58 +0000 | [diff] [blame] | 34 | class FontCascadeDescription; |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 35 | class FontDescription; |
mitz@apple.com | d0ca132 | 2011-04-10 06:29:26 +0000 | [diff] [blame] | 36 | class FontSelectorClient; |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 37 | |
mmaxfield@apple.com | bf1f6a9 | 2016-05-10 00:13:01 +0000 | [diff] [blame] | 38 | class FontAccessor : public RefCounted<FontAccessor> { |
| 39 | public: |
| 40 | virtual ~FontAccessor() { } |
| 41 | |
| 42 | virtual const Font* font() const = 0; |
| 43 | virtual bool isLoading() const = 0; |
| 44 | }; |
| 45 | |
ggaren@apple.com | 58ea1c1 | 2007-11-14 02:05:26 +0000 | [diff] [blame] | 46 | class FontSelector : public RefCounted<FontSelector> { |
oliver | d6ae496 | 2007-10-12 14:55:24 +0000 | [diff] [blame] | 47 | public: |
darin@apple.com | 734fbf6 | 2008-02-10 19:27:12 +0000 | [diff] [blame] | 48 | virtual ~FontSelector() { } |
aestes@apple.com | 765bd95 | 2013-10-10 23:05:22 +0000 | [diff] [blame] | 49 | |
antti@apple.com | 08ddc2e | 2015-01-13 23:57:50 +0000 | [diff] [blame] | 50 | virtual FontRanges fontRangesForFamily(const FontDescription&, const AtomicString&) = 0; |
mmaxfield@apple.com | 25a70e8 | 2016-01-12 21:36:41 +0000 | [diff] [blame] | 51 | virtual RefPtr<Font> fallbackFontAt(const FontDescription&, size_t) = 0; |
aestes@apple.com | 765bd95 | 2013-10-10 23:05:22 +0000 | [diff] [blame] | 52 | |
antti@apple.com | 5a8f794 | 2015-01-22 21:57:04 +0000 | [diff] [blame] | 53 | virtual size_t fallbackFontCount() = 0; |
mitz@apple.com | 429a6f6 | 2008-07-07 00:00:13 +0000 | [diff] [blame] | 54 | |
| 55 | virtual void fontCacheInvalidated() { } |
mitz@apple.com | d0ca132 | 2011-04-10 06:29:26 +0000 | [diff] [blame] | 56 | |
mmaxfield@apple.com | e527a9b | 2015-09-05 05:33:16 +0000 | [diff] [blame] | 57 | virtual void registerForInvalidationCallbacks(FontSelectorClient&) = 0; |
| 58 | virtual void unregisterForInvalidationCallbacks(FontSelectorClient&) = 0; |
antti@apple.com | 97e4860 | 2013-05-29 15:49:40 +0000 | [diff] [blame] | 59 | |
| 60 | virtual unsigned uniqueId() const = 0; |
antti@apple.com | e96f8f5 | 2012-02-23 00:42:47 +0000 | [diff] [blame] | 61 | virtual unsigned version() const = 0; |
mitz@apple.com | d0ca132 | 2011-04-10 06:29:26 +0000 | [diff] [blame] | 62 | }; |
| 63 | |
antti@apple.com | ef0fbfd | 2016-04-19 13:03:32 +0000 | [diff] [blame] | 64 | } |