| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-12-26 14:32:52 +01:00
										 |  |  | #include <LibGC/RootVector.h>
 | 
					
						
							| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | #include <LibWeb/DOM/EventTarget.h>
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/TextTrack.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://html.spec.whatwg.org/multipage/media.html#texttrackcue
 | 
					
						
							|  |  |  | class TextTrackCue : public DOM::EventTarget { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(TextTrackCue, DOM::EventTarget); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(TextTrackCue); | 
					
						
							| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     virtual ~TextTrackCue() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC::Ptr<TextTrack> track() { return m_track; } | 
					
						
							| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     String const& id() const { return m_identifier; } | 
					
						
							|  |  |  |     void set_id(String const& id) { m_identifier = id; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     double start_time() const { return m_start_time; } | 
					
						
							|  |  |  |     void set_start_time(double start_time); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     double end_time() const { return m_end_time; } | 
					
						
							|  |  |  |     WebIDL::ExceptionOr<void> set_end_time(double end_time); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool pause_on_exit() const { return m_pause_on_exit; } | 
					
						
							|  |  |  |     void set_pause_on_exit(bool pause_on_exit) { m_pause_on_exit = pause_on_exit; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     WebIDL::CallbackType* onenter(); | 
					
						
							|  |  |  |     void set_onenter(WebIDL::CallbackType*); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     WebIDL::CallbackType* onexit(); | 
					
						
							|  |  |  |     void set_onexit(WebIDL::CallbackType*); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     TextTrackCue(JS::Realm&, GC::Ptr<TextTrack>); | 
					
						
							| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							|  |  |  |     virtual void visit_edges(Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC::Ptr<TextTrack> m_track; | 
					
						
							| 
									
										
										
										
											2024-09-19 19:41:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/media.html#text-track-cue-identifier
 | 
					
						
							|  |  |  |     String m_identifier; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/media.html#text-track-cue-start-time
 | 
					
						
							|  |  |  |     double m_start_time; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/media.html#text-track-cue-end-time
 | 
					
						
							|  |  |  |     double m_end_time; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/media.html#text-track-cue-pause-on-exit-flag
 | 
					
						
							|  |  |  |     bool m_pause_on_exit; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |