PowerPoint7Struct.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.
*/
#ifndef POWER_POINT7_STRUCT
# define POWER_POINT7_STRUCT
#include <string>
#include <sstream>
#include "libmwaw_internal.hxx"
#include "MWAWDebug.hxx"
#include "MWAWInputStream.hxx"
namespace PowerPoint7Struct
{
struct SlideId {
explicit SlideId(unsigned long id=0)
: m_id(int(id&0x7fffffffL))
, m_isMaster((id&0x80000000L) ? true : false)
, m_inNotes(false)
, m_inHandout(false)
{
}
bool isValid() const
{
return m_isMaster || m_inHandout || m_id!=0;
}
bool operator<(SlideId const &id) const
{
if (m_isMaster!=id.m_isMaster) return m_isMaster;
if (m_inNotes!=id.m_inNotes) return m_inNotes;
if (m_inHandout!=id.m_inHandout) return m_inHandout;
return m_id < id.m_id;
}
bool operator==(SlideId const &id) const
{
if (m_isMaster!=id.m_isMaster) return false;
if (m_inNotes!=id.m_inNotes) return false;
if (m_inHandout!=id.m_inHandout) return false;
return m_id == id.m_id;
}
bool operator!=(SlideId const &id) const
{
return !operator==(id);
}
friend std::ostream &operator<<(std::ostream &o, SlideId const &id)
{
if (id.m_isMaster)
o << "MS" << id.m_id;
else if (id.m_id)
o << "S" << id.m_id;
if (id.m_inNotes)
o << "[note]";
if (id.m_inHandout)
o << "Handout";
return o;
}
int m_id;
bool m_isMaster;
bool m_inNotes;
bool m_inHandout;
};
struct Zone {
Zone() : m_type(0), m_dataSize(0)
{
for (auto &val : m_values) val=0;
}
bool read(MWAWInputStreamPtr stream, long endPos=-1);
std::string getName() const
{
std::stringstream s;
s << "Zone" << std::hex << m_type << std::dec << "A";
return s.str();
}
friend std::ostream &operator<<(std::ostream &o, Zone const &z)
{
for (int i=0; i<6; ++i) {
if (z.m_values[i]) o << "z" << i << "=" << z.m_values[i] << ",";
}
return o;
}
int m_type;
long m_dataSize;
int m_values[6];
};
}
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWDebug.hxx
MWAWInputStream.hxx
libmwaw_internal.hxx
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition libmwaw_internal.hxx:551
PowerPoint7Struct
namespace used to define basic struct of a Microsoft PowerPoint 95 files (Windows)
Definition PowerPoint7Graph.hxx:62
PowerPoint7Struct::SlideId::m_inHandout
bool m_inHandout
a flag to know if the content is in the handout part
Definition PowerPoint7Struct.hxx:104
PowerPoint7Struct::SlideId::isValid
bool isValid() const
returns true if the id is valid
Definition PowerPoint7Struct.hxx:59
PowerPoint7Struct::SlideId::operator<
bool operator<(SlideId const &id) const
operator<
Definition PowerPoint7Struct.hxx:64
PowerPoint7Struct::SlideId::m_isMaster
bool m_isMaster
a flag to know if this is a master slide or a normal slide
Definition PowerPoint7Struct.hxx:100
PowerPoint7Struct::SlideId::SlideId
SlideId(unsigned long id=0)
Definition PowerPoint7Struct.hxx:51
PowerPoint7Struct::SlideId::operator<<
friend std::ostream & operator<<(std::ostream &o, SlideId const &id)
operator<<
Definition PowerPoint7Struct.hxx:85
PowerPoint7Struct::SlideId::m_id
int m_id
the slide id
Definition PowerPoint7Struct.hxx:98
PowerPoint7Struct::SlideId::m_inNotes
bool m_inNotes
a flag to know if the content is in the notes part
Definition PowerPoint7Struct.hxx:102
PowerPoint7Struct::SlideId::operator!=
bool operator!=(SlideId const &id) const
operator==
Definition PowerPoint7Struct.hxx:80
PowerPoint7Struct::SlideId::operator==
bool operator==(SlideId const &id) const
operator==
Definition PowerPoint7Struct.hxx:72
PowerPoint7Struct::Zone::m_values
int m_values[6]
some value
Definition PowerPoint7Struct.hxx:135
PowerPoint7Struct::Zone::getName
std::string getName() const
returns a basic name
Definition PowerPoint7Struct.hxx:116
PowerPoint7Struct::Zone::Zone
Zone()
constructor
Definition PowerPoint7Struct.hxx:109
PowerPoint7Struct::Zone::m_type
int m_type
the type
Definition PowerPoint7Struct.hxx:131
PowerPoint7Struct::Zone::m_dataSize
long m_dataSize
the data size
Definition PowerPoint7Struct.hxx:133
PowerPoint7Struct::Zone::operator<<
friend std::ostream & operator<<(std::ostream &o, Zone const &z)
operator<<
Definition PowerPoint7Struct.hxx:123
PowerPoint7Struct::Zone::read
bool read(MWAWInputStreamPtr stream, long endPos=-1)
try to read a zone header
Definition PowerPoint7Struct.cxx:38