OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "wtf/text/WTFString.h" | 32 #include "wtf/text/WTFString.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 class Document; | 36 class Document; |
37 class ExceptionState; | 37 class ExceptionState; |
38 class HTMLMediaElement; | 38 class HTMLMediaElement; |
39 class TextTrack; | 39 class TextTrack; |
40 class TextTrackCue; | 40 class TextTrackCue; |
41 class TextTrackCueList; | 41 class TextTrackCueList; |
42 class TextTrackRegion; | 42 class VTTRegion; |
43 class TextTrackRegionList; | 43 class VTTRegionList; |
44 | 44 |
45 class TextTrackClient { | 45 class TextTrackClient { |
46 public: | 46 public: |
47 virtual ~TextTrackClient() { } | 47 virtual ~TextTrackClient() { } |
48 virtual void textTrackKindChanged(TextTrack*) = 0; | 48 virtual void textTrackKindChanged(TextTrack*) = 0; |
49 virtual void textTrackModeChanged(TextTrack*) = 0; | 49 virtual void textTrackModeChanged(TextTrack*) = 0; |
50 virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0; | 50 virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0; |
51 virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0; | 51 virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0; |
52 virtual void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; | 52 virtual void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; |
53 virtual void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; | 53 virtual void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 TextTrackCueList* cues(); | 94 TextTrackCueList* cues(); |
95 TextTrackCueList* activeCues() const; | 95 TextTrackCueList* activeCues() const; |
96 | 96 |
97 void clearClient() { m_client = 0; } | 97 void clearClient() { m_client = 0; } |
98 TextTrackClient* client() { return m_client; } | 98 TextTrackClient* client() { return m_client; } |
99 | 99 |
100 void addCue(PassRefPtr<TextTrackCue>); | 100 void addCue(PassRefPtr<TextTrackCue>); |
101 void removeCue(TextTrackCue*, ExceptionState&); | 101 void removeCue(TextTrackCue*, ExceptionState&); |
102 bool hasCue(TextTrackCue*); | 102 bool hasCue(TextTrackCue*); |
103 | 103 |
104 TextTrackRegionList* regions(); | 104 VTTRegionList* regions(); |
105 void addRegion(PassRefPtr<TextTrackRegion>); | 105 void addRegion(PassRefPtr<VTTRegion>); |
106 void removeRegion(TextTrackRegion*, ExceptionState&); | 106 void removeRegion(VTTRegion*, ExceptionState&); |
107 | 107 |
108 void cueWillChange(TextTrackCue*); | 108 void cueWillChange(TextTrackCue*); |
109 void cueDidChange(TextTrackCue*); | 109 void cueDidChange(TextTrackCue*); |
110 | 110 |
111 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); | 111 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); |
112 | 112 |
113 enum TextTrackType { TrackElement, AddTrack, InBand }; | 113 enum TextTrackType { TrackElement, AddTrack, InBand }; |
114 TextTrackType trackType() const { return m_trackType; } | 114 TextTrackType trackType() const { return m_trackType; } |
115 | 115 |
116 virtual bool isClosedCaptions() const { return false; } | 116 virtual bool isClosedCaptions() const { return false; } |
(...skipping 21 matching lines...) Expand all Loading... |
138 // EventTarget methods | 138 // EventTarget methods |
139 virtual const AtomicString& interfaceName() const OVERRIDE; | 139 virtual const AtomicString& interfaceName() const OVERRIDE; |
140 virtual ExecutionContext* executionContext() const OVERRIDE; | 140 virtual ExecutionContext* executionContext() const OVERRIDE; |
141 | 141 |
142 protected: | 142 protected: |
143 TextTrack(Document&, TextTrackClient*, const AtomicString& kind, const Atomi
cString& label, const AtomicString& language, TextTrackType); | 143 TextTrack(Document&, TextTrackClient*, const AtomicString& kind, const Atomi
cString& label, const AtomicString& language, TextTrackType); |
144 | 144 |
145 RefPtr<TextTrackCueList> m_cues; | 145 RefPtr<TextTrackCueList> m_cues; |
146 | 146 |
147 private: | 147 private: |
148 TextTrackRegionList* ensureTextTrackRegionList(); | 148 VTTRegionList* ensureVTTRegionList(); |
149 RefPtr<TextTrackRegionList> m_regions; | 149 RefPtr<VTTRegionList> m_regions; |
150 | 150 |
151 TextTrackCueList* ensureTextTrackCueList(); | 151 TextTrackCueList* ensureTextTrackCueList(); |
152 | 152 |
153 // FIXME: Remove this pointer and get the Document from m_client | 153 // FIXME: Remove this pointer and get the Document from m_client |
154 Document* m_document; | 154 Document* m_document; |
155 | 155 |
156 HTMLMediaElement* m_mediaElement; | 156 HTMLMediaElement* m_mediaElement; |
157 AtomicString m_kind; | 157 AtomicString m_kind; |
158 AtomicString m_label; | 158 AtomicString m_label; |
159 AtomicString m_language; | 159 AtomicString m_language; |
160 AtomicString m_mode; | 160 AtomicString m_mode; |
161 TextTrackClient* m_client; | 161 TextTrackClient* m_client; |
162 TextTrackType m_trackType; | 162 TextTrackType m_trackType; |
163 ReadinessState m_readinessState; | 163 ReadinessState m_readinessState; |
164 int m_trackIndex; | 164 int m_trackIndex; |
165 int m_renderedTrackIndex; | 165 int m_renderedTrackIndex; |
166 bool m_hasBeenConfigured; | 166 bool m_hasBeenConfigured; |
167 }; | 167 }; |
168 | 168 |
169 } // namespace WebCore | 169 } // namespace WebCore |
170 | 170 |
171 #endif | 171 #endif |
OLD | NEW |