root/trunk/src/JobPrint.h

Revision 233, 3.8 kB (checked in by jordi, 2 years ago)

The JobPrint? now implements the new Resolution and ColorMode?.

Line 
1// ePDFView - A lightweight PDF Viewer.
2// Copyright (C) 2006 Emma's Software.
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18#if !defined (__JOB_PRINT_H__)
19#define __JOB_PRINT_H__
20
21namespace ePDFView
22{
23    ///
24    /// @enum PrintPageLayout
25    ///
26    enum PrintPageLayout
27    {
28        PRINT_PAGE_LAYOUT_PLAIN,
29        PRINT_PAGE_LAYOUT_2IN1,
30        PRINT_PAGE_LAYOUT_4IN1
31    };
32
33    ///
34    /// @enum PrintPageOrientation.
35    ///
36    enum PrintPageOrientation
37    {
38        PRINT_PAGE_ORIENTATION_PORTRAIT,
39        PRINT_PAGE_ORIENTATION_LANDSCAPE
40    };
41
42    ///
43    /// @enum PrintPageSet
44    ///
45    enum PrintPageSet
46    {
47        PRINT_ALL_PAGE_SET,
48        PRINT_EVEN_PAGE_SET,
49        PRINT_ODD_PAGE_SET
50    };
51
52    ///
53    /// @class JobPrint
54    /// @brief A background job that prints the document.
55    ///
56    /// This class converts the document to postscript and then
57    /// uses CUPS to print the converted document.
58    ///
59    class JobPrint: public IJob
60    {
61        public:
62            JobPrint (void);
63            ~JobPrint (void);
64
65            gboolean getCollate (void);
66            const gchar *getColorModel (void);
67            IDocument &getDocument (void);
68            guint getNumberOfCopies (void);
69            PrintPageLayout getPageLayout (void);
70            PrintPageOrientation getPageOrientation (void);
71            const gchar *getPrinterName (void);
72            const gchar *getResolution (void);
73            const gchar *getTempFileName (void);
74            virtual gboolean run (void);
75            void setCollate (gboolean collate);
76            void setColorModel (const gchar *colorModel);
77            void setDocument (IDocument *document);
78            void setNumberOfCopies (guint copies);
79            void setPageLayout (PrintPageLayout layout);
80            void setPageOrientation (PrintPageOrientation orientation);
81            void setPageRange (const gchar *range);
82            void setPageSet (PrintPageSet set);
83            void setPageSize (gfloat pageWidth, gfloat pageHeight);
84            void setPrinterName (const gchar *name);
85            void setResolution (const gchar *resolution);
86            void setUpPrint (void);
87
88        protected:
89            gboolean m_Collate;
90            gchar *m_ColorModel;
91            guint m_CurrentPage;
92            IDocument *m_Document;
93            IDocument *m_DocumentCopy;
94            guint m_NumberOfCopies;
95            gfloat m_PageHeight;
96            PrintPageLayout m_PageLayout;
97            PrintPageOrientation m_PageOrientation;
98            gboolean *m_PageRange;
99            gchar *m_PageRangeString;
100            PrintPageSet m_PageSet;
101            gchar *m_Resolution;
102            gfloat m_PageWidth;
103            gchar *m_PrinterName;
104            gchar *m_TempFileName;
105
106            guint getCurrentPage (void);
107            gfloat getPageHeight (void);
108            const gchar *getPageRangeString (void);
109            PrintPageSet getPageSet (void);
110            gfloat getPageWidth (void);
111            void setCurrentPage (guint pageNumber);
112            void setTempFileName (const gchar *fileName);
113            guint setUpPageRange (void);
114    };
115}
116
117#endif // __JOB_PRINT_H__
Note: See TracBrowser for help on using the browser.