Back to index

scribus-ng  1.3.4.dfsg+svn20071115
serializer.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008                           serializer.h  -  description
00009                              -------------------
00010     begin                : Sat May 5 2001
00011     copyright            : (C) 2001 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef SERIALIZER_H
00025 #define SERIALIZER_H
00026 
00027 #include <qstring.h>
00028 #include <qfile.h>
00029 #include "scribusapi.h"
00030 #include "selection.h"
00031 #include "desaxe/saxio.h"
00032 #include "desaxe/digester.h"
00033 
00045 class ScribusDoc;
00046 class ColorList;
00047 
00048 class SCRIBUS_API Serializer : public desaxe::Digester {
00049 public: 
00050 
00055        Serializer(ScribusDoc& doc);
00060        static void serializeObjects(const Selection& objects, SaxHandler& handler);
00065        Selection deserializeObjects(const QCString & xml);
00070        Selection deserializeObjects(const QFile & xml);
00071        
00073        static bool readWithEncoding(const QString& filename, const QString& encoding, 
00074                                                          QString & txt);
00076        static bool writeWithEncoding(const QString& filename, const QString& encoding, 
00077                                                           const QString& txt);
00078 
00079 private:
00080               ScribusDoc& m_Doc;
00081        Selection importCollection();
00082        void updateGradientColors(const ColorList& colors);
00083 };
00084 
00085 #endif