| 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
| 2 | /* librevenge |
| 3 | * Version: MPL 2.0 / LGPLv2.1+ |
| 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 | * Alternatively, the contents of this file may be used under the terms |
| 10 | * of the GNU Lesser General Public License Version 2.1 or later |
| 11 | * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are |
| 12 | * applicable instead of those above. |
| 13 | */ |
| 14 | |
| 15 | #include <librevenge-generators/librevenge-generators.h> |
| 16 | |
| 17 | #include <sstream> |
| 18 | |
| 19 | namespace librevenge |
| 20 | { |
| 21 | |
| 22 | struct RVNGTextDrawingGeneratorImpl |
| 23 | { |
| 24 | RVNGTextDrawingGeneratorImpl(RVNGStringVector &pages); |
| 25 | |
| 26 | RVNGStringVector &m_pages; |
| 27 | std::ostringstream m_stream; |
| 28 | }; |
| 29 | |
| 30 | RVNGTextDrawingGeneratorImpl::RVNGTextDrawingGeneratorImpl(RVNGStringVector &pages) |
| 31 | : m_pages(pages) |
| 32 | , m_stream() |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | RVNGTextDrawingGenerator::RVNGTextDrawingGenerator(RVNGStringVector &pages) |
| 37 | : m_impl(new RVNGTextDrawingGeneratorImpl(pages)) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | RVNGTextDrawingGenerator::~RVNGTextDrawingGenerator() |
| 42 | { |
| 43 | delete m_impl; |
| 44 | } |
| 45 | |
| 46 | void RVNGTextDrawingGenerator::startDocument(const RVNGPropertyList & /*propList*/) {} |
| 47 | void RVNGTextDrawingGenerator::endDocument() {} |
| 48 | void RVNGTextDrawingGenerator::setDocumentMetaData(const RVNGPropertyList & /*propList*/) {} |
| 49 | void RVNGTextDrawingGenerator::defineEmbeddedFont(const RVNGPropertyList & /*propList*/) {} |
| 50 | void RVNGTextDrawingGenerator::startPage(const RVNGPropertyList &) {} |
| 51 | |
| 52 | void RVNGTextDrawingGenerator::endPage() |
| 53 | { |
| 54 | m_impl->m_pages.append(m_impl->m_stream.str().c_str()); |
| 55 | m_impl->m_stream.str(""); |
| 56 | } |
| 57 | |
| 58 | void RVNGTextDrawingGenerator::startMasterPage(const RVNGPropertyList &) {} |
| 59 | |
| 60 | void RVNGTextDrawingGenerator::endMasterPage() |
| 61 | { |
| 62 | // we don't do anything with master pages yet, so just reset the content |
| 63 | m_impl->m_stream.str(""); |
| 64 | } |
| 65 | |
| 66 | void RVNGTextDrawingGenerator::startLayer(const RVNGPropertyList &) {} |
| 67 | void RVNGTextDrawingGenerator::endLayer() {} |
| 68 | void RVNGTextDrawingGenerator::startEmbeddedGraphics(const RVNGPropertyList &) {} |
| 69 | void RVNGTextDrawingGenerator::endEmbeddedGraphics() {} |
| 70 | |
| 71 | void RVNGTextDrawingGenerator::openGroup(const RVNGPropertyList & /*propList*/) {} |
| 72 | void RVNGTextDrawingGenerator::closeGroup() {} |
| 73 | |
| 74 | void RVNGTextDrawingGenerator::setStyle(const RVNGPropertyList &) {} |
| 75 | |
| 76 | void RVNGTextDrawingGenerator::drawRectangle(const RVNGPropertyList &) {} |
| 77 | void RVNGTextDrawingGenerator::drawEllipse(const RVNGPropertyList &) {} |
| 78 | void RVNGTextDrawingGenerator::drawPolyline(const RVNGPropertyList &) {} |
| 79 | void RVNGTextDrawingGenerator::drawPolygon(const RVNGPropertyList &) {} |
| 80 | void RVNGTextDrawingGenerator::drawPath(const RVNGPropertyList &) {} |
| 81 | void RVNGTextDrawingGenerator::drawGraphicObject(const RVNGPropertyList &) {} |
| 82 | void RVNGTextDrawingGenerator::drawConnector(const RVNGPropertyList &) {} |
| 83 | void RVNGTextDrawingGenerator::startTextObject(const RVNGPropertyList &) {} |
| 84 | void RVNGTextDrawingGenerator::endTextObject() {} |
| 85 | |
| 86 | void RVNGTextDrawingGenerator::openOrderedListLevel(const RVNGPropertyList & /*propList*/) {} |
| 87 | void RVNGTextDrawingGenerator::closeOrderedListLevel() {} |
| 88 | |
| 89 | void RVNGTextDrawingGenerator::openUnorderedListLevel(const RVNGPropertyList & /*propList*/) {} |
| 90 | void RVNGTextDrawingGenerator::closeUnorderedListLevel() {} |
| 91 | |
| 92 | void RVNGTextDrawingGenerator::openListElement(const RVNGPropertyList & /*propList*/) {} |
| 93 | void RVNGTextDrawingGenerator::closeListElement() {} |
| 94 | |
| 95 | void RVNGTextDrawingGenerator::defineParagraphStyle(const RVNGPropertyList & /*propList*/) {} |
| 96 | void RVNGTextDrawingGenerator::openParagraph(const RVNGPropertyList & /*propList*/) {} |
| 97 | |
| 98 | void RVNGTextDrawingGenerator::closeParagraph() |
| 99 | { |
| 100 | m_impl->m_stream << "\n"; |
| 101 | } |
| 102 | |
| 103 | void RVNGTextDrawingGenerator::defineCharacterStyle(const RVNGPropertyList & /* propList */) {} |
| 104 | void RVNGTextDrawingGenerator::openSpan(const RVNGPropertyList & /* propList */) {} |
| 105 | void RVNGTextDrawingGenerator::closeSpan() {} |
| 106 | |
| 107 | void RVNGTextDrawingGenerator::openLink(const RVNGPropertyList & /* propList */) {} |
| 108 | void RVNGTextDrawingGenerator::closeLink() {} |
| 109 | |
| 110 | void RVNGTextDrawingGenerator::insertTab() {} |
| 111 | void RVNGTextDrawingGenerator::insertSpace() {} |
| 112 | |
| 113 | void RVNGTextDrawingGenerator::insertText(const RVNGString &str) |
| 114 | { |
| 115 | m_impl->m_stream << str.cstr(); |
| 116 | } |
| 117 | |
| 118 | void RVNGTextDrawingGenerator::insertLineBreak() {} |
| 119 | void RVNGTextDrawingGenerator::insertField(const RVNGPropertyList & /*propList*/) {} |
| 120 | |
| 121 | void RVNGTextDrawingGenerator::startTableObject(const RVNGPropertyList &) {} |
| 122 | void RVNGTextDrawingGenerator::openTableRow(const RVNGPropertyList &) {} |
| 123 | void RVNGTextDrawingGenerator::closeTableRow() {} |
| 124 | void RVNGTextDrawingGenerator::openTableCell(const RVNGPropertyList &) {} |
| 125 | void RVNGTextDrawingGenerator::closeTableCell() {} |
| 126 | void RVNGTextDrawingGenerator::insertCoveredTableCell(const RVNGPropertyList &) {} |
| 127 | void RVNGTextDrawingGenerator::endTableObject() {} |
| 128 | } |
| 129 | |
| 130 | /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */ |