blob: 7f5f3230f5dde10d789c1a5f1bf306c76fe8dbf6 [file] [log] [blame]
oliverd6ae4962007-10-12 14:55:24 +00001/*
darin@apple.com48ac3c42008-06-14 08:46:51 +00002 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
oliverd6ae4962007-10-12 14:55:24 +00003 *
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.com92047332014-03-15 04:08:27 +000013 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
oliverd6ae4962007-10-12 14:55:24 +000014 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
mjs@apple.com92047332014-03-15 04:08:27 +000016 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
oliverd6ae4962007-10-12 14:55:24 +000017 * 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.comef0fbfd2016-04-19 13:03:32 +000026#pragma once
oliverd6ae4962007-10-12 14:55:24 +000027
antti@apple.com08ddc2e2015-01-13 23:57:50 +000028#include "FontRanges.h"
barraclough@apple.comd218c2d2010-08-10 00:38:14 +000029#include <wtf/Forward.h>
ggaren@apple.com58ea1c12007-11-14 02:05:26 +000030#include <wtf/RefCounted.h>
oliverd6ae4962007-10-12 14:55:24 +000031
32namespace WebCore {
33
antti@apple.com214b7162015-09-16 00:16:58 +000034class FontCascadeDescription;
oliverd6ae4962007-10-12 14:55:24 +000035class FontDescription;
mitz@apple.comd0ca1322011-04-10 06:29:26 +000036class FontSelectorClient;
oliverd6ae4962007-10-12 14:55:24 +000037
mmaxfield@apple.combf1f6a92016-05-10 00:13:01 +000038class FontAccessor : public RefCounted<FontAccessor> {
39public:
40 virtual ~FontAccessor() { }
41
42 virtual const Font* font() const = 0;
43 virtual bool isLoading() const = 0;
44};
45
ggaren@apple.com58ea1c12007-11-14 02:05:26 +000046class FontSelector : public RefCounted<FontSelector> {
oliverd6ae4962007-10-12 14:55:24 +000047public:
darin@apple.com734fbf62008-02-10 19:27:12 +000048 virtual ~FontSelector() { }
aestes@apple.com765bd952013-10-10 23:05:22 +000049
antti@apple.com08ddc2e2015-01-13 23:57:50 +000050 virtual FontRanges fontRangesForFamily(const FontDescription&, const AtomicString&) = 0;
mmaxfield@apple.com25a70e82016-01-12 21:36:41 +000051 virtual RefPtr<Font> fallbackFontAt(const FontDescription&, size_t) = 0;
aestes@apple.com765bd952013-10-10 23:05:22 +000052
antti@apple.com5a8f7942015-01-22 21:57:04 +000053 virtual size_t fallbackFontCount() = 0;
mitz@apple.com429a6f62008-07-07 00:00:13 +000054
55 virtual void fontCacheInvalidated() { }
mitz@apple.comd0ca1322011-04-10 06:29:26 +000056
mmaxfield@apple.come527a9b2015-09-05 05:33:16 +000057 virtual void registerForInvalidationCallbacks(FontSelectorClient&) = 0;
58 virtual void unregisterForInvalidationCallbacks(FontSelectorClient&) = 0;
antti@apple.com97e48602013-05-29 15:49:40 +000059
60 virtual unsigned uniqueId() const = 0;
antti@apple.come96f8f52012-02-23 00:42:47 +000061 virtual unsigned version() const = 0;
mitz@apple.comd0ca1322011-04-10 06:29:26 +000062};
63
antti@apple.comef0fbfd2016-04-19 13:03:32 +000064}