FWStruct.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 FP_MWAW_STRUCT
# define FP_MWAW_STRUCT
#include <libwpd/libwpd.h>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWEntry.hxx"
namespace FWStruct
{
// basic
struct Entry;
bool getColor(int color, MWAWColor &col);
std::string getTypeName(int type);
struct Border {
Border() :m_frontColor(MWAWColor::black()), m_backColor(MWAWColor::white()),
m_width(0), m_isDouble(0), m_flags(0), m_extra("") {
for (int w=0; w < 3; w++) m_type[w]=0;
}
static MWAWBorder getBorder(int type);
bool read(shared_ptr<FWStruct::Entry> zone, int fSz);
std::vector<Variable<MWAWBorder> > getParagraphBorders() const;
friend std::ostream &operator<<(std::ostream &o, Border const &p);
int m_type[3];
MWAWColor m_frontColor;
MWAWColor m_backColor;
MWAWColor m_color[2];
int m_width;
int m_isDouble;
int m_flags;
std::string m_extra;
};
struct Entry : public MWAWEntry {
Entry(MWAWInputStreamPtr input);
~Entry();
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_type;
int m_typeId;
int m_values[3];
WPXBinaryData m_data;
shared_ptr<libmwaw::DebugFile> m_asciiFile;
private:
Entry(Entry const &);
Entry &operator=(Entry const &);
};
typedef shared_ptr<Entry> EntryPtr;
struct ZoneHeader {
ZoneHeader() : m_type(-1), m_docId(-1), m_fileId(-1), m_wrapping(-1), m_extra("") {}
virtual ~ZoneHeader() { }
bool read(shared_ptr<FWStruct::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:
FWStruct::ZoneHeader::m_type
int m_type
the zone type
Definition: FWStruct.hxx:148
FWStruct::EntryPtr
shared_ptr< Entry > EntryPtr
Definition: FWStruct.hxx:135
FWStruct::Border::m_color
MWAWColor m_color[2]
the colors line + ?
Definition: FWStruct.hxx:82
MWAWEntry.hxx
libmwaw_internal.hxx
FWStruct::Entry::operator=
Entry & operator=(Entry const &)
FWStruct::ZoneHeader::m_fileId
int m_fileId
the file id
Definition: FWStruct.hxx:152
libmwaw::DebugFile
an interface used to insert comment in a binary file, written in ascii form (if debug_with_files is n...
Definition: MWAWDebug.hxx:67
FWStruct::ZoneHeader::m_docId
int m_docId
the doc id
Definition: FWStruct.hxx:150
FWStruct::ZoneHeader
a structure used to store the data of a zone header in a FullWrite file
Definition: FWStruct.hxx:138
FWStruct::Entry
the definition of a zone in a FullWrite file
Definition: FWStruct.hxx:94
FWStruct::Border::m_type
int m_type[3]
the type (border, horizontal and vertical separators)
Definition: FWStruct.hxx:76
FWStruct::Entry::m_typeId
int m_typeId
the type id (find in FZoneFlags)
Definition: FWStruct.hxx:124
FWStruct::Border::Border
Border()
constructor
Definition: FWStruct.hxx:62
FWStruct::Entry::m_values
int m_values[3]
some unknown values
Definition: FWStruct.hxx:126
FWStruct::ZoneHeader::m_wrapping
int m_wrapping
the wrapping type
Definition: FWStruct.hxx:154
FWStruct::Entry::operator<<
friend std::ostream & operator<<(std::ostream &o, Entry const &entry)
operator<<
Definition: FWStruct.cxx:275
FWStruct::Border::getParagraphBorders
std::vector< Variable< MWAWBorder > > getParagraphBorders() const
returns the list of border order MWAWBorder::Pos
Definition: FWStruct.cxx:185
FWStruct::Border::read
bool read(shared_ptr< FWStruct::Entry > zone, int fSz)
try to read a border definiton
Definition: FWStruct.cxx:125
FWStruct::getColor
bool getColor(int color, MWAWColor &col)
try to convert a file data to a color
Definition: FWStruct.cxx:44
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:161
FWStruct::Entry::update
void update()
create a inputstream, ... if needed
Definition: FWStruct.cxx:309
FWStruct::Border::getBorder
static MWAWBorder getBorder(int type)
return a border corresponding to a type
Definition: FWStruct.cxx:116
FWStruct::Entry::Entry
Entry(MWAWInputStreamPtr input)
Definition: FWStruct.cxx:265
FWStruct::Border::operator<<
friend std::ostream & operator<<(std::ostream &o, Border const &p)
operator<<
Definition: FWStruct.cxx:204
MWAWBorder
a border
Definition: libmwaw_internal.hxx:232
FWStruct::Entry::m_input
MWAWInputStreamPtr m_input
the input
Definition: FWStruct.hxx:118
FWStruct::Border::m_isDouble
int m_isDouble
the f1 value: isDouble ?
Definition: FWStruct.hxx:86
FWStruct::ZoneHeader::operator<<
friend std::ostream & operator<<(std::ostream &o, ZoneHeader const &dt)
the operator<<
Definition: FWStruct.cxx:460
FWStruct::getTypeName
std::string getTypeName(int type)
returns the type name
Definition: FWStruct.cxx:64
FWStruct::ZoneHeader::ZoneHeader
ZoneHeader()
constructor
Definition: FWStruct.hxx:140
FWStruct::Entry::~Entry
~Entry()
Definition: FWStruct.cxx:270
FWStruct::Entry::getAsciiFile
libmwaw::DebugFile & getAsciiFile()
returns a reference to the ascii file
Definition: FWStruct.cxx:335
FWStruct::Entry::operator==
bool operator==(const Entry &a) const
basic operator==
Definition: FWStruct.cxx:340
FWStruct::Border::m_width
int m_width
the width
Definition: FWStruct.hxx:84
FWStruct::Entry::m_type
int m_type
the zone type id find in DStruct
Definition: FWStruct.hxx:122
MWAWInputStreamPtr
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:336
FWStruct::ZoneHeader::~ZoneHeader
virtual ~ZoneHeader()
destructor
Definition: FWStruct.hxx:142
MWAWDebug.hxx
FWStruct::Border
Internal: class to store a border which appear in docInfo.
Definition: FWStruct.hxx:60
FWStruct::Border::m_frontColor
MWAWColor m_frontColor
the front color (used for layout )
Definition: FWStruct.hxx:78
FWStruct::ZoneHeader::m_extra
std::string m_extra
some extra data
Definition: FWStruct.hxx:156
FWStruct::Entry::m_nextId
int m_nextId
the next entry id
Definition: FWStruct.hxx:120
FWStruct::Entry::valid
bool valid() const
returns true if the entry and the input is valid
Definition: FWStruct.cxx:304
FWStruct::Border::m_backColor
MWAWColor m_backColor
the back color (used for layout )
Definition: FWStruct.hxx:80
FWStruct::Border::m_extra
std::string m_extra
some extra data
Definition: FWStruct.hxx:90
MWAWEntry
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
FWStruct::Entry::m_data
WPXBinaryData m_data
the main data ( if the entry comes from several zone )
Definition: FWStruct.hxx:128
FWStruct::Entry::m_asciiFile
shared_ptr< libmwaw::DebugFile > m_asciiFile
the debug file
Definition: FWStruct.hxx:130
FWStruct::ZoneHeader::read
bool read(shared_ptr< FWStruct::Entry > zone)
try to read the data header of a classical zone
Definition: FWStruct.cxx:356
FWStruct::Border::m_flags
int m_flags
the flags
Definition: FWStruct.hxx:88
FWStruct::Entry::operator!=
bool operator!=(const Entry &a) const
basic operator!=
Definition: FWStruct.hxx:113
FWStruct::Entry::closeDebugFile
void closeDebugFile()
write the debug file, ...
Definition: FWStruct.cxx:329