KEYText.h Source File documentation

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

- File List
- File Members

KEYText.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 KEYTEXT_H_INCLUDED
11 #define KEYTEXT_H_INCLUDED
12
13 #include <deque>
14
15 #include "KEYObject.h"
16 #include "KEYStyles_fwd.h"
17 #include "KEYText_fwd.h"
18
19 namespace libetonyek
20 {
21
22 class KEYText
23 {
24 struct Paragraph;
25 typedef boost::shared_ptr<Paragraph> ParagraphPtr_t;
26
27 public:
28 typedef std::deque<ParagraphPtr_t> ParagraphList_t;
29
30 public:
31 explicit KEYText(bool object = true);
32
33 void setLayoutStyle(const KEYLayoutStylePtr_t &style);
34
35 const KEYGeometryPtr_t &getBoundingBox() const;
36 void setBoundingBox(const KEYGeometryPtr_t &boundingBox);
37
38 void openParagraph(const KEYParagraphStylePtr_t &style);
39 void closeParagraph();
40
41 void insertText(const std::string &text, const KEYCharacterStylePtr_t &style);
42 void insertTab();
43 void insertLineBreak();
44
45 const KEYLayoutStylePtr_t &getLayoutStyle() const;
46 const ParagraphList_t &getParagraphs() const;
47 bool isObject() const;
48
49 bool empty() const;
50
51 private:
52 void insertDeferredLineBreaks();
53
54 private:
55 KEYLayoutStylePtr_t m_layoutStyle;
56 ParagraphList_t m_paragraphs;
57 ParagraphPtr_t m_currentParagraph;
58 int m_lineBreaks;
59 const bool m_object;
60
61 KEYGeometryPtr_t m_boundingBox;
62 };
63
64 KEYObjectPtr_t makeObject(const KEYTextPtr_t &text);
65
66 }
67
68 #endif // KEYTEXT_H_INCLUDED
69
70 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEYText::m_layoutStyle
KEYLayoutStylePtr_t m_layoutStyle
Definition: KEYText.h:55
libetonyek
Definition: EtonyekDocument.cpp:40
libetonyek::KEYText
Definition: KEYText.h:22
libetonyek::KEYText::setLayoutStyle
void setLayoutStyle(const KEYLayoutStylePtr_t &style)
Definition: KEYText.cpp:319
libetonyek::KEYText::insertLineBreak
void insertLineBreak()
Definition: KEYText.cpp:366
KEYText_fwd.h
libetonyek::KEYParagraphStylePtr_t
boost::shared_ptr< KEYParagraphStyle > KEYParagraphStylePtr_t
Definition: KEYStyles_fwd.h:51
libetonyek::KEYText::m_object
const bool m_object
Definition: KEYText.h:59
libetonyek::KEY2Token::text
Definition: KEY2Token.h:854
libetonyek::KEYText::setBoundingBox
void setBoundingBox(const KEYGeometryPtr_t &boundingBox)
Definition: KEYText.cpp:329
libetonyek::KEYText::getParagraphs
const ParagraphList_t & getParagraphs() const
Definition: KEYText.cpp:378
libetonyek::KEYTextPtr_t
boost::shared_ptr< KEYText > KEYTextPtr_t
Definition: KEYText_fwd.h:16
libetonyek::KEYObjectPtr_t
boost::shared_ptr< KEYObject > KEYObjectPtr_t
Definition: KEYObject.h:44
libetonyek::KEY2Token::style
Definition: KEY2Token.h:796
libetonyek::KEYText::ParagraphPtr_t
boost::shared_ptr< Paragraph > ParagraphPtr_t
Definition: KEYText.h:24
libetonyek::KEYText::empty
bool empty() const
Definition: KEYText.cpp:400
libetonyek::KEYText::insertTab
void insertTab()
Definition: KEYText.cpp:358
libetonyek::KEYText::Paragraph
Definition: KEYText.cpp:29
KEYObject.h
libetonyek::KEYText::ParagraphList_t
std::deque< ParagraphPtr_t > ParagraphList_t
Definition: KEYText.h:28
libetonyek::KEYText::getBoundingBox
const KEYGeometryPtr_t & getBoundingBox() const
Definition: KEYText.cpp:324
libetonyek::KEYCharacterStylePtr_t
boost::shared_ptr< KEYCharacterStyle > KEYCharacterStylePtr_t
Definition: KEYStyles_fwd.h:26
libetonyek::KEYText::m_boundingBox
KEYGeometryPtr_t m_boundingBox
Definition: KEYText.h:61
libetonyek::makeObject
KEYObjectPtr_t makeObject(const KEYShapePtr_t &shape)
Object creator function for shape.
Definition: KEYShape.cpp:88
libetonyek::KEYText::openParagraph
void openParagraph(const KEYParagraphStylePtr_t &style)
Definition: KEYText.cpp:334
libetonyek::KEYText::m_paragraphs
ParagraphList_t m_paragraphs
Definition: KEYText.h:56
libetonyek::KEYText::isObject
bool isObject() const
Definition: KEYText.cpp:383
libetonyek::KEYLayoutStylePtr_t
boost::shared_ptr< KEYLayoutStyle > KEYLayoutStylePtr_t
Definition: KEYStyles_fwd.h:41
libetonyek::KEYText::closeParagraph
void closeParagraph()
Definition: KEYText.cpp:342
libetonyek::KEYText::getLayoutStyle
const KEYLayoutStylePtr_t & getLayoutStyle() const
Definition: KEYText.cpp:373
libetonyek::KEYGeometryPtr_t
boost::shared_ptr< KEYGeometry > KEYGeometryPtr_t
Definition: KEYTypes_fwd.h:25
libetonyek::KEYText::KEYText
KEYText(bool object=true)
Definition: KEYText.cpp:303
libetonyek::KEYText::m_currentParagraph
ParagraphPtr_t m_currentParagraph
Definition: KEYText.h:57
libetonyek::KEYText::insertDeferredLineBreaks
void insertDeferredLineBreaks()
Definition: KEYText.cpp:388
KEYStyles_fwd.h
libetonyek::KEY1Token::string
Definition: KEY1Token.h:75
libetonyek::KEYText::m_lineBreaks
int m_lineBreaks
Definition: KEYText.h:58
libetonyek::KEYText::insertText
void insertText(const std::string &text, const KEYCharacterStylePtr_t &style)
Definition: KEYText.cpp:350