--- a
+++ b/gsoc2009/textfilter/scribus/plugins/idmlimplugin/designmap.h
@@ -0,0 +1,196 @@
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+ /***************************************************************************
+  *   Copyright (C) 2009 by Jain Basil Aliyas                               *
+  *   mail@jainbasil.net                                                    *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+  *   it under the terms of the GNU General Public License as published by  *
+  *   the Free Software Foundation; either version 2 of the License, or     *
+  *   (at your option) any later version.                                   *
+  *                                                                         *
+  *   This program 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 General Public License for more details.                          *
+  *                                                                         *
+  *   You should have received a copy of the GNU General Public License     *
+  *   along with this program; if not, write to the                         *
+  *   Free Software Foundation, Inc.,                                       *
+  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+  ***************************************************************************/
+
+
+#ifndef DESIGNMAP_H
+#define DESIGNMAP_H
+
+#include <QString>
+#include <QList>
+#include <QByteArray>
+#include <QXmlStreamReader>
+#include <QXmlStreamAttributes>
+#include <QDomDocument>
+#include <QDomElement>
+#include <QDomNode>
+
+struct Language
+{
+    QString DoubleQuotes;
+    QString Self;
+    int languageID;
+    QString name;
+    QString PrimaryLanguage;
+    QString Sublanguage;
+    QString singleQuotes;
+};
+
+enum RenderingIntent
+{
+	UseColorSettings,
+	Perceptual,
+	Saturation,
+	RelativeColorimetric,
+	AbsoluteColorimetric
+};
+
+enum ColorSettingsPolicy
+{
+	ColorPolicyOff,
+	PreserveEmbeddedProfiles,
+	ConvertToWorkingSpace,
+	CombinationOfPreserveAndSafeCmyk
+};
+
+struct Document
+{
+	QString self;
+        QString Name;
+	QString transparencyDefault;
+	QString FullName;
+	bool visible;
+	QString FilePath;
+	QString ZeroPoint; //Currently taken as a QString, need to convert it into form [x,y]
+	QString Activelayer;
+	QList<QString> ununsedSwatches;
+	QList<QString> CMYKProfileList;
+	QList<QString> RGBProfileList;
+	QString RGBProfile,CMYKProfile;
+	QString transparencyDefault;
+	RenderingIntent SolidColorIntent;
+	RenderingIntent AfterBlendingIntent;
+	RenderingIntent DefaultImageIntent;
+	ColorSettingsPolicy RGBPolicy;
+	ColorSettingsPolicy CMYKPolicy;
+	bool AccurateLABSpots;
+	QList<Layer> layerList;
+	QList<Layer> sectionList;
+        QList<QString> storyList;
+	QList<CrossReferenceFormat> CRFomatList;
+	QList<Bookmark> bookmark;  
+	QList<QString> Spreads;
+	QList<QString> MasterSpreads;
+        QList<Language> languageList;
+};
+
+struct Layer
+{
+    QString self;
+    bool expandable;
+    bool ignoreWrap;
+    bool locked;
+    bool lockGuides;
+    QString Name;
+    bool printable;
+    bool showGuides;
+    bool visible;
+    QString LayerColor;
+};
+
+struct Section
+{
+    QString self;
+    int length;//Number of pages in the section
+    QString Name;
+    QString PageNumberStyle;
+    bool continueNumbering;
+    bool includeSecPrefix;
+    int pageNumberStart;
+    QString Marker;
+    QString pageStart;//contains the value of self of start page
+    QString sectionPrefix;
+};
+
+enum Blocktype
+{
+    CustomStringBuildingBlock,
+    FileNameBuildingBlock,
+    ChapterNumberBuildingBlock,
+    PageNumberBuildingBlock,
+    FullParagraphBuildingBlock,
+    ParagraphNumberBuildingBlock,
+    ParagraphTextBuildingBlock,
+    BookmarkNameBuildingBlock
+};
+
+struct Buildingblock
+{
+    QString appliedCStyle;
+    QString appliedDelimiter;
+    Blocktype blocktype;
+    QString CustomText;
+    bool IncludeDelimiter;
+};
+
+struct CrossReferenceFormat
+{
+    Buildingblock b;
+};
+
+struct Bookmark
+{
+    QString self;
+    QString Name;
+    QString Destination;
+    QString Label;
+};
+
+class IDPKGDesignMap: public QObject
+{
+    Q_OBJECT
+
+    public:
+	    /*!
+	    \AUTHOR Jain Basil Aliyas
+	    \brief Imports the designmap.xml file, processes it and translate it into an Object model
+	    */
+            IDPKGDesignMap(QString &designPath);
+            ~IDPKGDesignMap();
+            bool processDesginMap();
+            bool loadFile(QString &filename);
+            QXmlStreamReader reader;
+
+            /* functions to handle various sections like language, layers, section etc */
+	    void docAttributes(QDomElement&);
+            void handleLanguage(QDomElement&);
+            void handleLayer(QDomElement&);
+            void handleSection(QDomElement&);
+            void handleCRFormat(QDomElement&);
+            void handleBookmarks(QDomElement&);
+            void getMSpreadSrc(QDomElement&);
+            void getSpreadSrc(QDomElement&);
+            void getStorySrc(QDomElement&);
+            void getBStorySrc(QDomElement&);
+
+    private:
+	    QDomDocument doc;
+	    QDomNode node;
+	    QDomElement root,element;
+	    Document idmlDocument;
+	    QStringList storyList;
+	    QStringList spreadList;
+};
+#endif // DESIGNMAP_H