mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:32:44 +00:00 
			
		
		
		
	 04b9dc2d30
			
		
	
	
		04b9dc2d30
		
	
	
	
	
		
			
			Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			739 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			739 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/Badge.h>
 | |
| #include <AK/RefPtr.h>
 | |
| #include <AK/Vector.h>
 | |
| #include <LibHTML/TreeNode.h>
 | |
| 
 | |
| enum class NodeType : unsigned {
 | |
|     INVALID = 0,
 | |
|     ELEMENT_NODE = 1,
 | |
|     TEXT_NODE = 3,
 | |
|     DOCUMENT_NODE = 9,
 | |
| };
 | |
| 
 | |
| class ParentNode;
 | |
| 
 | |
| class Node : public TreeNode<Node> {
 | |
| public:
 | |
|     virtual ~Node();
 | |
| 
 | |
|     NodeType type() const { return m_type; }
 | |
|     bool is_element() const { return type() == NodeType::ELEMENT_NODE; }
 | |
|     bool is_text() const { return type() == NodeType::TEXT_NODE; }
 | |
|     bool is_document() const { return type() == NodeType::DOCUMENT_NODE; }
 | |
|     bool is_parent_node() const { return is_element() || is_document(); }
 | |
| 
 | |
| protected:
 | |
|     explicit Node(NodeType);
 | |
| 
 | |
|     NodeType m_type { NodeType::INVALID };
 | |
| };
 |