StarObjectSmallText.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libstaroffice
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 /*
35 * Parser to convert a small text zone/OLE in a StarOffice document
36 *
37 */
38 #ifndef STAR_OBJECT_SMALL_TEXT
39 # define STAR_OBJECT_SMALL_TEXT
40
41 #include <vector>
42
43 #include "libstaroffice_internal.hxx"
44 #include "StarObject.hxx"
45
46 namespace StarObjectSmallTextInternal
47 {
48 struct State;
49 }
50
51 class StarZone;
52
58 class StarObjectSmallText : public StarObject
59 {
60 public:
62 StarObjectSmallText(StarObject const &orig, bool duplicateState);
64 ~StarObjectSmallText() override;
65
67 bool read(StarZone &zone, long lastPos);
68
70 bool send(std::shared_ptr<STOFFListener> listener, int level=-1);
71 protected:
72 //
73 // low level
74 //
75
76 protected:
77 //
78 // data
79 //
80
82 std::shared_ptr<StarObjectSmallTextInternal::State> m_textState;
83 private:
84 StarObjectSmallText &operator=(StarObjectSmallText const &orig) = delete;
85 };
86 #endif
87 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFListenerPtr
std::shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition: libstaroffice_internal.hxx:491
STOFFParagraph
class to store the paragraph properties
Definition: STOFFParagraph.hxx:47
libstoff::getString
librevenge::RVNGString getString(std::vector< uint32_t > const &unicode)
transform a unicode string in a RNVGString
Definition: libstaroffice_internal.cxx:63
StarObjectSmallTextInternal::Paragraph::send
bool send(STOFFListenerPtr &listener, StarState &mainState, StarState &editState, int level=-1) const
try to send the data to a listener
Definition: StarObjectSmallText.cxx:91
StarState::m_break
int m_break
a page/column break: 1=columnBefore, 2=columnAfter, 3=columnBoth, 4=pageBefore, 5=pageAfter,...
Definition: StarState.hxx:170
StarZone::ascii
libstoff::DebugFile & ascii()
returns the ascii file
Definition: StarZone.hxx:254
STOFF_DEBUG_MSG
#define STOFF_DEBUG_MSG(M)
Definition: libstaroffice_internal.hxx:129
StarItemStyle::F_Paragraph
@ F_Paragraph
Definition: StarItem.hxx:120
StarItemSet::printChild
std::string printChild() const
debug function to print the child field
Definition: StarItem.cxx:52
StarState::m_content
bool m_content
flag to know if this is a content zone
Definition: StarState.hxx:184
StarObjectSmallText.hxx
StarState::m_field
std::shared_ptr< SWFieldManagerInternal::Field > m_field
the field
Definition: StarState.hxx:196
StarObject::getNewItemPool
std::shared_ptr< StarItemPool > getNewItemPool(StarItemPool::Type type)
returns a new item pool for this document
Definition: StarObject.cxx:142
StarZone::readString
bool readString(std::vector< uint32_t > &string, int encoding=-1) const
try to read an unicode string
Definition: StarZone.hxx:220
STOFFFont::addTo
void addTo(librevenge::RVNGPropertyList &propList) const
add to the propList
Definition: STOFFFont.cxx:81
STOFFParagraph::m_listLevelIndex
int m_listLevelIndex
the actual level index
Definition: STOFFParagraph.hxx:79
StarObjectSmallText::StarObjectSmallText
StarObjectSmallText(StarObject const &orig, bool duplicateState)
constructor
Definition: StarObjectSmallText.cxx:219
StarObjectSmallTextInternal::State::m_paragraphList
std::vector< Paragraph > m_paragraphList
the paragraphs
Definition: StarObjectSmallText.cxx:211
StarObjectSmallTextInternal::State
Internal: the state of a StarObjectSmallText.
Definition: StarObjectSmallText.cxx:203
StarObjectSmallText::m_textState
std::shared_ptr< StarObjectSmallTextInternal::State > m_textState
the state
Definition: StarObjectSmallText.hxx:82
StarState
class to store an state: ie.
Definition: StarState.hxx:67
libstaroffice_internal.hxx
libstoff::DebugStream::str
static std::string str()
Definition: STOFFDebug.hxx:203
StarObjectSmallTextInternal::Paragraph::m_textSourcePosition
std::vector< size_t > m_textSourcePosition
the text initial position
Definition: StarObjectSmallText.cxx:78
STOFFParagraph.hxx
STOFFFont::m_lineBreak
bool m_lineBreak
line break
Definition: STOFFFont.hxx:100
StarObjectSmallTextInternal::Paragraph::m_charItemList
std::vector< std::shared_ptr< StarItem > > m_charItemList
the character item list
Definition: StarObjectSmallText.cxx:86
StarObject::readItemSet
bool readItemSet(StarZone &zone, std::vector< STOFFVec2i > const &limits, long endPos, StarItemSet &itemSet, StarItemPool *pool=nullptr, bool isDirect=false)
try to read a list of item
Definition: StarObject.cxx:229
STOFFListener.hxx
StarState::m_footnote
bool m_footnote
flag to know if this is a footnote
Definition: StarState.hxx:188
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:489
StarZone
a zone in a StarOffice file
Definition: StarZone.hxx:56
StarItemPool::T_EditEnginePool
@ T_EditEnginePool
Definition: StarItemPool.hxx:75
StarObject
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
StarObjectSmallText::operator=
StarObjectSmallText & operator=(StarObjectSmallText const &orig)=delete
StarObjectSmallText::read
bool read(StarZone &zone, long lastPos)
try to read a small text object
Definition: StarObjectSmallText.cxx:252
StarObjectSmallTextInternal
Internal: the structures of a StarObjectSmallText.
Definition: StarObjectSmallText.cxx:57
StarState::m_font
STOFFFont m_font
the font
Definition: StarState.hxx:182
libstoff::DebugStream
Definition: STOFFDebug.hxx:194
StarObjectSmallText
the main class to read a small StarOffice text zone
Definition: StarObjectSmallText.hxx:58
StarObject::findItemPool
std::shared_ptr< StarItemPool > findItemPool(StarItemPool::Type type, bool isInside)
check if a pool corresponding to a given type is opened if so returned it.
Definition: StarObject.cxx:159
STOFFFont
Class to store font.
Definition: STOFFFont.hxx:43
StarState::m_flyCnt
bool m_flyCnt
flag to know if this is a flyCnt
Definition: StarState.hxx:186
StarObjectSmallTextInternal::Paragraph::m_text
std::vector< uint32_t > m_text
the text
Definition: StarObjectSmallText.cxx:76
StarState::reinitializeLineData
void reinitializeLineData()
reinit the local data: break, font, content, footnote, ...
Definition: StarState.cxx:92
StarObjectSmallTextInternal::Paragraph::Paragraph
Paragraph()
constructor
Definition: StarObjectSmallText.cxx:63
StarObjectSmallText::send
bool send(std::shared_ptr< STOFFListener > listener, int level=-1)
try to send a small text zone
Definition: StarObjectSmallText.cxx:229
StarState.hxx
libstoff::DebugFile::addPos
static void addPos(long)
Definition: STOFFDebug.hxx:223
StarObject.hxx
StarZone.hxx
StarObjectSmallTextInternal::Paragraph::m_charLimitList
std::vector< STOFFVec2i > m_charLimitList
the character limit
Definition: StarObjectSmallText.cxx:88
StarState::m_paragraph
STOFFParagraph m_paragraph
the paragraph style
Definition: StarState.hxx:180
StarObjectSmallTextInternal::Paragraph
Internal: a paragraph of StarObjectSmallText.
Definition: StarObjectSmallText.cxx:61
StarState::m_global
std::shared_ptr< GlobalState > m_global
global state
Definition: StarState.hxx:165
libstoff::DebugFile
Definition: STOFFDebug.hxx:210
StarObjectSmallText::~StarObjectSmallText
~StarObjectSmallText() override
destructor
Definition: StarObjectSmallText.cxx:225
StarItemSet::m_whichToItemMap
std::map< int, std::shared_ptr< StarItem > > m_whichToItemMap
the list of item
Definition: StarItem.hxx:111
StarItemSet
class to store a list of item
Definition: StarItem.hxx:87
libstoff::DebugFile::addNote
static void addNote(char const *)
Definition: STOFFDebug.hxx:224
STOFFFont::m_tab
bool m_tab
tab
Definition: STOFFFont.hxx:98
StarState::m_refMark
librevenge::RVNGString m_refMark
the ref mark
Definition: StarState.hxx:194
StarZone::input
STOFFInputStreamPtr input()
return the zone input
Definition: StarZone.hxx:247
StarObjectSmallTextInternal::Paragraph::m_itemSet
StarItemSet m_itemSet
the main item list
Definition: StarObjectSmallText.cxx:84
STOFFVec2i
STOFFVec2< int > STOFFVec2i
STOFFVec2 of int.
Definition: libstaroffice_internal.hxx:767
STOFFFont.hxx
StarState::m_link
librevenge::RVNGString m_link
the link url
Definition: StarState.hxx:192
StarItemPool.hxx
StarItemPool::T_XOutdevPool
@ T_XOutdevPool
Definition: StarItemPool.hxx:75
StarAttribute.hxx
StarObjectSmallTextInternal::Paragraph::m_family
int m_family
the family
Definition: StarObjectSmallText.cxx:82
StarObjectSmallTextInternal::Paragraph::m_styleName
librevenge::RVNGString m_styleName
the style name
Definition: StarObjectSmallText.cxx:80
StarObjectSmallTextInternal::State::State
State()
constructor
Definition: StarObjectSmallText.cxx:205
SWFieldManager.hxx