Tizen 2.1 base
[platform/upstream/hplip.git] / prnt / hpijs / quickconnect.h
1 /*****************************************************************************\\r
2   quickconnect.h : Interface for the QuickConnect class\r
3 \r
4   Copyright (c) 2008, Hewlett-Packard Co.\r
5   All rights reserved.\r
6 \r
7   Redistribution and use in source and binary forms, with or without\r
8   modification, are permitted provided that the following conditions\r
9   are met:\r
10   1. Redistributions of source code must retain the above copyright\r
11      notice, this list of conditions and the following disclaimer.\r
12   2. Redistributions in binary form must reproduce the above copyright\r
13      notice, this list of conditions and the following disclaimer in the\r
14      documentation and/or other materials provided with the distribution.\r
15   3. Neither the name of Hewlett-Packard nor the names of its\r
16      contributors may be used to endorse or promote products derived\r
17      from this software without specific prior written permission.\r
18 \r
19   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED\r
20   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
21   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN\r
22   NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
23   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\r
24   TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\r
25   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\r
26   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
27   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
28   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
29 \*****************************************************************************/\r
30 \r
31 \r
32 #ifndef APDK_QUICKCONNECT_H\r
33 #define APDK_QUICKCONNECT_H\r
34 \r
35 extern "C"\r
36 {\r
37 #include "jpeglib.h"\r
38 }\r
39 \r
40 APDK_BEGIN_NAMESPACE\r
41 \r
42 /*!\r
43 \internal\r
44 */\r
45 class QuickConnect : public Printer\r
46 {\r
47 public:\r
48     QuickConnect (SystemServices* pSS, BOOL proto=FALSE);\r
49     ~QuickConnect ();\r
50 \r
51     Header *SelectHeader (PrintContext* pc);\r
52     DRIVER_ERROR VerifyPenInfo ();\r
53     DRIVER_ERROR ParsePenInfo (PEN_TYPE& ePen, BOOL QueryPrinter=TRUE);\r
54         inline virtual BOOL SupportSeparateBlack (PrintMode *pCurrentMode)\r
55     {\r
56         return FALSE;\r
57     }\r
58 \r
59     virtual BOOL GetMargins (PAPER_SIZE ps, float *fMargins)\r
60     {\r
61         fMargins[0] = (float) 0.0;\r
62         fMargins[1] = (float) 0.0;\r
63         fMargins[2] = (float) 0.0;\r
64         fMargins[3] = (float) 0.0;\r
65         return TRUE;\r
66     }\r
67     virtual BOOL FullBleedCapable (PAPER_SIZE ps, FullbleedType  *fbType,\r
68                                    float *xOverSpray, float *yOverSpray,\r
69                                    float *fLeftOverSpray, float *fTopOverSpray)\r
70     {\r
71         *xOverSpray = (float) 0.0;\r
72         *yOverSpray = (float) 0.0;\r
73         if (fLeftOverSpray)\r
74             *fLeftOverSpray = (float) 0.0;\r
75         if (fTopOverSpray)\r
76             *fTopOverSpray = (float) 0.0;\r
77         *fbType = fullbleed4EdgeAllMedia;\r
78         return TRUE;\r
79     }\r
80 \r
81     virtual DRIVER_ERROR    SetHint (PRINTER_HINT eHint, int iValue);\r
82     void    JpegData (BYTE *buffer, int size);\r
83     DRIVER_ERROR Encapsulate (const RASTERDATA *InputRaster, BOOL bLastPlane);\r
84     DRIVER_ERROR Flush (int iBufferSize);\r
85     PAPER_SIZE MandatoryPaperSize ()\r
86     {\r
87         return PHOTO_5x7;\r
88     }\r
89 \r
90 protected:\r
91 \r
92 #ifdef APDK_HP_UX\r
93     virtual QuickConnect & operator = (Printer& rhs)\r
94     {\r
95         return *this;\r
96     }\r
97 #endif\r
98 \r
99 private:\r
100     int     MapPaperSize (PAPER_SIZE ePaperSize);\r
101     int     MapMediaType (MEDIATYPE eMediaType);\r
102     int     MapQualityMode (QUALITY_MODE eQualityMode);\r
103     DRIVER_ERROR    AddExifHeader ();\r
104     DRIVER_ERROR    Compress ();\r
105     PrintContext    *m_pPC;\r
106 \r
107     int     m_iPhotoFix;\r
108     int     m_iRemoveRedEye;\r
109     int     m_iBorderless;\r
110     int     m_iMaxFileSize;\r
111 \r
112     int     m_iRowNumber;\r
113     int     m_iRowWidth;\r
114     int     m_iJobId;\r
115     int     m_iJpegBufferPos;\r
116     int     m_iJpegBufferSize;\r
117     int     m_iInputBufferSize;\r
118     BYTE    *m_pbyInputBuffer;\r
119     BYTE    *m_pbyJpegBuffer;\r
120 }; // QuickConnect\r
121 \r
122 \r
123 class QCAutomatic : public PrintMode\r
124 {\r
125 public:\r
126     QCAutomatic ();\r
127     inline BOOL MediaCompatible (MEDIATYPE eMedia)\r
128     {\r
129         return TRUE;\r
130     }\r
131 }; // QCAutomatic\r
132 \r
133 \r
134 class QCFastNormal : public PrintMode\r
135 {\r
136 public:\r
137     QCFastNormal ();\r
138     inline BOOL MediaCompatible (MEDIATYPE eMedia)\r
139     {\r
140         return TRUE;\r
141     }\r
142 \r
143 }; // QCFastNormal\r
144 \r
145 class QCNormal : public PrintMode\r
146 {\r
147 public:\r
148     QCNormal ();\r
149     inline BOOL MediaCompatible (MEDIATYPE eMedia)\r
150     {\r
151         return TRUE;\r
152     }\r
153 \r
154 }; // QCNormal\r
155 \r
156 class QCBest : public PrintMode\r
157 {\r
158 public:\r
159     QCBest ();\r
160     inline BOOL MediaCompatible (MEDIATYPE eMedia)\r
161     {\r
162         return TRUE;\r
163     }\r
164 \r
165 }; // QCBest\r
166 \r
167 #ifdef APDK_QUICKCONNECT\r
168 //! QuickConnectProxy\r
169 /*!\r
170 ******************************************************************************/\r
171 class QuickConnectProxy : public PrinterProxy\r
172 {\r
173 public:\r
174     QuickConnectProxy() : PrinterProxy (\r
175         "QuickConnect",                     // family name\r
176         "Photosmart A530\0"\r
177         "Photosmart A630\0"\r
178         "Photosmart A640\0"\r
179     ) {m_iPrinterType = eQuickConnect;}\r
180     inline Printer* CreatePrinter (SystemServices *pSS) const { return new QuickConnect (pSS); }\r
181         inline PRINTER_TYPE GetPrinterType () const { return eQuickConnect;}\r
182         inline unsigned int GetModelBit() const { return 0x10000;}\r
183 };\r
184 #endif\r
185 \r
186 APDK_END_NAMESPACE\r
187 \r
188 #endif //APDK_QUICKCONNECT_H\r