Debian Codegraph @

src/lib/MWAWGraphicDecoder.hxx

raw
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) 2006 Ariya Hidayat ([email protected])
18 * Copyright (C) 2004 Marc Oude Kotte ([email protected])
19 * Copyright (C) 2002 William Lachance ([email protected])
20 * Copyright (C) 2002,2004 Marc Maurer ([email protected])
21 * Copyright (C) 2004-2006 Fridrich Strba ([email protected])
22 * Copyright (C) 2006, 2007 Andrew Ziem
23 * Copyright (C) 2011, 2012 Alonso Laurent ([email protected])
24 *
25 *
26 * All Rights Reserved.
27 *
28 * For minor contributions see the git repository.
29 *
30 * Alternatively, the contents of this file may be used under the terms of
31 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
32 * in which case the provisions of the LGPLv2+ are applicable
33 * instead of those above.
34 */
35
36 #ifndef MWAW_GRAPHIC_DECODER_HXX
37 #define MWAW_GRAPHIC_DECODER_HXX
38
39 #include <librevenge/librevenge.h>
40 #include "libmwaw_internal.hxx"
41
42 #include "MWAWPropertyHandler.hxx"
43
44 /** main class used to decode a librevenge::RVNGBinaryData created by
45 \see MWAWGraphicEncoder (with mimeType="image/mwaw-odg") and to send
46 it contents to librevenge::RVNGDrawingInterface
47 */
48 class MWAWGraphicDecoder final : public MWAWPropertyHandler
49 {
50 public:
51 /** constructor */
52 explicit MWAWGraphicDecoder(librevenge::RVNGDrawingInterface *output)
53 : MWAWPropertyHandler()
54 , m_output(output) { }
55 /** destructor */
56 ~MWAWGraphicDecoder() final {}
57
58 /** insert an element */
59 void insertElement(const char *psName) final ;
60 /** insert an element ( with a librevenge::RVNGPropertyList ) */
61 void insertElement(const char *psName, const librevenge::RVNGPropertyList &xPropList) final;
62 /** insert an element ( with a librevenge::RVNGPropertyListVector parameter ) */
63 void insertElement(const char *psName, const librevenge::RVNGPropertyList &xPropList,
64 const librevenge::RVNGPropertyListVector &vector);
65 /** insert a sequence of character */
66 void characters(const librevenge::RVNGString &sCharacters) final
67 {
68 if (!m_output) return;
69 m_output->insertText(sCharacters);
70 }
71 private:
72 /// copy constructor (undefined)
73 MWAWGraphicDecoder(MWAWGraphicDecoder const &) = delete;
74 /// operator= (undefined)
75 MWAWGraphicDecoder operator=(MWAWGraphicDecoder const &) = delete;
76 /** the interface output */
77 librevenge::RVNGDrawingInterface *m_output;
78 };
79
80 #endif
81
82 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: