Tizen 2.1 base
[platform/upstream/hplip.git] / prnt / hpijs / job.h
1 /*****************************************************************************\
2   job.h : Interface/Implimentation for the Job class
3
4   Copyright (c) 1996 - 2001, Hewlett-Packard Co.
5   All rights reserved.
6
7   Redistribution and use in source and binary forms, with or without
8   modification, are permitted provided that the following conditions
9   are met:
10   1. Redistributions of source code must retain the above copyright
11      notice, this list of conditions and the following disclaimer.
12   2. Redistributions in binary form must reproduce the above copyright
13      notice, this list of conditions and the following disclaimer in the
14      documentation and/or other materials provided with the distribution.
15   3. Neither the name of Hewlett-Packard nor the names of its
16      contributors may be used to endorse or promote products derived
17      from this software without specific prior written permission.
18
19   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
22   NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24   TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \*****************************************************************************/
30
31
32 #ifndef APDK_JOB_H
33 #define APDK_JOB_H
34
35 APDK_BEGIN_NAMESPACE
36
37 #if defined(APDK_VIP_COLORFILTERING)
38 class TErnieFilter;
39 #endif
40
41 class RasterSender;
42 class Header;
43 class TextTranslator;
44 class TextManager;
45 class Halftoner;
46 class ColorMatcher;
47 class Scaler;
48
49
50 //Job
51 //! Manages processes to create output for the device
52 /*! \class Job job.h "hpprintapi.h"
53 This object receives processes and transmits data to be printed by one device
54 on successive pages. The PrintContext and Job together form the core of the
55 driver proper.
56
57 \sa PrintContext
58 ******************************************************************************/
59 class Job
60 {
61 friend class RasterSender;
62
63 public:
64     Job(PrintContext* pPC);
65
66     virtual ~Job();
67
68     DRIVER_ERROR constructor_error;     // caller must check upon return
69
70     DRIVER_ERROR SendRasters(BYTE* ImageData=(BYTE*)NULL);
71
72         DRIVER_ERROR SendRasters(BYTE* BlackImageData, BYTE* ColorImageData);
73
74         DRIVER_ERROR SupportSeparateBlack(BOOL* bSeparateBlack);
75
76 #if defined(APDK_FONTS_NEEDED)
77     DRIVER_ERROR TextOut(const char* pTextString, unsigned int iLenString,
78                             const Font& font, int iAbsX, int iAbsY );
79     // return theTextManager->TextOut(pTextString,iLenString,font,iAbsX,iAbsY);
80 #endif
81 \r
82     DRIVER_ERROR Flush();
83     DRIVER_ERROR NewPage();
84
85 private:
86
87     PrintContext* thePrintContext;
88     SystemServices* pSS;
89     Printer* thePrinter;
90     Pipeline* thePipeline;
91     TextTranslator* pText;
92     RasterSender* pSender;
93     Halftoner* pHalftoner;
94     ColorMatcher* pColorMatcher;
95     Scaler* pResSynth;
96         Scaler* pBlackPlaneReplicator;
97     Scaler* pReplicator;
98     Compressor* theCompressor;
99         Compressor* pBlackPlaneCompressor;
100     Header* pHead;
101 #if defined(APDK_VIP_COLORFILTERING)
102     TErnieFilter* pErnie;
103 #endif
104
105 #if defined(APDK_FONTS_NEEDED)
106     TextManager* theTextManager;
107 #endif
108
109     PrintMode* CurrentMode;
110
111     unsigned int fcount;
112     unsigned int skipcount;
113     unsigned int RowsInput;
114     BYTE* BlankRaster;
115         BYTE* BlackRaster;
116
117     unsigned int CAPy;          // maintains cursor-pos for graphics purposes,
118                         // independent of intervening text positioning
119     BOOL DataSent;
120
121     unsigned int ResBoost;                  // for horizontal expansion
122     unsigned int numrows[MAXCOLORPLANES];   // rows per call for mixed-res only
123     unsigned int OutputWidth;
124     unsigned int InputWidth;
125     unsigned int ScaleFactor;
126
127     DRIVER_ERROR Configure();
128     DRIVER_ERROR InitScaler();
129
130     DRIVER_ERROR newpage();
131     DRIVER_ERROR SetupHalftoning(HALFTONING_ALGORITHM eHT);
132     DRIVER_ERROR SetupColorMatching();
133     DRIVER_ERROR SendCAPy();
134     DRIVER_ERROR sendrasters(BYTE* BlackImageData=(BYTE*)NULL, BYTE* ColorImageData=(BYTE*)NULL);
135     DRIVER_ERROR setblankraster();
136         DRIVER_ERROR setblackraster();
137     void SetOutputWidth();
138
139 #ifdef APDK_CAPTURE
140     void Capture_Job(PrintContext* pPC);
141     void Capture_dJob();
142     void Capture_SendRasters(BYTE* BlackImageData, BYTE* ColorImageData);
143 #if defined(APDK_FONTS_NEEDED)
144     void Capture_TextOut(const char* pTextString, unsigned int iLenString,
145          const Font& font, unsigned int iAbsX, unsigned int iAbsY );
146 #endif
147     void Capture_NewPage();
148 #endif
149
150 #ifdef APDK_USAGE_LOG
151     int UTextCount;
152     int UText;
153 #define UTextSize 100
154     char UHeader[UTextSize*2];
155 #endif
156
157 }; //Job
158
159 APDK_END_NAMESPACE
160
161 #endif //APDK_JOB_H