home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scribusXml.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-26  |  4.3 KB  |  102 lines

  1. /*
  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.
  6. */
  7. /***************************************************************************
  8.                      scribusXml.h the document xml library for scribus
  9.                              -------------------
  10.     begin                : Sam Jul 14 10:00:00 CEST 2001
  11.     copyright            : (C) 2001 by Christian T∩┐╜p
  12.     email                : christian.toepp@mr-ct@gmx.de
  13.  ***************************************************************************/
  14.  
  15. #ifndef _SCRIBUSXML_H
  16. #define _SCRIBUSXML_H
  17.  
  18. #include <QDomDocument>
  19. #include <QDomElement>
  20. #include <QList>
  21. #include <QProgressBar>
  22.  
  23. #include "scfonts.h"
  24. #include "scribusapi.h"
  25. #include "scribusstructs.h"
  26. #include "selection.h"
  27. #include "styles/styleset.h"
  28.  
  29. #include <QXmlStreamAttributes>
  30. #include <QXmlStreamReader>
  31. #include <QXmlStreamWriter>
  32. class PageItem;
  33. class PrefsManager;
  34. class ScribusView;
  35. class SCFonts;
  36. class ScribusDoc;
  37. class ScPattern;
  38. class ScXmlStreamWriter;
  39.  
  40. class SCRIBUS_API ScriXmlDoc
  41. {
  42.  
  43. public:
  44.     ScriXmlDoc();
  45.     ~ScriXmlDoc() {};
  46.     /*!
  47.     \author Frederic Dubuy <effediwhy@gmail.com>, Petr Vanek
  48.     \date august 17th 2004, 10/03/2004
  49.     \brief Preliminary Scribus file validator. totally rewritten when fixing crash bug #1092. It's much simpler now.
  50.     \param file filename of file to test
  51.     \retval bool true = Scribus format file, false : not Scribus
  52.     */
  53.     bool    ReadElemHeader(QString file, bool isFile, double *x, double *y, double *w, double *h);
  54.     bool    ReadElem(QString fileName, SCFonts &avail, ScribusDoc *doc, double Xp, double Yp, bool Fi, bool loc, QMap<QString,QString> &FontSub, ScribusView *view);
  55.     bool    ReadElemToLayer(QString fileName, SCFonts &avail, ScribusDoc *doc, double Xp, double Yp, bool Fi, bool loc, QMap<QString,QString> &FontSub, ScribusView *view, int toLayer);
  56.     QString WriteElem(ScribusDoc *doc, ScribusView *view, Selection *selection);
  57.  
  58.     ColorList Farben;
  59.     StyleSet<ParagraphStyle> docParagraphStyles;
  60.     QList<Linked> LFrames;
  61.     QStringList MNames;
  62.     QMap<QString,QString> DoFonts;
  63.     QMap<QString,QString> ReplacedFonts;
  64.     QMap<uint,QString> DoVorl;
  65.     QList<ScFace> dummyScFaces;
  66.     uint VorlC;
  67.     bool newReplacement;
  68.     
  69. protected:
  70.     PrefsManager* prefsManager;
  71.  
  72.     bool    attrHasValue(const QXmlStreamAttributes& attrs, const char* attName);
  73.     bool    attrAsBool(const QXmlStreamAttributes& attrs, const char* attName, bool defVal = false);
  74.     int     attrAsInt (const QXmlStreamAttributes& attrs, const char* attName, int  defVal = 0);
  75.     double  attrAsDbl (const QXmlStreamAttributes& attrs, const char* attName, double defVal = 0.0);
  76.     QString attrAsString (const QXmlStreamAttributes& attrs, const char* attName, const QString& defVal);
  77.  
  78.     void GetItemProps(const QXmlStreamAttributes& attrs, struct CopyPasteBuffer *OB, const QString& baseDir, bool newVersion);
  79.     void GetItemText (const QXmlStreamAttributes& attrs, StoryText& story, ScribusDoc *doc, LastStyles* last, bool VorLFound, bool impo);
  80.     void GetStyle(QXmlStreamReader& reader, ParagraphStyle &vg, StyleSet<ParagraphStyle>* tempStyles, ScribusDoc* doc, bool fl);
  81.  
  82.     void ReadPattern(QXmlStreamReader& reader, ScribusDoc* doc, ScribusView *view, const QString& fileName, int& GrMax, bool styleFound, bool newVersion);
  83.     void ReadLegacyCStyle (const QXmlStreamAttributes& attrs, CharStyle& style, ScribusDoc* doc);
  84.     void ReadCStyle (const QXmlStreamAttributes& attrs, CharStyle& style, ScribusDoc* doc);
  85.     void ReadPStyle (QXmlStreamReader& reader, ParagraphStyle &style, ScribusDoc* doc);
  86.  
  87.     void SetItemProps(ScXmlStreamWriter& writer, ScribusDoc *doc, PageItem* item, const QString& baseDir, bool newFormat);
  88.     void WriteObject (ScXmlStreamWriter& writer, ScribusDoc *doc, PageItem *item, const QString& baseDir, QMap<int, int> &UsedMapped2Saved);
  89.     void WriteITEXTs (ScXmlStreamWriter& writer, ScribusDoc *doc, PageItem *item);
  90.     void WriteLegacyCStyle (ScXmlStreamWriter& writer, const CharStyle& style);
  91.     void WriteCStyle (ScXmlStreamWriter& writer, const CharStyle& style);
  92.     void WritePStyle (ScXmlStreamWriter& writer, const ParagraphStyle& style, const QString& nodeName);
  93.     
  94.     QString AskForFont(SCFonts &avail, QString fStr, ScribusDoc *doc);
  95. };
  96.  
  97. #endif // _SCRIBUS_CONFIG_
  98.  
  99.  
  100.  
  101.  
  102.