3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
9 #include <SupportDefs.h>
10 #include <GraphicsDefs.h>
17 #include "MarginView.h" // for MarginUnit
25 class DriverSpecificSettings
28 DriverSpecificSettings();
29 DriverSpecificSettings(const DriverSpecificSettings
& Settings
);
31 DriverSpecificSettings
&operator=(const DriverSpecificSettings
&Settings
);
35 bool HasString(const char* key
) const;
36 const char* GetString(const char* key
) const;
37 void SetString(const char* key
, const char* value
);
39 bool HasBoolean(const char* ekey
) const;
40 bool GetBoolean(const char* key
) const;
41 void SetBoolean(const char* key
, bool value
);
43 bool HasInt(const char* ekey
) const;
44 int32
GetInt(const char* key
) const;
45 void SetInt(const char* key
, int32 value
);
47 bool HasDouble(const char* ekey
) const;
48 double GetDouble(const char* key
) const;
49 void SetDouble(const char* key
, double value
);
66 kLetter
= 1, // 1 Letter 8 1/2 x 11 in
67 kLetterSmall
, // 2 Letter Small 8 1/2 x 11 in
68 kTabloid
, // 3 Tabloid 11 x 17 in
69 kLedger
, // 4 Ledger 17 x 11 in
70 kLegal
, // 5 Legal 8 1/2 x 14 in
71 kStatement
, // 6 Statement 5 1/2 x 8 1/2 in
72 kExecutive
, // 7 Executive 7 1/4 x 10 1/2 in
73 kA3
, // 8 A3 297 x 420 mm
74 kA4
, // 9 A4 210 x 297 mm
75 kA4Small
, // 10 A4 Small 210 x 297 mm
76 kA5
, // 11 A5 148 x 210 mm
77 kB4
, // 12 B4 (JIS) 250 x 354
78 kB5
, // 13 B5 (JIS) 182 x 257 mm
79 kFolio
, // 14 Folio 8 1/2 x 13 in
80 kQuarto
, // 15 Quarto 215 x 275 mm
81 k10X14
, // 16 10x14 in
82 k11X17
, // 17 11x17 in
83 kNote
, // 18 Note 8 1/2 x 11 in
84 kEnv9
, // 19 Envelope #9 3 7/8 x 8 7/8
85 kEnv10
, // 20 Envelope #10 4 1/8 x 9 1/2
86 kEnv11
, // 21 Envelope #11 4 1/2 x 10 3/8
87 kEnv12
, // 22 Envelope #12 4 \276 x 11
88 kEnv14
, // 23 Envelope #14 5 x 11 1/2
89 kCSheet
, // 24 C size sheet
90 kDSheet
, // 25 D size sheet
91 kESheet
, // 26 E size sheet
92 kEnvDL
, // 27 Envelope DL 110 x 220mm
93 kEnvC5
, // 28 Envelope C5 162 x 229 mm
94 kEnvC3
, // 29 Envelope C3 324 x 458 mm
95 kEnvC4
, // 30 Envelope C4 229 x 324 mm
96 kEnvC6
, // 31 Envelope C6 114 x 162 mm
97 kEnvC65
, // 32 Envelope C65 114 x 229 mm
98 kEnvB4
, // 33 Envelope B4 250 x 353 mm
99 kEnvB5
, // 34 Envelope B5 176 x 250 mm
100 kEnvB6
, // 35 Envelope B6 176 x 125 mm
101 kEnvItaly
, // 36 Envelope 110 x 230 mm
102 kEnvMonarch
, // 37 Envelope Monarch 3.875 x 7.5 in
103 kEnvPersonal
, // 38 6 3/4 Envelope 3 5/8 x 6 1/2 in
104 kFanFoldUS
, // 39 US Std Fanfold 14 7/8 x 11 in
105 kFanFoldStdGerman
, // 40 German Std Fanfold 8 1/2 x 12 in
106 kFanFoldLglGerman
, // 41 German Legal Fanfold 8 1/2 x 13 in
107 kIsoB4
, // 42 B4 (ISO) 250 x 353 mm
108 kJapanesePostcard
, // 43 Japanese Postcard 100 x 148 mm
109 k9X11
, // 44 9 x 11 in
110 k10X11
, // 45 10 x 11 in
111 k15X11
, // 46 15 x 11 in
112 kEnvInvite
, // 47 Envelope Invite 220 x 220 mm
113 kReserved48
, // 48 RESERVED--DO NOT USE
114 kReserved49
, // 49 RESERVED--DO NOT USE
115 kLetterExtra
, // 50 Letter Extra 9 \275 x 12 in
116 kLegalExtra
, // 51 Legal Extra 9 \275 x 15 in
117 kTabloidExtra
, // 52 Tabloid Extra 11.69 x 18 in
118 kA4Extra
, // 53 A4 Extra 9.27 x 12.69 in
119 kLetterTransverse
, // 54 Letter Transverse 8 \275 x 11 in
120 kA4Transverse
, // 55 A4 Transverse 210 x 297 mm
121 kLetterExtraTransverse
, // 56 Letter Extra Transverse 9\275 x 12 in
122 kAPlus
, // 57 SuperA/SuperA/A4 227 x 356 mm
123 kBPlus
, // 58 SuperB/SuperB/A3 305 x 487 mm
124 kLetterPlus
, // 59 Letter Plus 8.5 x 12.69 in
125 kA4Plus
, // 60 A4 Plus 210 x 330 mm
126 kA5Transverse
, // 61 A5 Transverse 148 x 210 mm
127 kB5Transverse
, // 62 B5 (JIS) Transverse 182 x 257 mm
128 kA3Extra
, // 63 A3 Extra 322 x 445 mm
129 kA5Extra
, // 64 A5 Extra 174 x 235 mm
130 kB5Extra
, // 65 B5 (ISO) Extra 201 x 276 mm
131 kA2
, // 66 A2 420 x 594 mm
132 kA3Transverse
, // 67 A3 Transverse 297 x 420 mm
133 kA3ExtraTransverse
, // 68 A3 Extra Transverse 322 x 445 mm
134 kDBLJapanesePostcard
, // 69 Japanese Double Postcard 200 x 148 mm
135 kA6
, // 70 A6 105 x 148 mm
136 kJEnvKaku2
, // 71 Japanese Envelope Kaku #2
137 kJEnvKaku3
, // 72 Japanese Envelope Kaku #3
138 kJEnvChou3
, // 73 Japanese Envelope Chou #3
139 kJEnvChou4
, // 74 Japanese Envelope Chou #4
140 kLetterRotated
, // 75 Letter Rotated 11 x 8 1/2 11 in
141 kA3Rotated
, // 76 A3 Rotated 420 x 297 mm
142 kA4Rotated
, // 77 A4 Rotated 297 x 210 mm
143 kA5Rotated
, // 78 A5 Rotated 210 x 148 mm
144 kB4JISRotated
, // 79 B4 (JIS) Rotated 364 x 257 mm
145 kB5JISRotated
, // 80 B5 (JIS) Rotated 257 x 182 mm
146 kJapanesePostcardRotated
, // 81 Japanese Postcard Rotated 148 x 100 mm
147 kDBLJapanesePostcardRotated
, // 82 Double Japanese Postcard Rotated 148 x 200 mm
148 kA6Rotated
, // 83 A6 Rotated 148 x 105 mm
149 kJEnvKaku2Rotated
, // 84 Japanese Envelope Kaku #2 Rotated
150 kJEnvKaku3Rotated
, // 85 Japanese Envelope Kaku #3 Rotated
151 kJEnvChou3Rotated
, // 86 Japanese Envelope Chou #3 Rotated
152 kJEnvChou4Rotated
, // 87 Japanese Envelope Chou #4 Rotated
153 kB6JIS
, // 88 B6 (JIS) 128 x 182 mm
154 kB6JISRotated
, // 89 B6 (JIS) Rotated 182 x 128 mm
155 k12X11
, // 90 12 x 11 in
156 kJEnvYou4
, // 91 Japanese Envelope You #4
157 kJEnvYou4Rotated
, // 92 Japanese Envelope You #4 Rotated
158 kP16K
, // 93 PRC 16K 146 x 215 mm
159 kP32K
, // 94 PRC 32K 97 x 151 mm
160 kP32KBig
, // 95 PRC 32K(Big) 97 x 151 mm
161 kPEnv1
, // 96 PRC Envelope #1 102 x 165 mm
162 kPEnv2
, // 97 PRC Envelope #2 102 x 176 mm
163 kPEnv3
, // 98 PRC Envelope #3 125 x 176 mm
164 kPEnv4
, // 99 PRC Envelope #4 110 x 208 mm
165 kPEnv5
, // 100 PRC Envelope #5 110 x 220 mm
166 kPEnv6
, // 101 PRC Envelope #6 120 x 230 mm
167 kPEnv7
, // 102 PRC Envelope #7 160 x 230 mm
168 kPEnv8
, // 103 PRC Envelope #8 120 x 309 mm
169 kPEnv9
, // 104 PRC Envelope #9 229 x 324 mm
170 kPEnv10
, // 105 PRC Envelope #10 324 x 458 mm
171 kP16KRotated
, // 106 PRC 16K Rotated
172 kP32KRotated
, // 107 PRC 32K Rotated
173 kP32KBIGRotated
, // 108 PRC 32K(Big) Rotated
174 kPEnv1Rotated
, // 109 PRC Envelope #1 Rotated 165 x 102 mm
175 kPEnv2Rotated
, // 110 PRC Envelope #2 Rotated 176 x 102 mm
176 kPEnv3Rotated
, // 111 PRC Envelope #3 Rotated 176 x 125 mm
177 kPEnv4Rotated
, // 112 PRC Envelope #4 Rotated 208 x 110 mm
178 kPEnv5Rotated
, // 113 PRC Envelope #5 Rotated 220 x 110 mm
179 kPEnv6Rotated
, // 114 PRC Envelope #6 Rotated 230 x 120 mm
180 kPEnv7Rotated
, // 115 PRC Envelope #7 Rotated 230 x 160 mm
181 kPEnv8Rotated
, // 116 PRC Envelope #8 Rotated 309 x 120 mm
182 kPEnv9Rotated
, // 117 PRC Envelope #9 Rotated 324 x 229 mm
183 kPEnv10Rotated
, // 118 PRC Envelope #10 Rotated 458 x 324 mm
195 // kEnvManual, // 6 x
198 // kLargeFmt, // 10 x
199 // kLargeCapacity, // 11 x
200 // kCassette, // 14 x
201 // kFormSource, // 15 x
211 kUser
= 256 // device specific bins start here
220 enum BindingLocation
{
225 kLongEdge
= kLongEdgeLeft
,
226 kShortEdge
= kShortEdgeTop
234 kLeftToRight
= kAcrossFromLeft
,
235 kRightToLeft
= kAcrossFromRight
249 // Some PCL6 printers do not support compressed data
251 kColorCompressionDisabled
265 JobData(BMessage
* message
, const PrinterCap
* printerCap
,
269 JobData(const JobData
& jobData
);
270 JobData
& operator=(const JobData
& jobData
);
272 void Load(BMessage
* message
, const PrinterCap
* printerCap
,
274 void Save(BMessage
* message
= NULL
);
276 bool GetShowPreview() const;
277 void SetShowPreview(bool showPreview
);
279 Paper
GetPaper() const;
280 void SetPaper(Paper paper
);
282 int32
GetResolutionID() const;
283 void SetResolutionID(int32 resolution
);
285 int32
GetXres() const;
286 void SetXres(int32 xres
);
288 int32
GetYres() const;
289 void SetYres(int32 yres
);
291 Orientation
GetOrientation() const;
292 void SetOrientation(Orientation orientation
);
294 float GetScaling() const;
295 void SetScaling(float scaling
);
297 const BRect
& GetPaperRect() const;
298 void SetPaperRect(const BRect
& paperRect
);
300 const BRect
& GetScaledPaperRect() const;
301 void SetScaledPaperRect(const BRect
& paperRect
);
303 const BRect
& GetPrintableRect() const;
304 void SetPrintableRect(const BRect
& printableRect
);
306 const BRect
& GetScaledPrintableRect() const;
307 void SetScaledPrintableRect(const BRect
& printableRect
);
309 const BRect
& GetPhysicalRect() const;
310 void SetPhysicalRect(const BRect
& PhysicalRect
);
312 const BRect
& GetScaledPhysicalRect() const;
313 void SetScaledPhysicalRect(const BRect
& PhysicalRect
);
315 int32
GetNup() const;
316 void SetNup(int32 nup
);
318 bool GetReverse() const;
319 void SetReverse(bool reverse
);
321 int32
GetFirstPage() const;
322 void SetFirstPage(int32 firstPage
);
324 int32
GetLastPage() const;
325 void SetLastPage(int32 lastPage
);
327 // libprint supports only B_RGB32
328 color_space
GetSurfaceType() const;
330 float GetGamma() const;
331 void SetGamma(float gamma
);
333 float GetInkDensity() const;
334 void SetInkDensity(float inkDensity
);
336 PaperSource
GetPaperSource() const;
337 void SetPaperSource(PaperSource paperSource
);
339 int32
GetCopies() const;
340 void SetCopies(int32 copies
);
342 bool GetCollate() const;
343 void SetCollate(bool collate
);
345 PrintStyle
GetPrintStyle() const;
346 void SetPrintStyle(PrintStyle printStyle
);
348 BindingLocation
GetBindingLocation() const;
349 void SetBindingLocation(BindingLocation bindingLocation
);
351 PageOrder
GetPageOrder() const;
352 void SetPageOrder(PageOrder pageOrder
);
354 Color
GetColor() const;
355 void SetColor(Color color
);
357 Halftone::DitherType
GetDitherType() const;
358 void SetDitherType(Halftone::DitherType ditherType
);
360 PageSelection
GetPageSelection() const;
361 void SetPageSelection(PageSelection pageSelection
);
363 MarginUnit
GetMarginUnit() const;
364 void SetMarginUnit(MarginUnit marginUnit
);
366 DriverSpecificSettings
& Settings();
367 const DriverSpecificSettings
& Settings() const;
375 Orientation fOrientation
;
378 BRect fScaledPaperRect
;
379 BRect fPrintableRect
;
380 BRect fScaledPrintableRect
;
382 BRect fScaledPhysicalRect
;
386 float fGamma
; // 1 identiy, < 1 brigther, > 1 darker
387 float fInkDensity
; // [0, 255] lower means higher density
388 PaperSource fPaperSource
;
392 PrintStyle fPrintStyle
;
393 BindingLocation fBindingLocation
;
394 PageOrder fPageOrder
;
395 SettingType fSettingType
;
398 Halftone::DitherType fDitherType
;
399 PageSelection fPageSelection
;
400 MarginUnit fMarginUnit
;
401 DriverSpecificSettings fDriverSpecificSettings
;
406 JobData::GetShowPreview() const
412 JobData::SetShowPreview(bool showPreview
)
414 fShowPreview
= showPreview
;
418 inline JobData::Paper
419 JobData::GetPaper() const
426 JobData::SetPaper(Paper paper
)
433 JobData::GetResolutionID() const
435 return fResolutionID
;
440 JobData::SetResolutionID(int32 resolution
)
442 fResolutionID
= resolution
;
447 JobData::GetXres() const
454 JobData::SetXres(int32 xres
)
461 JobData::GetYres() const
468 JobData::SetYres(int32 yres
)
474 inline JobData::Orientation
475 JobData::GetOrientation() const
482 JobData::SetOrientation(Orientation orientation
)
484 fOrientation
= orientation
;
489 JobData::GetScaling() const
496 JobData::SetScaling(float scaling
)
503 JobData::GetPaperRect() const
510 JobData::SetPaperRect(const BRect
&rect
)
517 JobData::GetScaledPaperRect() const
519 return fScaledPaperRect
;
524 JobData::SetScaledPaperRect(const BRect
&rect
)
526 fScaledPaperRect
= rect
;
531 JobData::GetPrintableRect() const
533 return fPrintableRect
;
538 JobData::SetPrintableRect(const BRect
&rect
)
540 fPrintableRect
= rect
;
545 JobData::GetScaledPrintableRect() const
547 return fScaledPrintableRect
;
552 JobData::SetScaledPrintableRect(const BRect
&rect
)
554 fScaledPrintableRect
= rect
;
559 JobData::GetPhysicalRect() const
561 return fPhysicalRect
;
566 JobData::SetPhysicalRect(const BRect
&rect
)
568 fPhysicalRect
= rect
;
573 JobData::GetScaledPhysicalRect() const
575 return fScaledPhysicalRect
;
581 JobData::SetScaledPhysicalRect(const BRect
&rect
)
583 fScaledPhysicalRect
= rect
;
588 JobData::GetNup() const
595 JobData::SetNup(int32 nup
)
602 JobData::GetReverse() const
609 JobData::SetReverse(bool reverse
)
616 JobData::GetFirstPage() const
623 JobData::SetFirstPage(int32 firstPage
)
625 fFirstPage
= firstPage
;
630 JobData::GetLastPage() const
637 JobData::SetLastPage(int32 lastPage
)
639 fLastPage
= lastPage
;
644 inline JobData::GetSurfaceType() const
651 JobData::GetGamma() const
658 JobData::SetGamma(float gamma
)
665 JobData::GetInkDensity() const
672 JobData::SetInkDensity(float inkDensity
)
674 fInkDensity
= inkDensity
;
678 inline JobData::PaperSource
679 JobData::GetPaperSource() const
686 JobData::SetPaperSource(PaperSource paperSource
)
688 fPaperSource
= paperSource
;
693 JobData::GetCopies() const
700 JobData::SetCopies(int32 copies
)
707 JobData::GetCollate() const
714 JobData::SetCollate(bool collate
)
720 inline JobData::PrintStyle
721 JobData::GetPrintStyle() const
728 JobData::SetPrintStyle(PrintStyle print_style
)
730 fPrintStyle
= print_style
;
734 inline JobData::BindingLocation
735 JobData::GetBindingLocation() const
737 return fBindingLocation
;
742 JobData::SetBindingLocation(BindingLocation binding_location
)
744 fBindingLocation
= binding_location
;
748 inline JobData::PageOrder
749 JobData::GetPageOrder() const { return fPageOrder
; }
753 JobData::SetPageOrder(PageOrder page_order
)
755 fPageOrder
= page_order
;
759 inline JobData::Color
760 JobData::GetColor() const
767 JobData::SetColor(Color color
)
773 inline Halftone::DitherType
774 JobData::GetDitherType() const
781 JobData::SetDitherType(Halftone::DitherType dither_type
)
783 fDitherType
= dither_type
;
787 inline JobData::PageSelection
788 JobData::GetPageSelection() const
790 return fPageSelection
;
795 JobData::SetPageSelection(PageSelection pageSelection
)
797 fPageSelection
= pageSelection
;
802 JobData::GetMarginUnit() const
809 JobData::SetMarginUnit(MarginUnit marginUnit
)
811 fMarginUnit
= marginUnit
;
814 #endif /* __JOBDATA_H */