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) 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 int size() const { return m_cueSize; } | 110 int size() const { return m_cueSize; } |
111 void setSize(int, ExceptionState&); | 111 void setSize(int, ExceptionState&); |
112 | 112 |
113 const String& align() const; | 113 const String& align() const; |
114 void setAlign(const String&, ExceptionState&); | 114 void setAlign(const String&, ExceptionState&); |
115 | 115 |
116 const String& text() const { return m_content; } | 116 const String& text() const { return m_content; } |
117 void setText(const String&); | 117 void setText(const String&); |
118 | 118 |
119 const String& cueSettings() const { return m_settings; } | 119 void parseSettings(const String&); |
120 void setCueSettings(const String&); | |
121 | 120 |
122 int cueIndex(); | 121 int cueIndex(); |
123 void invalidateCueIndex(); | 122 void invalidateCueIndex(); |
124 | 123 |
125 PassRefPtr<DocumentFragment> getCueAsHTML(); | 124 PassRefPtr<DocumentFragment> getCueAsHTML(); |
126 PassRefPtr<DocumentFragment> createCueRenderingTree(); | 125 PassRefPtr<DocumentFragment> createCueRenderingTree(); |
127 | 126 |
128 using EventTarget::dispatchEvent; | 127 using EventTarget::dispatchEvent; |
129 virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; | 128 virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; |
130 | 129 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 enum CueAlignment { | 165 enum CueAlignment { |
167 Start = 0, | 166 Start = 0, |
168 Middle, | 167 Middle, |
169 End, | 168 End, |
170 Left, | 169 Left, |
171 Right, | 170 Right, |
172 NumberOfAlignments | 171 NumberOfAlignments |
173 }; | 172 }; |
174 CueAlignment getAlignment() const { return m_cueAlignment; } | 173 CueAlignment getAlignment() const { return m_cueAlignment; } |
175 | 174 |
176 bool operator==(const TextTrackCue&) const; | |
177 bool operator!=(const TextTrackCue& cue) const | |
178 { | |
179 return !(*this == cue); | |
180 } | |
181 | |
182 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); | 175 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); |
183 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); | 176 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); |
184 | 177 |
185 protected: | 178 protected: |
186 TextTrackCue(Document&, double start, double end, const String& content); | 179 TextTrackCue(Document&, double start, double end, const String& content); |
187 | 180 |
188 private: | 181 private: |
189 Document& document() const; | 182 Document& document() const; |
190 | 183 |
191 PassRefPtr<TextTrackCueBox> displayTreeInternal(); | 184 PassRefPtr<TextTrackCueBox> displayTreeInternal(); |
192 | 185 |
193 void createWebVTTNodeTree(); | 186 void createWebVTTNodeTree(); |
194 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root)
; | 187 void copyWebVTTNodeToDOMTree(ContainerNode* WebVTTNode, ContainerNode* root)
; |
195 | 188 |
196 std::pair<double, double> getPositionCoordinates() const; | 189 std::pair<double, double> getPositionCoordinates() const; |
197 void parseSettings(const String&); | |
198 | 190 |
199 void determineTextDirection(); | 191 void determineTextDirection(); |
200 void calculateDisplayParameters(); | 192 void calculateDisplayParameters(); |
201 | 193 |
202 void cueWillChange(); | 194 void cueWillChange(); |
203 void cueDidChange(); | 195 void cueDidChange(); |
204 | 196 |
205 enum CueSetting { | 197 enum CueSetting { |
206 None, | 198 None, |
207 Vertical, | 199 Vertical, |
208 Line, | 200 Line, |
209 Position, | 201 Position, |
210 Size, | 202 Size, |
211 Align, | 203 Align, |
212 RegionId | 204 RegionId |
213 }; | 205 }; |
214 CueSetting settingName(const String&); | 206 CueSetting settingName(const String&); |
215 | 207 |
216 String m_id; | 208 String m_id; |
217 double m_startTime; | 209 double m_startTime; |
218 double m_endTime; | 210 double m_endTime; |
219 String m_content; | 211 String m_content; |
220 String m_settings; | |
221 int m_linePosition; | 212 int m_linePosition; |
222 int m_computedLinePosition; | 213 int m_computedLinePosition; |
223 int m_textPosition; | 214 int m_textPosition; |
224 int m_cueSize; | 215 int m_cueSize; |
225 int m_cueIndex; | 216 int m_cueIndex; |
226 | 217 |
227 WritingDirection m_writingDirection; | 218 WritingDirection m_writingDirection; |
228 | 219 |
229 CueAlignment m_cueAlignment; | 220 CueAlignment m_cueAlignment; |
230 | 221 |
(...skipping 14 matching lines...) Expand all Loading... |
245 int m_displaySize; | 236 int m_displaySize; |
246 | 237 |
247 std::pair<float, float> m_displayPosition; | 238 std::pair<float, float> m_displayPosition; |
248 String m_regionId; | 239 String m_regionId; |
249 bool m_notifyRegion; | 240 bool m_notifyRegion; |
250 }; | 241 }; |
251 | 242 |
252 } // namespace WebCore | 243 } // namespace WebCore |
253 | 244 |
254 #endif | 245 #endif |
OLD | NEW |