| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/html/track/TrackBase.h" | 31 #include "core/html/track/TrackBase.h" |
| 32 #include "wtf/text/WTFString.h" | 32 #include "wtf/text/WTFString.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 class ExceptionState; | 36 class ExceptionState; |
| 37 class HTMLMediaElement; | 37 class HTMLMediaElement; |
| 38 class TextTrack; | 38 class TextTrack; |
| 39 class TextTrackCue; | 39 class TextTrackCue; |
| 40 class TextTrackCueList; | 40 class TextTrackCueList; |
| 41 #if ENABLE(WEBVTT_REGIONS) | |
| 42 class TextTrackRegion; | 41 class TextTrackRegion; |
| 43 class TextTrackRegionList; | 42 class TextTrackRegionList; |
| 44 #endif | |
| 45 | 43 |
| 46 class TextTrackClient { | 44 class TextTrackClient { |
| 47 public: | 45 public: |
| 48 virtual ~TextTrackClient() { } | 46 virtual ~TextTrackClient() { } |
| 49 virtual void textTrackKindChanged(TextTrack*) = 0; | 47 virtual void textTrackKindChanged(TextTrack*) = 0; |
| 50 virtual void textTrackModeChanged(TextTrack*) = 0; | 48 virtual void textTrackModeChanged(TextTrack*) = 0; |
| 51 virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0; | 49 virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0; |
| 52 virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0; | 50 virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0; |
| 53 virtual void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; | 51 virtual void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; |
| 54 virtual void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; | 52 virtual void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 TextTrackCueList* cues(); | 93 TextTrackCueList* cues(); |
| 96 TextTrackCueList* activeCues() const; | 94 TextTrackCueList* activeCues() const; |
| 97 | 95 |
| 98 void clearClient() { m_client = 0; } | 96 void clearClient() { m_client = 0; } |
| 99 TextTrackClient* client() { return m_client; } | 97 TextTrackClient* client() { return m_client; } |
| 100 | 98 |
| 101 void addCue(PassRefPtr<TextTrackCue>); | 99 void addCue(PassRefPtr<TextTrackCue>); |
| 102 void removeCue(TextTrackCue*, ExceptionState&); | 100 void removeCue(TextTrackCue*, ExceptionState&); |
| 103 bool hasCue(TextTrackCue*); | 101 bool hasCue(TextTrackCue*); |
| 104 | 102 |
| 105 #if ENABLE(WEBVTT_REGIONS) | |
| 106 TextTrackRegionList* regions(); | 103 TextTrackRegionList* regions(); |
| 107 void addRegion(PassRefPtr<TextTrackRegion>); | 104 void addRegion(PassRefPtr<TextTrackRegion>); |
| 108 void removeRegion(TextTrackRegion*, ExceptionState&); | 105 void removeRegion(TextTrackRegion*, ExceptionState&); |
| 109 #endif | |
| 110 | 106 |
| 111 void cueWillChange(TextTrackCue*); | 107 void cueWillChange(TextTrackCue*); |
| 112 void cueDidChange(TextTrackCue*); | 108 void cueDidChange(TextTrackCue*); |
| 113 | 109 |
| 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); | 110 DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); |
| 115 | 111 |
| 116 enum TextTrackType { TrackElement, AddTrack, InBand }; | 112 enum TextTrackType { TrackElement, AddTrack, InBand }; |
| 117 TextTrackType trackType() const { return m_trackType; } | 113 TextTrackType trackType() const { return m_trackType; } |
| 118 | 114 |
| 119 virtual bool isClosedCaptions() const { return false; } | 115 virtual bool isClosedCaptions() const { return false; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 131 bool hasBeenConfigured() const { return m_hasBeenConfigured; } | 127 bool hasBeenConfigured() const { return m_hasBeenConfigured; } |
| 132 void setHasBeenConfigured(bool flag) { m_hasBeenConfigured = flag; } | 128 void setHasBeenConfigured(bool flag) { m_hasBeenConfigured = flag; } |
| 133 | 129 |
| 134 virtual bool isDefault() const { return false; } | 130 virtual bool isDefault() const { return false; } |
| 135 virtual void setIsDefault(bool) { } | 131 virtual void setIsDefault(bool) { } |
| 136 | 132 |
| 137 void removeAllCues(); | 133 void removeAllCues(); |
| 138 | 134 |
| 139 protected: | 135 protected: |
| 140 TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kin
d, const AtomicString& label, const AtomicString& language, TextTrackType); | 136 TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kin
d, const AtomicString& label, const AtomicString& language, TextTrackType); |
| 141 #if ENABLE(WEBVTT_REGIONS) | |
| 142 TextTrackRegionList* regionList(); | |
| 143 #endif | |
| 144 | 137 |
| 145 RefPtr<TextTrackCueList> m_cues; | 138 RefPtr<TextTrackCueList> m_cues; |
| 146 | 139 |
| 147 private: | 140 private: |
| 148 | 141 |
| 149 #if ENABLE(WEBVTT_REGIONS) | |
| 150 TextTrackRegionList* ensureTextTrackRegionList(); | 142 TextTrackRegionList* ensureTextTrackRegionList(); |
| 151 RefPtr<TextTrackRegionList> m_regions; | 143 RefPtr<TextTrackRegionList> m_regions; |
| 152 #endif | |
| 153 | 144 |
| 154 TextTrackCueList* ensureTextTrackCueList(); | 145 TextTrackCueList* ensureTextTrackCueList(); |
| 155 | 146 |
| 156 HTMLMediaElement* m_mediaElement; | 147 HTMLMediaElement* m_mediaElement; |
| 157 AtomicString m_kind; | 148 AtomicString m_kind; |
| 158 AtomicString m_label; | 149 AtomicString m_label; |
| 159 AtomicString m_language; | 150 AtomicString m_language; |
| 160 AtomicString m_mode; | 151 AtomicString m_mode; |
| 161 TextTrackClient* m_client; | 152 TextTrackClient* m_client; |
| 162 TextTrackType m_trackType; | 153 TextTrackType m_trackType; |
| 163 ReadinessState m_readinessState; | 154 ReadinessState m_readinessState; |
| 164 int m_trackIndex; | 155 int m_trackIndex; |
| 165 int m_renderedTrackIndex; | 156 int m_renderedTrackIndex; |
| 166 bool m_hasBeenConfigured; | 157 bool m_hasBeenConfigured; |
| 167 }; | 158 }; |
| 168 | 159 |
| 169 } // namespace WebCore | 160 } // namespace WebCore |
| 170 | 161 |
| 171 #endif | 162 #endif |
| OLD | NEW |