CDRStylesCollector.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* libcdr
00003  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License or as specified alternatively below. You may obtain a copy of
00008  * the License at http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * Major Contributor(s):
00016  * Copyright (C) 2012 Fridrich Strba <fridrich.strba@bluewin.ch>
00017  *
00018  *
00019  * All Rights Reserved.
00020  *
00021  * For minor contributions see the git repository.
00022  *
00023  * Alternatively, the contents of this file may be used under the terms of
00024  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
00025  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00026  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
00027  * instead of those above.
00028  */
00029 
00030 #ifndef __CDRSTYLESCOLLECTOR_H__
00031 #define __CDRSTYLESCOLLECTOR_H__
00032 
00033 #include <map>
00034 #include <vector>
00035 #include <stack>
00036 #include <libwpg/libwpg.h>
00037 #include <lcms2.h>
00038 #include "CDRTypes.h"
00039 #include "CDRPath.h"
00040 #include "CDROutputElementList.h"
00041 #include "CDRCollector.h"
00042 #include "libcdr_utils.h"
00043 
00044 namespace libcdr
00045 {
00046 
00047 class CDRStylesCollector : public CDRCollector
00048 {
00049 public:
00050   CDRStylesCollector(CDRParserState &ps);
00051   virtual ~CDRStylesCollector();
00052 
00053   // collector functions
00054   void collectPage(unsigned level);
00055   void collectObject(unsigned) {}
00056   void collectGroup(unsigned) {}
00057   void collectVect(unsigned) {}
00058   void collectOtherList() {}
00059   void collectCubicBezier(double, double, double, double, double, double) {}
00060   void collectQuadraticBezier(double, double, double, double) {}
00061   void collectMoveTo(double, double) {}
00062   void collectLineTo(double, double) {}
00063   void collectArcTo(double, double, bool, bool, double, double) {}
00064   void collectClosePath() {}
00065   void collectLevel(unsigned) {}
00066   void collectTransform(double, double, double, double, double, double, bool) {}
00067   void collectFildId(unsigned) {}
00068   void collectOutlId(unsigned) {}
00069   void collectFild(unsigned id, unsigned short fillType, const CDRColor &color1, const CDRColor &color2, const CDRGradient &gradient, const CDRImageFill &imageFill);
00070   void collectOutl(unsigned id, unsigned short lineType, unsigned short capsType, unsigned short joinType, double lineWidth,
00071                    double stretch, double angle, const CDRColor &color, const std::vector<unsigned short> &dashArray,
00072                    unsigned startMarkerId, unsigned endMarkerId);
00073   void collectRotate(double,double,double) {}
00074   void collectFlags(unsigned, bool) {}
00075   void collectPageSize(double width, double height, double offsetX, double offsetY);
00076   void collectPolygonTransform(unsigned, unsigned, double, double, double, double) {}
00077   void collectBitmap(unsigned, double, double, double, double) {}
00078   void collectBmp(unsigned imageId, unsigned colorModel, unsigned width, unsigned height, unsigned bpp, const std::vector<unsigned> &palette, const std::vector<unsigned char> &bitmap);
00079   void collectBmp(unsigned imageId, const std::vector<unsigned char> &bitmap);
00080   void collectBmpf(unsigned patternId, unsigned width, unsigned height, const std::vector<unsigned char> &pattern);
00081   void collectPpdt(const std::vector<std::pair<double, double> > &, const std::vector<unsigned> &) {}
00082   void collectFillTransform(double, double, double, double, double, double) {}
00083   void collectFillOpacity(double) {}
00084   void collectPolygon() {}
00085   void collectSpline() {}
00086   void collectColorProfile(const std::vector<unsigned char> &profile);
00087   void collectBBox(double, double, double, double) {}
00088   void collectSpnd(unsigned) {}
00089   void collectVectorPattern(unsigned, const WPXBinaryData &) {}
00090   void collectPaletteEntry(unsigned colorId, unsigned userId, const CDRColor &color);
00091   void collectFont(unsigned fontId, unsigned short fontEncoding, const WPXString &font);
00092   void collectText(unsigned textId, unsigned styleId, const std::vector<unsigned char> &data,
00093                    const std::vector<uint64_t> &charDescriptions, const std::map<unsigned, CDRCharacterStyle> &styleOverrides);
00094   void collectArtisticText() {}
00095   void collectParagraphText() {}
00096   void collectStlt(const std::map<unsigned, CDRCharacterStyle> &charStyles);
00097 
00098 private:
00099   CDRStylesCollector(const CDRStylesCollector &);
00100   CDRStylesCollector &operator=(const CDRStylesCollector &);
00101 
00102   CDRParserState &m_ps;
00103   CDRPage m_page;
00104   std::map<unsigned, CDRCharacterStyle> m_charStyles;
00105 };
00106 
00107 } // namespace libcdr
00108 
00109 #endif /* __CDRCOLLECTOR_H__ */
00110 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */