30 #include <QDataStream>
36 #include "scribusapi.h"
37 #include "scribusstructs.h"
38 #include "colormgmt/sccolormgmtengine.h"
39 #include "tableborder.h"
45 class MultiProgressDialog;
54 class SCRIBUS_API
PSLib :
public QObject
65 PSLib(
PrintOptions &options,
bool psart,
SCFonts &AllFonts, QMap<QString, QMap<uint, FPointArray> > DocFonts,
ColorList DocColors,
bool pdf =
false,
bool spot =
true);
68 void setOptimization (Optimization opt) { optimization = opt; }
71 virtual const QString& errorMessage(
void);
73 virtual void PS_Error(
const QString& message);
74 virtual void PS_Error_ImageDataWriteFailure(
void);
75 virtual void PS_Error_ImageLoadFailure(
const QString& fileName);
76 virtual void PS_Error_MaskLoadFailure(
const QString& fileName);
77 virtual void PS_Error_InsufficientMemory(
void);
79 virtual bool PS_set_file(QString fn);
80 virtual void PS_set_Info(QString art, QString was);
81 virtual bool PS_begin_doc(
ScribusDoc *doc,
double x,
double y,
double width,
double height,
int numpage,
bool doDev,
bool sep,
bool farb);
83 virtual void PS_end_page();
84 virtual void PS_curve(
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
85 virtual void PS_moveto(
double x,
double y);
86 virtual void PS_lineto(
double x,
double y);
87 virtual void PS_closepath();
88 virtual void PS_translate(
double x,
double y);
89 virtual void PS_scale(
double x,
double y);
90 virtual void PS_rotate(
double x);
91 virtual void PS_clip(
bool mu);
92 virtual void PS_save();
93 virtual void PS_restore();
94 virtual void PS_setcmykcolor_fill(
double c,
double m,
double y,
double k);
95 virtual void PS_setcmykcolor_dummy();
96 virtual void PS_setcmykcolor_stroke(
double c,
double m,
double y,
double k);
97 virtual void PS_setlinewidth(
double w);
98 virtual void PS_setcapjoin(Qt::PenCapStyle ca, Qt::PenJoinStyle jo);
99 virtual void PS_setdash(Qt::PenStyle st,
double offset, QVector<double> dash);
100 virtual void PS_selectfont(QString f,
double s);
101 virtual void PS_fill();
102 virtual void PS_fillspot(QString color,
double shade);
103 virtual void PS_stroke();
104 virtual void PS_strokespot(QString color,
double shade);
105 virtual void PS_fill_stroke();
106 virtual void PS_newpath();
107 virtual void PS_show(
double x,
double y);
108 virtual void PS_showSub(uint chr, QString font,
double size,
bool stroke);
109 virtual void PS_show_xyG(QString font, uint gl,
double x,
double y, QString colorName,
double shade);
110 virtual bool PS_image(
PageItem *c,
double x,
double y, QString fn,
double scalex,
double scaley, QString Prof,
bool UseEmbedded, QString Name =
"");
111 virtual bool PS_ImageData(
PageItem *c, QString fn, QString Name, QString Prof,
bool UseEmbedded);
112 virtual void PS_plate(
int nr, QString name =
"");
113 virtual void PS_setGray();
114 virtual void PDF_Bookmark(QString text, uint Seite);
115 virtual void PDF_Annotation(
PageItem *item, QString text,
double x,
double y,
double b,
double h);
116 virtual void PS_close();
117 virtual void PS_insert(QString i);
118 virtual void PS_TemplateStart(QString Name);
119 virtual void PS_TemplateEnd();
120 virtual void PS_UseTemplate(QString Name);
121 virtual bool ProcessItem(
ScribusDoc* Doc,
ScPage* a,
PageItem* c, uint PNr,
bool sep,
bool farb,
bool master,
bool embedded =
false,
bool useTemplate =
false);
122 virtual void ProcessPage(
ScribusDoc* Doc,
ScPage* a, uint PNr,
bool sep =
false,
bool farb =
true);
123 virtual bool ProcessMasterPageLayer(
ScribusDoc* Doc,
ScPage* a,
ScLayer& ll, uint PNr,
bool sep =
false,
bool farb =
true);
124 virtual bool ProcessPageLayer(
ScribusDoc* Doc,
ScPage* a,
ScLayer& ll, uint PNr,
bool sep =
false,
bool farb =
true);
125 virtual void PS_HatchFill(
PageItem *currItem);
126 virtual void drawArrow(
PageItem *ite, QTransform &arrowTrans,
int arrowIndex);
127 virtual void putColor(
const QString& color,
double shade,
bool fill);
128 virtual void putColorNoDraw(
const QString& color,
double shade);
129 virtual void GetBleeds(
ScPage* page,
double& left,
double& right);
130 virtual void GetBleeds(
ScPage* page,
double& left,
double& right,
double& bottom,
double& top);
131 virtual void SetClipPath(
FPointArray *c,
bool poly =
true);
132 virtual void SetPathAndClip(
FPointArray &c,
bool clipRule);
133 virtual void HandleBrushPattern(
PageItem *c, QPainterPath &path,
ScPage* a, uint PNr,
bool sep,
bool farb,
bool master);
134 virtual void HandleStrokePattern(
PageItem *c);
135 virtual void HandleMeshGradient(
PageItem* c);
136 virtual void HandlePatchMeshGradient(
PageItem* c);
137 virtual void HandleDiamondGradient(
PageItem* c);
138 virtual void HandleTensorGradient(
PageItem* c);
139 virtual void HandleGradientFillStroke(
PageItem *c,
bool stroke =
true,
bool forArrow =
false);
140 virtual void SetColor(
const QString& color,
double shade,
int *h,
int *s,
int *v,
int *k);
141 virtual void SetColor(
const ScColor& color,
double shade,
int *h,
int *s,
int *v,
int *k);
143 virtual void setTextCh(
ScribusDoc* Doc,
PageItem* ite,
double x,
double y, uint a, uint d, QChar chstr,
const GlyphLayout* glyphs,
const CharStyle& cstyle,
const ParagraphStyle& pstyle,
ScPage* pg,
bool sep,
bool farb,
bool master);
148 void PutStream (
const QString& c);
149 void PutStream (
const QByteArray& array,
bool hexEnc);
150 void PutStream (
const char* in,
int length,
bool hexEnc);
152 bool PutImageToStream(
ScImage& image,
int plate);
153 bool PutImageToStream(
ScImage& image,
const QByteArray& mask,
int plate);
155 bool PutImageDataToStream(
const QByteArray& image);
156 bool PutInterleavedImageMaskToStream(
const QByteArray& image,
const QByteArray& mask,
bool gray);
158 void WriteASCII85Bytes(
const QByteArray& array);
159 void WriteASCII85Bytes(
const unsigned char* array,
int length);
161 void paintBorder(
const TableBorder& border,
const QPointF& start,
const QPointF& end,
const QPointF& startOffsetFactors,
const QPointF& endOffsetFactors);
163 Optimization optimization;
165 QString ToStr(
double c);
166 QString IToStr(
int c);
167 QString MatrixToStr(
double m11,
double m12,
double m21,
double m22,
double x,
double y);
168 QString PSEncode(QString in);
169 QString ErrorMessage;
188 QMap<QString, QString> UsedFonts;
189 QMap<QString, QString> FontSubsetMap;
190 QMap<QString, ScFace::FaceEncoding> GlyphsOfFont;
193 QDataStream spoolStream;
203 QMap<QString, QString> spotMap;
204 MultiProgressDialog* progressDialog;
211 void cancelRequested();
Definition: charstyle.h:78
Pagemargins and bleeds.
Definition: margins.h:25
Definition: tableborder.h:86
Definition: paragraphstyle.h:27
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
Definition: scribusstructs.h:213
Definition: pageitem.h:92
Definition: fpointarray.h:42
Definition: sctextstruct.h:54
Main class SCFonts. Subclass of QDict. This class replaces the previous SCFonts typedef...
Definition: scfonts.h:36