Subversion Repositories Scribus

Rev

Rev 24719 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 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
*/
4360 cbradney 7
#ifndef SCPAGEOUTPUT_H
8
#define SCPAGEOUTPUT_H
9
 
10082 craig 10
#include <QRect>
11385 jghali 11
#include <QRectF>
10082 craig 12
 
4360 cbradney 13
#include "scribusapi.h"
24723 craig 14
#include "scribusstructs.h"
4360 cbradney 15
#include "sccolor.h"
24723 craig 16
#include "scimage.h"
4360 cbradney 17
#include "scpainterexbase.h"
18
 
10601 mrdocs 19
class CharStyle;
10605 jghali 20
struct GlyphLayout;
16729 fschmid 21
class ScPage;
4360 cbradney 22
class PageItem;
17296 jghali 23
class PageItem_Arc;
17289 fschmid 24
class PageItem_Group;
4360 cbradney 25
class PageItem_ImageFrame;
26
class PageItem_Line;
27
class PageItem_PathText;
28
class PageItem_Polygon;
29
class PageItem_PolyLine;
17296 jghali 30
class PageItem_Spiral;
17328 jghali 31
class PageItem_RegularPolygon;
20630 jghali 32
class PageItem_Table;
4360 cbradney 33
class PageItem_TextFrame;
13873 jghali 34
class ScLayer;
35
class ScribusDoc;
4360 cbradney 36
 
7108 jghali 37
class SCRIBUS_API MarksOptions
38
{
39
public:
24719 jghali 40
        MarksOptions(void) = default;
41
        MarksOptions(const PrintOptions& opt);
42
 
43
        double markLength { 20.0 };
44
        double markOffset { 0.0 };
45
        double bleedTop { 0.0 };
46
        double bleedLeft { 0.0 };
47
        double bleedRight { 0.0 };
48
        double bleedBottom { 0.0 };
49
        bool   cropMarks { false };
50
        bool   bleedMarks { false };
51
        bool   registrationMarks { false };
52
        bool   colorMarks { false };
53
        bool   docInfoMarks { false };
7108 jghali 54
};
55
 
4360 cbradney 56
class SCRIBUS_API ScPageOutput
57
{
21112 jghali 58
        friend class ScPageOutputPainter;
21107 craig 59
 
20630 jghali 60
public:
61
        ScPageOutput(ScribusDoc* doc, bool reloadImages = false, int resolution = 72, bool useProfiles = false);
62
        virtual ~ScPageOutput() { }
63
 
64
        virtual void begin(void) {};
65
        virtual void drawPage( ScPage* page ) {};
66
        virtual void drawPage( ScPage* page, ScPainterExBase* painter);
67
        virtual void end(void) {};
68
 
69
        void setMarksOptions(const MarksOptions& opt) { m_marksOptions = opt; }
70
 
4360 cbradney 71
protected:
24719 jghali 72
        ScribusDoc* m_doc { nullptr };
4360 cbradney 73
 
24719 jghali 74
        bool m_reloadImages { true };
75
        int  m_imageRes { 72 };
76
        bool m_useProfiles { false };
7108 jghali 77
        MarksOptions m_marksOptions;
4360 cbradney 78
 
20630 jghali 79
        virtual void fillPath( PageItem* item, ScPainterExBase* painter, QRect clip );
80
        virtual void strokePath( PageItem* item, ScPainterExBase* painter, QRect clip );
4360 cbradney 81
 
20630 jghali 82
        virtual void drawMasterItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip);
83
        virtual void drawPageItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip);
6987 jghali 84
 
20630 jghali 85
        virtual void drawItem( PageItem* item, ScPainterExBase* painter, QRect clip );
11905 jghali 86
        virtual void drawItem_Pre( PageItem* item, ScPainterExBase* painter );
87
        virtual void drawItem_Post( PageItem* item, ScPainterExBase* painter );
4360 cbradney 88
 
20630 jghali 89
        virtual void drawItem_Embedded( PageItem* item, ScPainterExBase *p, QRect clip, const CharStyle& style, PageItem* cembedded);
90
        virtual void drawPattern(PageItem* item, ScPainterExBase* painter, QRect clip);
17263 jghali 91
        virtual void drawStrokePattern(PageItem* item, ScPainterExBase* painter, const QPainterPath& path);
4360 cbradney 92
 
20630 jghali 93
        virtual void drawItem_Arc( PageItem_Arc* item, ScPainterExBase* painter, QRect clip );
94
        virtual void drawItem_Group( PageItem_Group* item, ScPainterExBase* painter, QRect clip );
95
        virtual void drawItem_ImageFrame( PageItem_ImageFrame* item, ScPainterExBase* painter, QRect clip );
96
        virtual void drawItem_Line( PageItem_Line* item, ScPainterExBase* painter, QRect clip);
97
        virtual void drawItem_Polygon ( PageItem_Polygon* item , ScPainterExBase* painter, QRect clip );
98
        virtual void drawItem_PolyLine( PageItem_PolyLine* item, ScPainterExBase* painte, QRect clip );
99
        virtual void drawItem_RegularPolygon( PageItem_RegularPolygon* item, ScPainterExBase* painte, QRect clip );
100
        virtual void drawItem_Spiral( PageItem_Spiral* item, ScPainterExBase* painter, QRect clip );
101
        virtual void drawItem_Table( PageItem_Table* item, ScPainterExBase* painter, QRect clip );
21563 jghali 102
        virtual void drawItem_Text( PageItem* item, ScPainterExBase* painter, QRect clip );
4360 cbradney 103
 
13951 fschmid 104
        virtual void drawArrow(ScPainterExBase* painter, PageItem* item, QTransform &arrowTrans, int arrowIndex);
16729 fschmid 105
        virtual void drawMarks( ScPage* page, ScPainterExBase* painter, const MarksOptions& options );
17401 jghali 106
        virtual void drawBoxMarks( ScPainterExBase* painter, const QRectF& box, const QRectF& bleedBox, double offset , double markSize);
11905 jghali 107
        virtual void drawRegistrationCross( ScPainterExBase* painter );
7108 jghali 108
 
24719 jghali 109
        ScImage::RequestType translateImageModeToRequest( ScPainterExBase::ImageMode mode) const;
5345 mrdocs 110
 
20630 jghali 111
        friend class CollapsedTablePainterEx;
4360 cbradney 112
};
113
 
114
#endif