BeagleWksStructManager.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 /* libmwaw
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 BeagleWorks document
36  *
37  */
38 #ifndef BEAGLE_WKS_STRUCT_MANAGER
39 # define BEAGLE_WKS_STRUCT_MANAGER
40 
41 #include <map>
42 
43 #include "libmwaw_internal.hxx"
44 
45 #include "MWAWCell.hxx"
46 
47 namespace BeagleWksStructManagerInternal
48 {
49 struct State;
50 }
57 {
58 public:
59  struct Frame;
60 
62  explicit BeagleWksStructManager(MWAWParserStatePtr parserState);
65 
67  bool getFrame(int fId, Frame &frame) const;
69  std::map<int,Frame> const &getIdFrameMap() const;
70 
72  int getFontId(int fFontId) const;
74  void getHeaderFooterEntries(MWAWEntry &header, MWAWEntry &footer) const;
76  bool readFontNames(MWAWEntry const &entry);
78  bool readFrame(MWAWEntry const &entry);
80  bool readDocumentInfo();
83 
84  // resource fork
85 
87  bool readPicture(int pId, librevenge::RVNGBinaryData &pict, bool readEDTP=true);
89  bool readwPos(MWAWEntry const &entry);
91  bool readFontStyle(MWAWEntry const &entry);
92 
93  //
94  // formula data
95  //
96  /* reads a cell */
98  /* reads a formula */
99  bool readFormula(long endPos, MWAWVec2i const &pos, std::vector<MWAWCellContent::FormulaInstruction> &formula, std::string &error);
100 
102  struct Frame {
104  Frame() : m_charAnchor(true), m_id(0), m_pictId(0), m_origin(), m_dim(), m_page(1),
105  m_wrap(0), m_border(), m_bordersSet(0), m_extra("")
106  {
107  }
109  friend std::ostream &operator<<(std::ostream &o, Frame const &frm)
110  {
111  if (frm.m_id) o << "id=" << frm.m_id << ",";
112  if (!frm.m_charAnchor) o << "pageFrame,";
113  if (frm.m_page!=1) o << "page=" << frm.m_page << ",";
114  if (frm.m_origin[0]>0||frm.m_origin[1]>0)
115  o << "origin=" << frm.m_origin << ",";
116  o << "dim=" << frm.m_dim << ",";
117  if (frm.m_pictId) o << "picId=" << std::hex << frm.m_pictId << std::dec << ",";
118  o << frm.m_extra;
119  return o;
120  }
124  int m_id;
126  int m_pictId;
132  int m_page;
134  int m_wrap;
140  std::string m_extra;
141  };
142 protected:
151 
152 private:
155 
156 protected:
157  //
158  // data
159  //
162 
164  shared_ptr<BeagleWksStructManagerInternal::State> m_state;
165 };
166 
167 #endif
168 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:

Generated on Tue Mar 1 2016 23:42:41 for libmwaw by doxygen 1.8.4