StarObjectMath.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 StarMath zone in a StarOffice document .sdf
36 *
37 */
38 #ifndef STAR_OBJECT_MATH
39 # define STAR_OBJECT_MATH
40
41 #include <vector>
42
43 #include "libstaroffice_internal.hxx"
44 #include "StarObject.hxx"
45
46 namespace StarObjectMathInternal
47 {
48 struct State;
49 }
50
51 class StarZone;
52
58 class StarObjectMath : public StarObject
59 {
60 public:
62 StarObjectMath(StarObject const &orig, bool duplicateState);
64 ~StarObjectMath() override;
66 bool parse();
68 bool send(STOFFListenerPtr listener, STOFFFrameStyle const &pos, STOFFGraphicStyle const &style=STOFFGraphicStyle());
69
70 protected:
71 //
72 // low level
73 //
74
76 bool readMathDocument(STOFFInputStreamPtr input, std::string const &fileName);
77
78 protected:
79 //
80 // data
81 //
82
84 std::shared_ptr<StarObjectMathInternal::State> m_mathState;
85 private:
86 StarObjectMath &operator=(StarObjectMath const &orig) = delete;
87 };
88 #endif
89 // 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
StarObjectMath::StarObjectMath
StarObjectMath(StarObject const &orig, bool duplicateState)
constructor
Definition: StarObjectMath.cxx:76
libstoff::getString
librevenge::RVNGString getString(std::vector< uint32_t > const &unicode)
transform a unicode string in a RNVGString
Definition: libstaroffice_internal.cxx:63
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
StarObjectMathInternal
Internal: the structures of a StarObjectMath.
Definition: StarObjectMath.cxx:56
StarObjectMathInternal::State::m_mml
librevenge::RVNGString m_mml
the mml data
Definition: StarObjectMath.cxx:68
StarObjectMath
the main class to read a small StarOffice math zone .sdf
Definition: StarObjectMath.hxx:58
StarObjectMathInternal::State::State
State()
constructor
Definition: StarObjectMath.cxx:62
STOFFStarMathToMMLConverter.hxx
STOFFFrameStyle
Class to store a frame style.
Definition: STOFFFrameStyle.hxx:45
StarObjectMathInternal::State
Internal: the state of a StarObjectMath.
Definition: StarObjectMath.cxx:60
StarZone::readString
bool readString(std::vector< uint32_t > &string, int encoding=-1) const
try to read an unicode string
Definition: StarZone.hxx:220
libstaroffice_internal.hxx
libstoff::DebugFile::reset
static void reset()
Definition: STOFFDebug.hxx:228
libstoff::DebugStream::str
static std::string str()
Definition: STOFFDebug.hxx:203
STOFFParagraph.hxx
StarObjectMath::send
bool send(STOFFListenerPtr listener, STOFFFrameStyle const &pos, STOFFGraphicStyle const &style=STOFFGraphicStyle())
try to send a object to the listener
Definition: StarObjectMath.cxx:86
STOFFListener.hxx
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
StarObject
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
StarObjectMath::operator=
StarObjectMath & operator=(StarObjectMath const &orig)=delete
libstoff::DebugStream
Definition: STOFFDebug.hxx:194
StarObjectMath::parse
bool parse()
try to parse the current object
Definition: StarObjectMath.cxx:99
StarObjectMath::m_mathState
std::shared_ptr< StarObjectMathInternal::State > m_mathState
the state
Definition: StarObjectMath.hxx:84
STOFFGraphicStyle
Class to store a graphic style.
Definition: STOFFGraphicStyle.hxx:44
StarObjectMath.hxx
StarObjectMath::~StarObjectMath
~StarObjectMath() override
destructor
Definition: StarObjectMath.cxx:82
StarObject::parse
bool parse()
try to parse data
Definition: StarObject.cxx:170
StarState.hxx
libstoff::DebugFile::addPos
static void addPos(long)
Definition: STOFFDebug.hxx:223
libstoff::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: STOFFDebug.hxx:225
StarObject.hxx
StarZone.hxx
libstoff::DebugFile
Definition: STOFFDebug.hxx:210
StarObject::getOLEDirectory
std::shared_ptr< STOFFOLEParser::OleDirectory > getOLEDirectory()
returns the object directory
Definition: StarObject.hxx:86
libstoff::DebugFile::addNote
static void addNote(char const *)
Definition: STOFFDebug.hxx:224
STOFFStarMathToMMLConverter::convertStarMath
static bool convertStarMath(librevenge::RVNGString const &starMath, librevenge::RVNGString &mml)
try to convert a StarMath formula to a MML formula
Definition: STOFFStarMathToMMLConverter.cxx:2110
StarObjectMath::readMathDocument
bool readMathDocument(STOFFInputStreamPtr input, std::string const &fileName)
try to read a math zone: StarMathDocument .sdm
Definition: StarObjectMath.cxx:137
libstoff::DebugFile::open
static bool open(std::string const &)
Definition: STOFFDebug.hxx:218
STOFFFont.hxx
StarItemPool.hxx
StarAttribute.hxx