IWAText.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libetonyek project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef IWATEXT_H_INCLUDED
11#define IWATEXT_H_INCLUDED
12
13#include <functional>
14#include <map>
15#include <set>
16#include <string>
17
18#include <librevenge/librevenge.h>
19
20#include "IWORKEnum.h"
21#include "IWORKStyle_fwd.h"
22
23 namespace libetonyek
24{
25
26 class IWORKLanguageManager;
27 class IWORKOutputElements;
28 class IWORKText;
29
30 class IWAText
31{
32 public:
33 IWAText(const std::string &text, IWORKLanguageManager &langManager);
34
35 void setPageMasters(const std::map<unsigned, IWORKStylePtr_t> &pageMasters);
36 void setSections(const std::map<unsigned, IWORKStylePtr_t> &sections);
37 void setParagraphs(const std::map<unsigned, IWORKStylePtr_t> &paras);
38 void setSpans(const std::map<unsigned, IWORKStylePtr_t> &spans);
39
40 void setLanguages(const std::map<unsigned, std::string> &langs);
41 void setLinks(const std::map<unsigned, std::string> &links);
42 void setListLevels(const std::map<unsigned, unsigned> &levels);
43 void setLists(const std::map<unsigned, IWORKStylePtr_t> &lists);
44 void setDropCaps(const std::map<unsigned, IWORKStylePtr_t> &dropCaps);
45 void setRTLs(const std::map<unsigned, bool> &rtls);
46
47 void setAttachments(const std::multimap<unsigned, std::function<void(unsigned, bool &)> > &attachments);
48
49 void parse(IWORKText &collector, const std::function<void(unsigned, IWORKStylePtr_t)> &openPageSpan=nullptr);
50
51 private:
52 const librevenge::RVNGString m_text;
53 IWORKLanguageManager &m_langManager;
54
55 std::map<unsigned, IWORKStylePtr_t> m_pageMasters;
56 std::map<unsigned, IWORKStylePtr_t> m_sections;
57 std::map<unsigned, IWORKStylePtr_t> m_paras;
58 std::map<unsigned, IWORKStylePtr_t> m_spans;
59
60 std::map<unsigned, std::string> m_langs;
61 std::map<unsigned, std::string> m_links;
62 std::map<unsigned, IWORKStylePtr_t> m_lists;
63 std::map<unsigned, unsigned> m_listLevels;
64 std::map<unsigned, IWORKStylePtr_t> m_dropCaps;
65 std::map<unsigned, bool> m_rtls;
66
67 std::multimap<unsigned, std::function<void(unsigned, bool &)> > m_attachments;
68};
69
70}
71
72#endif
73
74/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKEnum.h
IWORKStyle_fwd.h
libetonyek::IWAText::m_lists
std::map< unsigned, IWORKStylePtr_t > m_lists
Definition IWAText.h:62
libetonyek::IWAText::IWAText
IWAText(const std::string &text, IWORKLanguageManager &langManager)
Definition IWAText.cpp:41
libetonyek::IWAText::setLinks
void setLinks(const std::map< unsigned, std::string > &links)
Definition IWAText.cpp:85
libetonyek::IWAText::setSections
void setSections(const std::map< unsigned, IWORKStylePtr_t > &sections)
Definition IWAText.cpp:65
libetonyek::IWAText::m_dropCaps
std::map< unsigned, IWORKStylePtr_t > m_dropCaps
Definition IWAText.h:64
libetonyek::IWAText::setPageMasters
void setPageMasters(const std::map< unsigned, IWORKStylePtr_t > &pageMasters)
Definition IWAText.cpp:60
libetonyek::IWAText::m_langManager
IWORKLanguageManager & m_langManager
Definition IWAText.h:53
libetonyek::IWAText::m_text
const librevenge::RVNGString m_text
Definition IWAText.h:52
libetonyek::IWAText::setSpans
void setSpans(const std::map< unsigned, IWORKStylePtr_t > &spans)
Definition IWAText.cpp:75
libetonyek::IWAText::m_listLevels
std::map< unsigned, unsigned > m_listLevels
Definition IWAText.h:63
libetonyek::IWAText::parse
void parse(IWORKText &collector, const std::function< void(unsigned, IWORKStylePtr_t)> &openPageSpan=nullptr)
Definition IWAText.cpp:115
libetonyek::IWAText::m_rtls
std::map< unsigned, bool > m_rtls
Definition IWAText.h:65
libetonyek::IWAText::m_sections
std::map< unsigned, IWORKStylePtr_t > m_sections
Definition IWAText.h:56
libetonyek::IWAText::setDropCaps
void setDropCaps(const std::map< unsigned, IWORKStylePtr_t > &dropCaps)
Definition IWAText.cpp:100
libetonyek::IWAText::setListLevels
void setListLevels(const std::map< unsigned, unsigned > &levels)
Definition IWAText.cpp:90
libetonyek::IWAText::m_attachments
std::multimap< unsigned, std::function< void(unsigned, bool &)> > m_attachments
Definition IWAText.h:67
libetonyek::IWAText::setParagraphs
void setParagraphs(const std::map< unsigned, IWORKStylePtr_t > &paras)
Definition IWAText.cpp:70
libetonyek::IWAText::m_paras
std::map< unsigned, IWORKStylePtr_t > m_paras
Definition IWAText.h:57
libetonyek::IWAText::m_langs
std::map< unsigned, std::string > m_langs
Definition IWAText.h:60
libetonyek::IWAText::m_pageMasters
std::map< unsigned, IWORKStylePtr_t > m_pageMasters
Definition IWAText.h:55
libetonyek::IWAText::setAttachments
void setAttachments(const std::multimap< unsigned, std::function< void(unsigned, bool &)> > &attachments)
Definition IWAText.cpp:110
libetonyek::IWAText::setRTLs
void setRTLs(const std::map< unsigned, bool > &rtls)
Definition IWAText.cpp:105
libetonyek::IWAText::m_links
std::map< unsigned, std::string > m_links
Definition IWAText.h:61
libetonyek::IWAText::setLists
void setLists(const std::map< unsigned, IWORKStylePtr_t > &lists)
Definition IWAText.cpp:95
libetonyek::IWAText::setLanguages
void setLanguages(const std::map< unsigned, std::string > &langs)
Definition IWAText.cpp:80
libetonyek::IWAText::m_spans
std::map< unsigned, IWORKStylePtr_t > m_spans
Definition IWAText.h:58
libetonyek::IWORKLanguageManager
Definition IWORKLanguageManager.h:24
libetonyek::IWORKOutputElements
Definition IWORKOutputElements.h:33
libetonyek::IWORKText
Definition IWORKText.h:34
libetonyek::IWORKToken::attachments
@ attachments
Definition IWORKToken.h:106
libetonyek::IWORKToken::text
@ text
Definition IWORKToken.h:472
libetonyek
Definition IWORKBezierElement.cpp:21
libetonyek::IWORKStylePtr_t
std::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition IWORKStyle_fwd.h:23