22 #ifndef CRNAlto_HEADER
23 #define CRNAlto_HEADER
44 Alto(
const Path &fname,
bool char_conversion_throws =
true);
61 Root(
const Root&) =
delete;
62 Root(Root&&) =
default;
63 virtual ~Root()
override {}
76 Root(
const Element &el);
78 Root(
const Element &el,
const Path &imagename,
const StringUTF8 &ns);
80 void init(
const StringUTF8 &imgname);
82 std::unique_ptr<Description> description;
83 std::unique_ptr<Styles> styles;
84 std::unique_ptr<Layout> layout;
107 const Layout::Page::Space&
GetSpace(
const Id &
id)
const;
108 Layout::Page::Space::Block&
GetBlock(
const Id &
id);
109 const Layout::Page::Space::Block&
GetBlock(
const Id &
id)
const;
111 const Layout::Page::Space::TextBlock&
GetTextBlock(
const Id &
id)
const;
112 Layout::Page::Space::TextBlock::TextLine&
GetTextLine(
const Id &
id);
113 const Layout::Page::Space::TextBlock::TextLine&
GetTextLine(
const Id &
id)
const;
114 Layout::Page::Space::TextBlock::TextLine::Word&
GetWord(
const Id &
id);
115 const Layout::Page::Space::TextBlock::TextLine::Word&
GetWord(
const Id &
id)
const;
132 std::unique_ptr<Root> root;
157 using AltoWord = Alto::Layout::Page::Space::TextBlock::TextLine::Word;
158 using AltoWordPtr = Alto::Layout::Page::Space::TextBlock::TextLine::WordPtr;
159 using AltoWhiteSpace = Alto::Layout::Page::Space::TextBlock::TextLine::WhiteSpace;
161 using AltoHyphen = Alto::Layout::Page::Space::TextBlock::TextLine::Hyphen;
162 using AltoHyphenPtr = Alto::Layout::Page::Space::TextBlock::TextLine::HyphenPtr;
Id CreateId()
Creates a new id for the document.
Layout::Page::Space::TextBlock::TextLine & GetTextLine(const Id &id)
Alto::Layout::Page::Space::GraphicalElementPtr AltoGraphicalElementPtr
Alto::Layout::Page::Space::TextBlock::TextLine::Hyphen AltoHyphen
List of styles used in the document.
Styles & GetStyles()
Gets the styles description part of the Alto (may be null)
const Styles & GetStyles() const
Alto::Layout::Page::Space::TextBlockPtr AltoTextBlockPtr
Alto::Layout::Page::Space::TextBlock::TextLine::WhiteSpacePtr AltoWhiteSpacePtr
Alto::Layout::Page::Space::TextBlock::TextLine::WhiteSpace AltoWhiteSpace
const Layout & GetLayout() const
Alto::Layout::Page::Space::Block AltoBlock
Alto::Layout::Page::Space::IllustrationPtr AltoIllustrationPtr
Alto::Layout::Page::Space::Illustration AltoIllustration
Alto::Layout::Page AltoPage
Layout::Page::Space::Block & GetBlock(const Id &id)
Alto::Layout::Page::Space::TextBlock AltoTextBlock
Alto::Layout::Page::Space::BlockPtr AltoBlockPtr
Alto::Layout::Page::Space::TextBlock::TextLine::WordPtr AltoWordPtr
Alto::Layout::Page::Space::ComposedBlock AltoComposedBlock
bool CheckId(const Id &id) const
Checks if an id already exists in the document.
A convenience class for file paths.
Alto::Layout::Page::Space::TextBlock::TextLine::HyphenPtr AltoHyphenPtr
Id AddId(Element &el)
Adds an id to an element.
const Description & GetDescription() const
Alto::Layout::Page::Space::GraphicalElement AltoGraphicalElement
Alto::Description AltoDescription
Layout & GetLayout()
Gets the layout description part of the Alto.
Layout::Page & GetPage(const Id &id)
Alto::Layout::Page::Space::TextBlock::TextLine::Word AltoWord
Alto::Layout::Page::Space AltoSpace
Element & GetElement(const Id &id)
Alto::Layout::Page::Space::TextBlock::TextLine::LineElement AltoTextLineElement
Alto::Layout::Page::Space::ComposedBlockPtr AltoComposedBlockPtr
Alto::Layout::Page::SpacePtr AltoSpacePtr
Layout::Page::Space & GetSpace(const Id &id)
#define CRN_DECLARE_ENUM_OPERATORS(Type)
CRN_ALIAS_SMART_PTR(ImageBW)
A character string class.
Alto(const Path &fname, bool char_conversion_throws=true)
Constructor from a file.
Alto::Layout::PagePtr AltoPagePtr
Layout::Page::Space::TextBlock & GetTextBlock(const Id &id)
Alto::Layout::Page::Space::TextBlock::TextLine::LineElementPtr AltoTextLineElementPtr
Alto::Layout::Page::Space::TextBlock::TextLine AltoTextLine
Alto & operator=(const Alto &)=delete
Alto::Layout::Page::Space::TextBlock::TextLinePtr AltoTextLinePtr
Layout::Page::Space::TextBlock::TextLine::Word & GetWord(const Id &id)
Description & GetDescription()
Gets the global description part of the Alto (may be null)