libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
page-tree.hxx
1#ifndef art__paperback__internals__page_tree_hxx_
2#define art__paperback__internals__page_tree_hxx_
3
4#include <art/paperback/types.hxx>
5#include <art/paperback/forward.hxx>
6#include <art/paperback/page.hxx>
7
8#include <art/paperback/carousel/object.hxx>
9
11{
12
13 /// Represents a PDF page tree.
14 ///
16 {
17 public:
18 struct Create_new {};
19 static constexpr Create_new const create_new{};
20
21 /// Constructor.
22 ///
23 Page_tree(Create_new const&, Document_catalog&);
24
25 /// Destructor.
26 ///
27 ~Page_tree() noexcept;
28
29 /// Access the parent document catalog.
30 ///
32 document_catalog() const;
33
34 /// Access the associated data object.
35 ///
36 Carousel::Object
37 object() const;
38
39 /// Create a new page and add it to the page tree.
40 ///
41 Page&
42 create_page(Page::Properties const&);
43
44 /// Get page.
45 ///
46 Page&
47 get_page(size_t);
48
49 /// Get page.
50 ///
51 Page const&
52 get_page(size_t) const;
53
54 /// Erase page.
55 ///
56 void
57 erase_page(size_t);
58
59 private:
60 Page_tree(Page_tree const&) = delete;
61 Page_tree(Page_tree&&) = delete;
62 Page_tree& operator=(Page_tree const&) = delete;
63 Page_tree& operator=(Page_tree&&) = delete;
64
65 private:
66 struct Internal;
67 unique_ptr<Internal> internal;
68
69 };
70
71 /// Get the document associated with a page tree.
72 ///
75
76 /// Get the document associated with a page tree.
77 ///
78 Document const&
79 document(Page_tree const&);
80
81} // namespace Art::Paperback::Internals
82
83#endif
Definition document.hxx:12
Definition document-catalog.hxx:13
Represents a PDF page tree.
Definition page-tree.hxx:16
Page_tree(Create_new const &, Document_catalog &)
Constructor.
Definition page-tree.cxx:64
~Page_tree() noexcept
Destructor.
Definition page-tree.cxx:69
Page & get_page(size_t)
Get page.
Definition page-tree.cxx:110
void erase_page(size_t)
Erase page.
Definition page-tree.cxx:124
Page & create_page(Page::Properties const &)
Create a new page and add it to the page tree.
Definition page-tree.cxx:92
Document_catalog & document_catalog() const
Access the parent document catalog.
Definition page-tree.cxx:76
Definition page.hxx:12
COS file format implementation namespace.
Definition array.cxx:6
Internal namespace.
Definition forward.hxx:91
Document & document(Page_tree &page_tree)
Get the document associated with a page tree.
Definition page-tree.cxx:133