Back to index

scribus-ng  1.3.4.dfsg+svn20071115
nftrcreader.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  *   Riku Leino, tsoots@gmail.com                                          *
00009  ***************************************************************************/
00010 #ifndef NFTRCREADER_H
00011 #define NFTRCREADER_H
00012 
00013 #include <vector>
00014 #include <utility>
00015 #include <qobject.h>
00016 #include <qdir.h>
00017 #include <qxml.h>
00018 #include <qstring.h>
00019 #include <qstringlist.h>
00020 #include "nfttemplate.h"
00021 
00022 typedef std::pair<QString*,QString*> Pair;
00023 
00024 class nftrcreader : public QXmlDefaultHandler
00025 {
00026 private:
00027        bool inSettings;
00028        bool inTemplate;
00029        bool inName;
00030        bool inFile;
00031        bool inTNail;
00032        bool inImg;
00033        bool inPSize;
00034        bool inColor;
00035        bool inDescr;
00036        bool inUsage;
00037        bool inScribusVersion;
00038        bool inDate;
00039        bool inAuthor;
00040        bool inEmail;
00041        QString currentDir;
00042        QString currentFile;
00043        QString templateCategory;
00044        nfttemplate* tmpTemplate;
00045        std::vector<nfttemplate*> *templates;
00046        std::vector<Pair*> cats;
00047        QString getCategory(QString cat);
00048        void setupCategories();
00049 public:
00050        nftrcreader(std::vector<nfttemplate*> *tmplts,QString sourceDir);
00051        ~nftrcreader();
00052        bool startDocument();
00053        bool startElement(const QString&, const QString&, const QString &name, const QXmlAttributes &attrs);
00054        bool endElement(const QString&, const QString&, const QString &name);
00055        bool characters(const QString &ch);
00056        void setSourceDir(QString source);
00057        void setSourceFile(QString sourceFile);
00058 };
00059 
00060 #endif