FullWrtStruct.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* basic structure used to code zone when converting FullWrite document
*
*/
#ifndef FULL_WRT_STRUCT
# define FULL_WRT_STRUCT
#include <librevenge/librevenge.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
namespace FullWrtStruct
{
// basic
struct Entry;
bool getColor(int color, MWAWColor &col);
std::string getTypeName(int type);
struct Border {
Border()
: m_frameBorder()
, m_frontColor(MWAWColor::black())
, m_backColor(MWAWColor::white())
, m_shadowColor(MWAWColor::black())
, m_shadowDepl(0,0)
, m_flags(0)
, m_extra("")
{
m_frameBorder.m_style=MWAWBorder::None;
for (auto &type : m_type) type=0;
}
static MWAWBorder getBorder(int type);
void addTo(MWAWGraphicStyle &style) const;
bool hasShadow() const
{
return m_shadowDepl[0]||m_shadowDepl[1];
}
bool read(std::shared_ptr<FullWrtStruct::Entry> zone, int fSz);
std::vector<MWAWVariable<MWAWBorder> > getParagraphBorders() const;
friend std::ostream &operator<<(std::ostream &o, Border const &p);
int m_type[3];
MWAWBorder m_frameBorder;
MWAWColor m_frontColor;
MWAWColor m_backColor;
MWAWColor m_shadowColor;
MWAWVec2i m_shadowDepl;
MWAWColor m_color[2];
int m_flags;
std::string m_extra;
};
struct Entry final : public MWAWEntry {
explicit Entry(MWAWInputStreamPtr const &input);
~Entry() final;
friend std::ostream &operator<<(std::ostream &o, Entry const &entry);
bool valid() const;
void update();
void closeDebugFile();
libmwaw::DebugFile &getAsciiFile();
bool operator==(const Entry &a) const;
bool operator!=(const Entry &a) const
{
return !operator==(a);
}
MWAWInputStreamPtr m_input;
int m_nextId;
int m_fileType;
int m_typeId;
int m_values[3];
librevenge::RVNGBinaryData m_data;
std::shared_ptr<libmwaw::DebugFile> m_asciiFile;
private:
Entry(Entry const &) = delete;
Entry &operator=(Entry const &) = delete;
};
typedef std::shared_ptr<Entry> EntryPtr;
struct ZoneHeader {
ZoneHeader()
: m_type(-1)
, m_docId(-1)
, m_fileId(-1)
, m_wrapping(-1)
, m_extra("") {}
ZoneHeader(ZoneHeader const &)=default;
virtual ~ZoneHeader();
bool read(std::shared_ptr<FullWrtStruct::Entry> zone);
friend std::ostream &operator<<(std::ostream &o, ZoneHeader const &dt);
int m_type;
int m_docId;
int m_fileId;
int m_wrapping;
std::string m_extra;
};
}
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWEntry.hxx
MWAWEntry::MWAWEntry
MWAWEntry()
constructor
Definition MWAWEntry.hxx:50
MWAWGraphicStyle
a structure used to define a picture style
Definition MWAWGraphicStyle.hxx:48
libmwaw::DebugFile
Definition MWAWDebug.hxx:66
libmwaw_internal.hxx
MWAWVec2i
MWAWVec2< int > MWAWVec2i
MWAWVec2 of int.
Definition libmwaw_internal.hxx:838
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
FullWrtStruct
a namespace use to define common structure in a FullWrite file
Definition FullWrtStruct.cxx:44
FullWrtStruct::getColor
bool getColor(int color, MWAWColor &col)
try to convert a file data to a color
Definition FullWrtStruct.cxx:45
FullWrtStruct::EntryPtr
std::shared_ptr< Entry > EntryPtr
Definition FullWrtStruct.hxx:153
FullWrtStruct::getTypeName
std::string getTypeName(int type)
returns the type name
Definition FullWrtStruct.cxx:66
FullWrtStruct::Border
Internal: class to store a border which appear in docInfo.
Definition FullWrtStruct.hxx:60
FullWrtStruct::Border::m_frontColor
MWAWColor m_frontColor
the front color (used for layout )
Definition FullWrtStruct.hxx:95
FullWrtStruct::Border::m_backColor
MWAWColor m_backColor
the back color (used for layout )
Definition FullWrtStruct.hxx:97
FullWrtStruct::Border::addTo
void addTo(MWAWGraphicStyle &style) const
add to frame properties
Definition FullWrtStruct.cxx:127
FullWrtStruct::Border::operator<<
friend std::ostream & operator<<(std::ostream &o, Border const &p)
operator<<
Definition FullWrtStruct.cxx:243
FullWrtStruct::Border::getBorder
static MWAWBorder getBorder(int type)
return a border corresponding to a type
Definition FullWrtStruct.cxx:118
FullWrtStruct::Border::m_color
MWAWColor m_color[2]
the colors line + ?
Definition FullWrtStruct.hxx:103
FullWrtStruct::Border::m_extra
std::string m_extra
some extra data
Definition FullWrtStruct.hxx:107
FullWrtStruct::Border::m_frameBorder
MWAWBorder m_frameBorder
the frame border
Definition FullWrtStruct.hxx:93
FullWrtStruct::Border::m_type
int m_type[3]
the type (border, horizontal and vertical separators)
Definition FullWrtStruct.hxx:91
FullWrtStruct::Border::m_shadowDepl
MWAWVec2i m_shadowDepl
the shadow depl ( if shadow)
Definition FullWrtStruct.hxx:101
FullWrtStruct::Border::m_shadowColor
MWAWColor m_shadowColor
the shadow color
Definition FullWrtStruct.hxx:99
FullWrtStruct::Border::getParagraphBorders
std::vector< MWAWVariable< MWAWBorder > > getParagraphBorders() const
returns the list of border order MWAWBorder::Pos
Definition FullWrtStruct.cxx:224
FullWrtStruct::Border::Border
Border()
constructor
Definition FullWrtStruct.hxx:62
FullWrtStruct::Border::hasShadow
bool hasShadow() const
return true if we have a shadow
Definition FullWrtStruct.hxx:79
FullWrtStruct::Border::read
bool read(std::shared_ptr< FullWrtStruct::Entry > zone, int fSz)
try to read a border definiton
Definition FullWrtStruct.cxx:142
FullWrtStruct::Border::m_flags
int m_flags
the flags
Definition FullWrtStruct.hxx:105
FullWrtStruct::Entry
the definition of a zone in a FullWrite file
Definition FullWrtStruct.hxx:111
FullWrtStruct::Entry::operator=
Entry & operator=(Entry const &)=delete
FullWrtStruct::Entry::m_asciiFile
std::shared_ptr< libmwaw::DebugFile > m_asciiFile
the debug file
Definition FullWrtStruct.hxx:148
FullWrtStruct::Entry::operator<<
friend std::ostream & operator<<(std::ostream &o, Entry const &entry)
operator<<
Definition FullWrtStruct.cxx:318
FullWrtStruct::Entry::~Entry
~Entry() final
Definition FullWrtStruct.cxx:313
FullWrtStruct::Entry::m_nextId
int m_nextId
the next entry id
Definition FullWrtStruct.hxx:138
FullWrtStruct::Entry::operator==
bool operator==(const Entry &a) const
basic operator==
Definition FullWrtStruct.cxx:399
FullWrtStruct::Entry::getAsciiFile
libmwaw::DebugFile & getAsciiFile()
returns a reference to the ascii file
Definition FullWrtStruct.cxx:394
FullWrtStruct::Entry::Entry
Entry(Entry const &)=delete
FullWrtStruct::Entry::valid
bool valid() const
returns true if the entry and the input is valid
Definition FullWrtStruct.cxx:363
FullWrtStruct::Entry::m_values
int m_values[3]
some unknown values
Definition FullWrtStruct.hxx:144
FullWrtStruct::Entry::m_input
MWAWInputStreamPtr m_input
the input
Definition FullWrtStruct.hxx:136
FullWrtStruct::Entry::closeDebugFile
void closeDebugFile()
write the debug file, ...
Definition FullWrtStruct.cxx:388
FullWrtStruct::Entry::update
void update()
create a inputstream, ... if needed
Definition FullWrtStruct.cxx:368
FullWrtStruct::Entry::m_data
librevenge::RVNGBinaryData m_data
the main data ( if the entry comes from several zone )
Definition FullWrtStruct.hxx:146
FullWrtStruct::Entry::m_fileType
int m_fileType
the zone type id find in DStruct
Definition FullWrtStruct.hxx:140
FullWrtStruct::Entry::operator!=
bool operator!=(const Entry &a) const
basic operator!=
Definition FullWrtStruct.hxx:130
FullWrtStruct::Entry::Entry
Entry(MWAWInputStreamPtr const &input)
Definition FullWrtStruct.cxx:302
FullWrtStruct::Entry::m_typeId
int m_typeId
the type id (find in FZoneFlags)
Definition FullWrtStruct.hxx:142
FullWrtStruct::ZoneHeader::m_docId
int m_docId
the doc id
Definition FullWrtStruct.hxx:174
FullWrtStruct::ZoneHeader::operator<<
friend std::ostream & operator<<(std::ostream &o, ZoneHeader const &dt)
the operator<<
Definition FullWrtStruct.cxx:523
FullWrtStruct::ZoneHeader::m_type
int m_type
the zone type
Definition FullWrtStruct.hxx:172
FullWrtStruct::ZoneHeader::m_fileId
int m_fileId
the file id
Definition FullWrtStruct.hxx:176
FullWrtStruct::ZoneHeader::read
bool read(std::shared_ptr< FullWrtStruct::Entry > zone)
try to read the data header of a classical zone
Definition FullWrtStruct.cxx:419
FullWrtStruct::ZoneHeader::m_wrapping
int m_wrapping
the wrapping type
Definition FullWrtStruct.hxx:178
FullWrtStruct::ZoneHeader::~ZoneHeader
virtual ~ZoneHeader()
destructor
Definition FullWrtStruct.cxx:415
FullWrtStruct::ZoneHeader::ZoneHeader
ZoneHeader()
constructor
Definition FullWrtStruct.hxx:158
FullWrtStruct::ZoneHeader::m_extra
std::string m_extra
some extra data
Definition FullWrtStruct.hxx:180
FullWrtStruct::ZoneHeader::ZoneHeader
ZoneHeader(ZoneHeader const &)=default
MWAWBorder
a border
Definition libmwaw_internal.hxx:333
MWAWBorder::None
@ None
Definition libmwaw_internal.hxx:335
MWAWColor
the class to store a color
Definition libmwaw_internal.hxx:192