Back to index

scribus-ng  1.3.4.dfsg+svn20071115
pslib.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                           pslib.h  -  description
00009                              -------------------
00010     begin                : Sat May 26 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 PSLIB_H
00025 #define PSLIB_H
00026 #include <qstring.h>
00027 #include <qcstring.h>
00028 #include <qpen.h>
00029 #include <qfile.h>
00030 #include <qtextstream.h>
00031 #include <vector>
00032 #include <utility>
00033 class ScribusDoc;
00034 //class ScribusView;
00035 #include "scribusapi.h"
00036 #include "page.h"
00037 #include "pageitem.h"
00038 #include "scribusstructs.h"
00039 #include CMS_INC
00040 
00041 #ifdef NLS_PROTO
00042 class ScText;
00043 #endif
00044 
00045 class MultiProgressDialog;
00046 
00052 class SCRIBUS_API PSLib : public QObject
00053 {
00054        Q_OBJECT
00055        public:
00056               PSLib(PrintOptions &options, bool psart, SCFonts &AllFonts, QMap<QString, QMap<uint, FPointArray> > DocFonts, ColorList DocColors, bool pdf = false, bool spot = true);
00057               virtual ~PSLib() {};
00058               virtual bool PS_set_file(QString fn);
00059               virtual void PS_set_Info(QString art, QString was);
00060               virtual void PS_begin_doc(ScribusDoc *doc, double x, double y, double breite, double hoehe, int numpage, bool doDev, bool sep, bool farb, bool ic, bool gcr, bool over = false);
00061               virtual void PS_begin_page(Page* pg, MarginStruct* Ma, bool Clipping);
00062               virtual void PS_end_page();
00063               virtual void PS_curve(double x1, double y1, double x2, double y2, double x3, double y3);
00064               virtual void PS_moveto(double x, double y);
00065               virtual void PS_lineto(double x, double y);
00066               virtual void PS_closepath();
00067               virtual void PS_translate(double x, double y);
00068               virtual void PS_scale(double x, double y);
00069               virtual void PS_rotate(double x);
00070               virtual void PS_clip(bool mu);
00071               virtual void PS_save();
00072               virtual void PS_restore();
00073               virtual void PS_setcmykcolor_fill(double c, double m, double y, double k);
00074               virtual void PS_setcmykcolor_dummy();
00075               virtual void PS_setcmykcolor_stroke(double c, double m, double y, double k);
00076               virtual void PS_setlinewidth(double w);
00077               virtual void PS_setcapjoin(Qt::PenCapStyle ca, Qt::PenJoinStyle jo);
00078               virtual void PS_setdash(Qt::PenStyle st, double offset, QValueList<double> dash);
00079               virtual void PS_selectfont(QString f, double s);
00080               virtual void PS_fill();
00081               virtual void PS_fillspot(QString color, int shade);
00082               virtual void PS_stroke();
00083               virtual void PS_strokespot(QString color, int shade);
00084               virtual void PS_fill_stroke();
00085               virtual void PS_newpath();
00086               virtual void PS_MultiRadGradient(double w, double h, double x, double y, QValueList<double> Stops, QStringList Colors, QStringList colorNames, QValueList<int> colorShades);
00087               virtual void PS_MultiLinGradient(double w, double h, QValueList<double> Stops, QStringList Colors, QStringList colorNames, QValueList<int> colorShades);
00088               virtual void PS_show(double x, double y);
00089               virtual void PS_showSub(uint chr, QString font, double size, bool stroke);
00090               virtual void PS_show_xyG(QString font, uint gl, double x, double y, bool stop);
00091               virtual void PS_image(PageItem *c, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name = "");
00092               virtual void PS_plate(int nr, QString name = "");
00093               virtual void PS_setGray();
00094               virtual void PDF_Bookmark(QString text, uint Seite);
00095               virtual void PDF_Annotation(QString text, double x, double y, double b, double h);
00096               virtual void PS_close();
00097               virtual void PS_insert(QString i);
00098               virtual void PS_TemplateStart(QString Name);
00099               virtual void PS_TemplateEnd();
00100               virtual void PS_UseTemplate(QString Name);
00101               virtual void PS_ImageData(PageItem *c, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf);
00102               virtual int CreatePS(ScribusDoc* Doc, PrintOptions &options);
00103               virtual void ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master, bool embedded = false, bool useTemplate = false);
00104               virtual void ProcessPage(ScribusDoc* Doc, /*ScribusView* view,*/Page* a, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
00105               virtual void putColor(const QString& color, int shade, bool fill);
00106               virtual void SetClipPath(FPointArray *c, bool poly = true);
00107               virtual void HandleGradient(PageItem *c, double w, double h, bool gcr);
00108               virtual void SetFarbe(const QString& color, int shade, int *h, int *s, int *v, int *k, bool gcr);
00109               virtual void SetFarbe(const ScColor& color, int shade, int *h, int *s, int *v, int *k, bool gcr);
00110               virtual void setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, Page* pg, bool sep, bool farb, bool ic, bool master);
00111               virtual void setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint a, uint d, ScText *hl, const ParagraphStyle& pstyle, Page* pg, bool sep, bool farb, bool ic, bool master);
00112               bool Art;
00113        private:
00114               void PutSeite(QString c);
00115               void PutSeite(QByteArray& array, bool hexEnc);
00116               void PutSeite(const char* array, int length, bool hexEnc);
00117               void PutDoc(QString c);
00118               void PutDoc(QByteArray& array, bool hexEnc);
00119               void PutDoc(const char* in, int length, bool hexEnc);
00120               QString ToStr(double c);
00121               QString IToStr(int c);
00122               QString PSEncode(QString in);
00123               QString Prolog;
00124               QString Header;
00125               QString Creator;
00126               QString User;
00127               QString Titel;
00128               QString BBox;
00129               QString BBoxH;
00130               QString Farben;
00131               QString FNamen;
00132               QString PDev;
00133               QString GrayCalc;
00134               bool GraySc;
00135               int Seiten;
00136               QString FillColor;
00137               QString StrokeColor;
00138               QString GrColor1;
00139               QString GrColor2;
00140               double LineW;
00141               QString Fonts;
00142               QString FontDesc;
00143               QMap<QString, QString> UsedFonts;
00144               typedef QMap<uint, std::pair<QChar, QString> > GListe;
00145               QMap<QString, GListe> GlyphsOfFont;
00146               bool isPDF;
00147               QFile Spool;
00148               QTextStream spoolStream;
00149               bool CompAvail;
00150               int Plate;
00151               bool DoSep;
00152               bool useSpotColors;
00153               bool fillRule;
00154               bool doOverprint;
00155               bool applyICC;
00156               cmsHTRANSFORM solidTransform;
00157               QString currentSpot;
00158               ColorList colorsToUse;
00159               QString colorDesc;
00160               ScribusDoc *m_Doc;
00161               QMap<QString, QString> spotMap;
00162               MultiProgressDialog* progressDialog;
00163               bool usingGUI;
00164               bool abortExport;
00165               PrintOptions Options;
00166               Page* ActPage;
00167 
00168        protected slots:
00169               void cancelRequested();
00170 };
00171 
00172 #endif