2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
7
/***************************************************************************
8
serializer.h - description
10
begin : Sat May 5 2001
11
copyright : (C) 2001 by Franz Schmid
12
email : Franz.Schmid@altmuehlnet.de
13
***************************************************************************/
15
/***************************************************************************
17
* This program is free software; you can redistribute it and/or modify *
18
* it under the terms of the GNU General Public License as published by *
19
* the Free Software Foundation; either version 2 of the License, or *
20
* (at your option) any later version. *
22
***************************************************************************/
30
#include "scribusapi.h"
31
#include "selection.h"
32
#include "desaxe/saxio.h"
33
#include "desaxe/digester.h"
36
* This class reads/writes Scribus datastructures from/to SAX streams
37
* (was done by ScribusXML before). It also serves as a testbed for the new
38
* Scribus 1.4 file format
40
* Currently it also holds to old methods which are used to read/write text
49
class SCRIBUS_API Serializer : public desaxe::Digester {
52
/** Construct a Serializer object which can be used to (de)serialize Scribus
53
elements. Since it has Digester as a superclass, a Serializer object can
54
also be used where a SaxHandler is required as argument, eg. the saxx() method.
56
Serializer(ScribusDoc& doc);
58
Writes all objects in selection to handler as a fragment. Needed styles and colors
61
static void serializeObjects(const Selection& objects, SaxHandler& handler);
63
Reads objects from the given QString which must represent a fragment, imports them
64
into the document and returns a (nonGUI) selection to it.
66
Selection deserializeObjects(const QByteArray & xml);
68
Reads objects from the given QFile which must represent a fragment, imports them
69
into the document and returns a (nonGUI) selection to it.
71
Selection deserializeObjects(const QFile & xml);
73
Selection cloneObjects(const Selection& objects);
75
/** Legacy method to read plain text for a textframe */
76
static bool readWithEncoding(const QString& filename, const QString& encoding,
78
/** Legacy method to write plain text from a textframe */
79
static bool writeWithEncoding(const QString& filename, const QString& encoding,
84
ColorList backUpColors;
85
Selection importCollection();
86
void updateGradientColors(const ColorList& colors);