IWAText.h Source File documentation

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
23namespace libetonyek
24{
25
26class IWORKLanguageManager;
27class IWORKOutputElements;
28class IWORKText;
29
30 class IWAText
31{
32public:
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
45 void setAttachments(const std::multimap<unsigned, std::function<void(unsigned, bool &)> > &attachments);
46
47 void parse(IWORKText &collector, const std::function<void(unsigned, IWORKStylePtr_t)> &openPageSpan=nullptr);
48
49private:
50 const librevenge::RVNGString m_text;
51 IWORKLanguageManager &m_langManager;
52
53 std::map<unsigned, IWORKStylePtr_t> m_pageMasters;
54 std::map<unsigned, IWORKStylePtr_t> m_sections;
55 std::map<unsigned, IWORKStylePtr_t> m_paras;
56 std::map<unsigned, IWORKStylePtr_t> m_spans;
57
58 std::map<unsigned, std::string> m_langs;
59 std::map<unsigned, std::string> m_links;
60 std::map<unsigned, IWORKStylePtr_t> m_lists;
61 std::map<unsigned, unsigned> m_listLevels;
62
63 std::multimap<unsigned, std::function<void(unsigned, bool &)> > m_attachments;
64};
65
66}
67
68#endif
69
70/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKEnum.h
IWORKStyle_fwd.h
libetonyek::IWAText
Definition: IWAText.h:31
libetonyek::IWAText::m_lists
std::map< unsigned, IWORKStylePtr_t > m_lists
Definition: IWAText.h:60
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:83
libetonyek::IWAText::setSections
void setSections(const std::map< unsigned, IWORKStylePtr_t > &sections)
Definition: IWAText.cpp:63
libetonyek::IWAText::setPageMasters
void setPageMasters(const std::map< unsigned, IWORKStylePtr_t > &pageMasters)
Definition: IWAText.cpp:58
libetonyek::IWAText::m_langManager
IWORKLanguageManager & m_langManager
Definition: IWAText.h:51
libetonyek::IWAText::m_text
const librevenge::RVNGString m_text
Definition: IWAText.h:50
libetonyek::IWAText::setSpans
void setSpans(const std::map< unsigned, IWORKStylePtr_t > &spans)
Definition: IWAText.cpp:73
libetonyek::IWAText::m_listLevels
std::map< unsigned, unsigned > m_listLevels
Definition: IWAText.h:61
libetonyek::IWAText::parse
void parse(IWORKText &collector, const std::function< void(unsigned, IWORKStylePtr_t)> &openPageSpan=nullptr)
Definition: IWAText.cpp:103
libetonyek::IWAText::m_sections
std::map< unsigned, IWORKStylePtr_t > m_sections
Definition: IWAText.h:54
libetonyek::IWAText::setListLevels
void setListLevels(const std::map< unsigned, unsigned > &levels)
Definition: IWAText.cpp:88
libetonyek::IWAText::m_attachments
std::multimap< unsigned, std::function< void(unsigned, bool &)> > m_attachments
Definition: IWAText.h:63
libetonyek::IWAText::setParagraphs
void setParagraphs(const std::map< unsigned, IWORKStylePtr_t > &paras)
Definition: IWAText.cpp:68
libetonyek::IWAText::m_paras
std::map< unsigned, IWORKStylePtr_t > m_paras
Definition: IWAText.h:55
libetonyek::IWAText::m_langs
std::map< unsigned, std::string > m_langs
Definition: IWAText.h:58
libetonyek::IWAText::m_pageMasters
std::map< unsigned, IWORKStylePtr_t > m_pageMasters
Definition: IWAText.h:53
libetonyek::IWAText::setAttachments
void setAttachments(const std::multimap< unsigned, std::function< void(unsigned, bool &)> > &attachments)
Definition: IWAText.cpp:98
libetonyek::IWAText::m_links
std::map< unsigned, std::string > m_links
Definition: IWAText.h:59
libetonyek::IWAText::setLists
void setLists(const std::map< unsigned, IWORKStylePtr_t > &lists)
Definition: IWAText.cpp:93
libetonyek::IWAText::setLanguages
void setLanguages(const std::map< unsigned, std::string > &langs)
Definition: IWAText.cpp:78
libetonyek::IWAText::m_spans
std::map< unsigned, IWORKStylePtr_t > m_spans
Definition: IWAText.h:56
libetonyek::IWORKLanguageManager
Definition: IWORKLanguageManager.h:24
libetonyek::IWORKText
Definition: IWORKText.h:34
libetonyek::IWORKToken::string
@ string
Definition: IWORKToken.h:418
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:21