- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

IWORKText.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 IWORKTEXT_H_INCLUDED
11 #define IWORKTEXT_H_INCLUDED
12
13 #include "IWORKText_fwd.h"
14
15 #include <deque>
16
17 #include <glm/glm.hpp>
18
19 #include "IWORKStyle_fwd.h"
20 #include "IWORKStyleStack.h"
21 #include "IWORKOutputElements.h"
22
23 namespace libetonyek
24 {
25
26 class IWORKText
27 {
28
29 public:
30 explicit IWORKText(bool discardEmptyContent);
31
32 void pushLayoutStyle(const IWORKStylePtr_t &style);
33 void pushParagraphStyle(const IWORKStylePtr_t &style);
34
35 void openLayout(const IWORKStylePtr_t &style = IWORKStylePtr_t());
36 void closeLayout();
37
38 void openParagraph(const IWORKStylePtr_t &style = IWORKStylePtr_t());
39 void closeParagraph();
40
41 void openSpan(const IWORKStylePtr_t &style = IWORKStylePtr_t());
42 void closeSpan();
43
44 void openLink(const std::string &url);
45 void closeLink();
46
47 void insertText(const std::string &text);
48 void insertTab();
49 void insertLineBreak();
50
51 void insertInlineContent(const IWORKOutputElements &elements);
52 void insertBlockContent(const IWORKOutputElements &elements);
53
54 bool empty() const;
55
56 void draw(IWORKOutputElements &elements);
57
58 private:
59 void doOpenPara();
60 void doClosePara();
61
62 void doOpenSpan();
63 void doCloseSpan();
64
65 void flushSpan();
66
67 private:
68 IWORKStyleStack m_layoutStyleStack;
69 IWORKStyleStack m_paraStyleStack;
70
71 IWORKOutputElements m_elements;
72
73 bool m_sectionOpened;
74
75 IWORKStylePtr_t m_currentParaStyle;
76 bool m_paraOpened;
77 bool m_ignoreEmptyPara;
78
79 IWORKStylePtr_t m_currentSpanStyle;
80 bool m_spanOpened;
81 bool m_pendingSpanClose;
82 bool m_inSpan;
83 };
84
85 }
86
87 #endif // IWORKTEXT_H_INCLUDED
88
89 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
IWORKStyle_fwd.h
libetonyek::IWORKText::closeLink
void closeLink()
Definition: IWORKText.cpp:371
libetonyek
Definition: IWORKBezierElement.cpp:18
libetonyek::IWORKText::m_pendingSpanClose
bool m_pendingSpanClose
Definition: IWORKText.h:81
libetonyek::IWORKText::m_paraOpened
bool m_paraOpened
Definition: IWORKText.h:76
libetonyek::IWORKOutputElements
Definition: IWORKOutputElements.h:30
libetonyek::IWORKText::closeParagraph
void closeParagraph()
Definition: IWORKText.cpp:336
IWORKOutputElements.h
libetonyek::IWORKText::m_paraStyleStack
IWORKStyleStack m_paraStyleStack
Definition: IWORKText.h:69
libetonyek::IWORKText::closeSpan
void closeSpan()
Definition: IWORKText.cpp:352
libetonyek::IWORKText::IWORKText
IWORKText(bool discardEmptyContent)
Definition: IWORKText.cpp:274
libetonyek::IWORKText::doCloseSpan
void doCloseSpan()
Definition: IWORKText.cpp:459
libetonyek::IWORKText::doOpenSpan
void doOpenSpan()
Definition: IWORKText.cpp:443
libetonyek::IWORKStylePtr_t
boost::shared_ptr< IWORKStyle > IWORKStylePtr_t
Definition: IWORKStyle_fwd.h:21
libetonyek::IWORKText
Definition: IWORKText.h:26
libetonyek::IWORKStyleStack
Representation of a dynamic inheritance of styles.
Definition: IWORKStyleStack.h:34
libetonyek::IWORKText::openParagraph
void openParagraph(const IWORKStylePtr_t &style=IWORKStylePtr_t())
Definition: IWORKText.cpp:327
libetonyek::IWORKToken::text
Definition: IWORKToken.h:257
libetonyek::IWORKText::m_layoutStyleStack
IWORKStyleStack m_layoutStyleStack
Definition: IWORKText.h:68
libetonyek::IWORKText::m_ignoreEmptyPara
bool m_ignoreEmptyPara
Definition: IWORKText.h:77
libetonyek::IWORKText::empty
bool empty() const
Definition: IWORKText.cpp:415
libetonyek::IWORKToken::style
Definition: IWORKToken.h:241
libetonyek::IWORKText::pushLayoutStyle
void pushLayoutStyle(const IWORKStylePtr_t &style)
Definition: IWORKText.cpp:292
libetonyek::IWORKText::closeLayout
void closeLayout()
Definition: IWORKText.cpp:318
libetonyek::IWORKText::insertText
void insertText(const std::string &text)
Definition: IWORKText.cpp:379
libetonyek::IWORKText::insertTab
void insertTab()
Definition: IWORKText.cpp:386
libetonyek::IWORKText::flushSpan
void flushSpan()
Definition: IWORKText.cpp:472
libetonyek::IWORKText::m_spanOpened
bool m_spanOpened
Definition: IWORKText.h:80
libetonyek::IWORKText::doClosePara
void doClosePara()
Definition: IWORKText.cpp:431
libetonyek::IWORKText::insertInlineContent
void insertInlineContent(const IWORKOutputElements &elements)
Definition: IWORKText.cpp:400
libetonyek::IWORKText::openLink
void openLink(const std::string &url)
Definition: IWORKText.cpp:358
libetonyek::IWORKText::m_currentSpanStyle
IWORKStylePtr_t m_currentSpanStyle
Definition: IWORKText.h:79
libetonyek::IWORKText::insertBlockContent
void insertBlockContent(const IWORKOutputElements &elements)
Definition: IWORKText.cpp:407
libetonyek::IWORKText::m_currentParaStyle
IWORKStylePtr_t m_currentParaStyle
Definition: IWORKText.h:75
libetonyek::IWORKText::openSpan
void openSpan(const IWORKStylePtr_t &style=IWORKStylePtr_t())
Definition: IWORKText.cpp:345
IWORKStyleStack.h
libetonyek::IWORKText::insertLineBreak
void insertLineBreak()
Definition: IWORKText.cpp:393
libetonyek::IWORKText::m_inSpan
bool m_inSpan
Definition: IWORKText.h:82
libetonyek::IWORKToken::string
Definition: IWORKToken.h:239
libetonyek::IWORKText::pushParagraphStyle
void pushParagraphStyle(const IWORKStylePtr_t &style)
Definition: IWORKText.cpp:297
libetonyek::IWORKText::m_sectionOpened
bool m_sectionOpened
Definition: IWORKText.h:73
libetonyek::IWORKText::m_elements
IWORKOutputElements m_elements
Definition: IWORKText.h:71
libetonyek::IWORKText::doOpenPara
void doOpenPara()
Definition: IWORKText.cpp:420
libetonyek::IWORKText::draw
void draw(IWORKOutputElements &elements)
Definition: IWORKText.cpp:269
libetonyek::IWORKText::openLayout
void openLayout(const IWORKStylePtr_t &style=IWORKStylePtr_t())
Definition: IWORKText.cpp:302
IWORKText_fwd.h