| 
									
										
										
										
											2023-03-05 17:29:11 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2023, Kenneth Myhra <kennethmyhra@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							|  |  |  | #include <LibWeb/XHR/FormData.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::XHR { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class FormDataIterator : public Bindings::PlatformObject { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(FormDataIterator, Bindings::PlatformObject); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(FormDataIterator); | 
					
						
							| 
									
										
										
										
											2023-03-05 17:29:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     [[nodiscard]] static GC::Ref<FormDataIterator> create(FormData const&, JS::Object::PropertyKind iterator_kind); | 
					
						
							| 
									
										
										
										
											2023-03-05 17:29:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual ~FormDataIterator() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     JS::Object* next(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     FormDataIterator(FormData const&, JS::Object::PropertyKind iterator_kind); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2023-03-05 17:29:11 +01:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC::Ref<FormData const> m_form_data; | 
					
						
							| 
									
										
										
										
											2023-03-05 17:29:11 +01:00
										 |  |  |     JS::Object::PropertyKind m_iterator_kind; | 
					
						
							|  |  |  |     size_t m_index { 0 }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |