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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class Document; | 43 class Document; |
44 class DocumentFragment; | 44 class DocumentFragment; |
45 class ExceptionState; | 45 class ExceptionState; |
46 class ExecutionContext; | 46 class ExecutionContext; |
47 class TextTrack; | 47 class TextTrack; |
48 class TextTrackCue; | 48 class TextTrackCue; |
49 | 49 |
50 // ---------------------------- | 50 // ---------------------------- |
51 | 51 |
52 class TextTrackCueBox : public HTMLDivElement { | 52 class TextTrackCueBox FINAL : public HTMLDivElement { |
53 public: | 53 public: |
54 static PassRefPtr<TextTrackCueBox> create(Document& document, TextTrackCue*
cue) | 54 static PassRefPtr<TextTrackCueBox> create(Document& document, TextTrackCue*
cue) |
55 { | 55 { |
56 return adoptRef(new TextTrackCueBox(document, cue)); | 56 return adoptRef(new TextTrackCueBox(document, cue)); |
57 } | 57 } |
58 | 58 |
59 TextTrackCue* getCue() const; | 59 TextTrackCue* getCue() const; |
60 virtual void applyCSSProperties(const IntSize& videoSize); | 60 void applyCSSProperties(const IntSize& videoSize); |
61 | 61 |
62 static const AtomicString& textTrackCueBoxShadowPseudoId(); | 62 static const AtomicString& textTrackCueBoxShadowPseudoId(); |
63 | 63 |
64 protected: | 64 protected: |
65 TextTrackCueBox(Document&, TextTrackCue*); | 65 TextTrackCueBox(Document&, TextTrackCue*); |
66 | 66 |
67 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 67 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
68 | 68 |
69 TextTrackCue* m_cue; | 69 TextTrackCue* m_cue; |
70 }; | 70 }; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 bool pauseOnExit() const { return m_pauseOnExit; } | 103 bool pauseOnExit() const { return m_pauseOnExit; } |
104 void setPauseOnExit(bool); | 104 void setPauseOnExit(bool); |
105 | 105 |
106 const String& vertical() const; | 106 const String& vertical() const; |
107 void setVertical(const String&, ExceptionState&); | 107 void setVertical(const String&, ExceptionState&); |
108 | 108 |
109 bool snapToLines() const { return m_snapToLines; } | 109 bool snapToLines() const { return m_snapToLines; } |
110 void setSnapToLines(bool); | 110 void setSnapToLines(bool); |
111 | 111 |
112 int line() const { return m_linePosition; } | 112 int line() const { return m_linePosition; } |
113 virtual void setLine(int, ExceptionState&); | 113 void setLine(int, ExceptionState&); |
114 | 114 |
115 int position() const { return m_textPosition; } | 115 int position() const { return m_textPosition; } |
116 virtual void setPosition(int, ExceptionState&); | 116 void setPosition(int, ExceptionState&); |
117 | 117 |
118 int size() const { return m_cueSize; } | 118 int size() const { return m_cueSize; } |
119 virtual void setSize(int, ExceptionState&); | 119 void setSize(int, ExceptionState&); |
120 | 120 |
121 const String& align() const; | 121 const String& align() const; |
122 void setAlign(const String&, ExceptionState&); | 122 void setAlign(const String&, ExceptionState&); |
123 | 123 |
124 const String& text() const { return m_content; } | 124 const String& text() const { return m_content; } |
125 void setText(const String&); | 125 void setText(const String&); |
126 | 126 |
127 const String& cueSettings() const { return m_settings; } | 127 const String& cueSettings() const { return m_settings; } |
128 void setCueSettings(const String&); | 128 void setCueSettings(const String&); |
129 | 129 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 enum CueAlignment { | 174 enum CueAlignment { |
175 Start = 0, | 175 Start = 0, |
176 Middle, | 176 Middle, |
177 End, | 177 End, |
178 Left, | 178 Left, |
179 Right, | 179 Right, |
180 NumberOfAlignments | 180 NumberOfAlignments |
181 }; | 181 }; |
182 CueAlignment getAlignment() const { return m_cueAlignment; } | 182 CueAlignment getAlignment() const { return m_cueAlignment; } |
183 | 183 |
184 virtual void videoSizeDidChange(const IntSize&) { } | 184 bool operator==(const TextTrackCue&) const; |
185 | 185 bool operator!=(const TextTrackCue& cue) const |
186 virtual bool operator==(const TextTrackCue&) const; | |
187 virtual bool operator!=(const TextTrackCue& cue) const | |
188 { | 186 { |
189 return !(*this == cue); | 187 return !(*this == cue); |
190 } | 188 } |
191 | 189 |
192 enum CueType { | |
193 Generic, | |
194 WebVTT | |
195 }; | |
196 virtual CueType cueType() const { return WebVTT; } | |
197 | |
198 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); | 190 DEFINE_ATTRIBUTE_EVENT_LISTENER(enter); |
199 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); | 191 DEFINE_ATTRIBUTE_EVENT_LISTENER(exit); |
200 | 192 |
201 private: | 193 private: |
202 TextTrackCue(Document&, double start, double end, const String& content); | 194 TextTrackCue(Document&, double start, double end, const String& content); |
203 | 195 |
204 Document& document() const; | 196 Document& document() const; |
205 | 197 |
206 PassRefPtr<TextTrackCueBox> displayTreeInternal(); | 198 PassRefPtr<TextTrackCueBox> displayTreeInternal(); |
207 | 199 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 int m_displaySize; | 252 int m_displaySize; |
261 | 253 |
262 std::pair<float, float> m_displayPosition; | 254 std::pair<float, float> m_displayPosition; |
263 String m_regionId; | 255 String m_regionId; |
264 bool m_notifyRegion; | 256 bool m_notifyRegion; |
265 }; | 257 }; |
266 | 258 |
267 } // namespace WebCore | 259 } // namespace WebCore |
268 | 260 |
269 #endif | 261 #endif |
OLD | NEW |