StarObjectSmallGraphic.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
00002 
00003 /* libstaroffice
00004 * Version: MPL 2.0 / LGPLv2+
00005 *
00006 * The contents of this file are subject to the Mozilla Public License Version
00007 * 2.0 (the "License"); you may not use this file except in compliance with
00008 * the License or as specified alternatively below. You may obtain a copy of
00009 * the License at http://www.mozilla.org/MPL/
00010 *
00011 * Software distributed under the License is distributed on an "AS IS" basis,
00012 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013 * for the specific language governing rights and limitations under the
00014 * License.
00015 *
00016 * Major Contributor(s):
00017 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
00018 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
00019 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00020 * Copyright (C) 2006, 2007 Andrew Ziem
00021 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
00022 *
00023 *
00024 * All Rights Reserved.
00025 *
00026 * For minor contributions see the git repository.
00027 *
00028 * Alternatively, the contents of this file may be used under the terms of
00029 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00030 * in which case the provisions of the LGPLv2+ are applicable
00031 * instead of those above.
00032 */
00033 
00034 /*
00035  * Parser to convert a small graphic zone/OLE in a StarOffice document
00036  *
00037  */
00038 #ifndef STAR_OBJECT_SMALL_GRAPHIC
00039 #  define STAR_OBJECT_SMALL_GRAPHIC
00040 
00041 #include <vector>
00042 
00043 #include "libstaroffice_internal.hxx"
00044 #include "StarObject.hxx"
00045 
00046 namespace StarObjectSmallGraphicInternal
00047 {
00048 class GluePoint;
00049 class OutlinerParaObject;
00050 
00051 class Graphic;
00052 // SDR graphic
00053 class SdrGraphic;
00054 class SdrGraphicAttribute;
00055 class SdrGraphicCaption;
00056 class SdrGraphicCircle;
00057 class SdrGraphicEdge;
00058 class SdrGraphicGraph;
00059 class SdrGraphicGroup;
00060 class SdrGraphicMeasure;
00061 class SdrGraphicOLE;
00062 class SdrGraphicPath;
00063 class SdrGraphicRect;
00064 class SdrGraphicText;
00065 
00066 struct State;
00067 }
00068 
00069 class StarZone;
00070 
00076 class StarObjectSmallGraphic : public StarObject
00077 {
00078 public:
00080   StarObjectSmallGraphic(StarObject const &orig, bool duplicateState);
00082   virtual ~StarObjectSmallGraphic();
00084   bool readSdrObject(StarZone &zone);
00086   bool send(STOFFListenerPtr listener, STOFFPosition const &pos, StarObject &object, bool inPageMaster=false);
00088   friend std::ostream &operator<<(std::ostream &o, StarObjectSmallGraphic const &graphic);
00089 
00090 protected:
00091   //
00092   // low level
00093   //
00095   shared_ptr<StarObjectSmallGraphicInternal::SdrGraphic> readSVDRObject(StarZone &zone, int identifier);
00097   bool readSVDRObjectHeader(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphic &graphic);
00099   bool readSVDRObjectAttrib(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicAttribute &graphic);
00101   bool readSVDRObjectText(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicText &graphic);
00103   bool readSVDRObjectRect(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicRect &graphic);
00105   bool readSVDRObjectCaption(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicCaption &graphic);
00107   bool readSVDRObjectCircle(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicCircle &graphic);
00109   bool readSVDRObjectEdge(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicEdge &graphic);
00111   bool readSVDRObjectGraph(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicGraph &graphic);
00113   bool readSVDRObjectGroup(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicGroup &graphic);
00115   bool readSVDRObjectMeasure(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicMeasure &graphic);
00117   bool readSVDRObjectOLE(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicOLE &graphic);
00119   bool readSVDRObjectPath(StarZone &zone, StarObjectSmallGraphicInternal::SdrGraphicPath &graphic);
00120 
00122   bool readSDRGluePoint(StarZone &zone, StarObjectSmallGraphicInternal::GluePoint &point);
00124   bool readSDRGluePointList(StarZone &zone, std::vector<StarObjectSmallGraphicInternal::GluePoint> &listPoints);
00126   bool readSDRObjectConnection(StarZone &zone);
00128   bool readSDRObjectSurrogate(StarZone &zone);
00130   bool readSDROutlinerParaObject(StarZone &zone, StarObjectSmallGraphicInternal::OutlinerParaObject &object);
00132   bool readSDRUserData(StarZone &zone, bool inRecord);
00134   bool readSDRUserDataList(StarZone &zone, bool inRecord);
00135 
00137   shared_ptr<StarObjectSmallGraphicInternal::Graphic> readFmFormObject(StarZone &zone, int identifier);
00138 
00140   shared_ptr<StarObjectSmallGraphicInternal::Graphic> readSCHUObject(StarZone &zone, int identifier);
00141 
00143   shared_ptr<StarObjectSmallGraphicInternal::Graphic> readSDUDObject(StarZone &zone, int identifier);
00144 
00145 protected:
00146   //
00147   // data
00148   //
00149 
00151   shared_ptr<StarObjectSmallGraphicInternal::State> m_graphicState;
00152 private:
00153   StarObjectSmallGraphic &operator=(StarObjectSmallGraphic const &orig);
00154 };
00155 #endif
00156 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: