summaryrefslogtreecommitdiff
path: root/src/lib/PGPLUSDocument.cpp
blob: ef4f77f977c62038ad731d864da1574ce52701f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* libpgplus
 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
 * Copyright (C) 2007 Fridrich Strba (fridrich.strba@bluewin.ch)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02111-1301 USA
 */

#include <sstream>
#include <string>
#include <string.h>
#include "PGPLUSDocument.h"
#include "PGPLUSSVGGenerator.h"
#include "libpgplus_utils.h"

/**
Analyzes the content of an input stream to see if it can be parsed
\param input The input stream
\return A value that indicates whether the content from the input
stream is a PagePlus Document that libpgplus is able to parse
*/
bool libpgplus::PGPLUSDocument::isSupported(WPXInputStream *input)
{
  return false;
}

/**
Parses the input stream content. It will make callbacks to the functions provided by a
PGPLUSPaintInterface class implementation when needed. This is often commonly called the
'main parsing routine'.
\param input The input stream
\param painter A PGPLUSPainterInterface implementation
\return A value that indicates whether the parsing was successful
*/
bool libpgplus::PGPLUSDocument::parse(::WPXInputStream *input, libwpg::WPGPaintInterface *painter)
{
  return false;
}

/**
Parses the input stream content and generates a valid Scalable Vector Graphics
Provided as a convenience function for applications that support SVG internally.
\param input The input stream
\param output The output string whose content is the resulting SVG
\return A value that indicates whether the SVG generation was successful.
*/
bool libpgplus::PGPLUSDocument::generateSVG(::WPXInputStream *input, libpgplus::PGPLUSStringVector &output)
{
  libpgplus::PGPLUSSVGGenerator generator(output);
  bool result = libpgplus::PGPLUSDocument::parse(input, &generator);
  return result;
}

/* vim:set shiftwidth=2 softtabstop=2 expandtab: */