12 class iterator_selector
15 virtual bool select(const std::shared_ptr
<render_item
>& el
) = 0;
18 ~iterator_selector() = default;
21 enum iterator_item_type
23 iterator_item_type_child
,
24 iterator_item_type_start_parent
,
25 iterator_item_type_end_parent
28 class elements_iterator
31 iterator_selector
* m_go_inside
;
32 iterator_selector
* m_select
;
36 * Checks if iterator should go inside the element
38 * @param el element to check
39 * @return true to go inside
41 bool go_inside(const std::shared_ptr
<render_item
>& el
);
44 elements_iterator(bool return_parents
, iterator_selector
* go_inside
, iterator_selector
* select
);
45 ~elements_iterator() = default;
47 void process(const std::shared_ptr
<render_item
>& container
, const std::function
<void (std::shared_ptr
<render_item
>&, iterator_item_type
)>& func
);
53 class go_inside_inline final
: public iterator_selector
56 bool select(const std::shared_ptr
<render_item
>& el
) override
;
59 class inline_selector final
: public iterator_selector
62 bool select(const std::shared_ptr
<render_item
>& el
) override
;
65 class go_inside_table final
: public iterator_selector
68 bool select(const std::shared_ptr
<render_item
>& el
) override
;
71 class table_rows_selector final
: public iterator_selector
74 bool select(const std::shared_ptr
<render_item
>& el
) override
;
77 class table_cells_selector final
: public iterator_selector
80 bool select(const std::shared_ptr
<render_item
>& el
) override
;
84 #endif // LH_ITERATORS_H