29
|
1 |
/*
|
|
2 |
* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: This class defines the dps definations.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef DPSDEFS_H
|
|
20 |
#define DPSDEFS_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
const TInt KMaxArgLen = 256;
|
|
25 |
const TInt KDateLen = 32;
|
|
26 |
|
|
27 |
// special element which has sub-elements, only startJob and
|
|
28 |
// getCapability have this field
|
|
29 |
enum TDpsElement
|
|
30 |
{
|
|
31 |
EDpsEleEmpty = 0,
|
|
32 |
EDpsCapability,
|
|
33 |
EDpsJobConfig,
|
|
34 |
EDpsPrintInfo,
|
|
35 |
KDpsEleMax
|
|
36 |
};
|
|
37 |
|
|
38 |
enum TDpsEvent
|
|
39 |
{
|
|
40 |
EDpsEvtEmpty = 0,
|
|
41 |
EDpsEvtNotifyJobStatus,
|
|
42 |
EDpsEvtNotifyDeviceStatus,
|
|
43 |
KDpsEvtMax
|
|
44 |
};
|
|
45 |
|
|
46 |
enum TDpsArgument
|
|
47 |
{
|
|
48 |
EDpsArgDpsVersions = 0,
|
|
49 |
EDpsArgVendorName,
|
|
50 |
EDpsArgVendorSpecificVersion,
|
|
51 |
EDpsArgProductName,
|
|
52 |
EDpsArgSerialNo,
|
|
53 |
EDpsArgPrintServiceAvailable,
|
|
54 |
EDpsArgQualities,
|
|
55 |
EDpsArgPaperSizes,
|
|
56 |
EDpsArgPaperTypes,
|
|
57 |
EDpsArgFileTypes,
|
|
58 |
EDpsArgDatePrints,
|
|
59 |
EDpsArgFileNamePrints,
|
|
60 |
EDpsArgImageOptimizes,
|
|
61 |
EDpsArgLayouts,
|
|
62 |
EDpsArgFixedSizes,
|
|
63 |
EDpsArgChroppings,
|
|
64 |
EDpsArgPrtPID,
|
|
65 |
EDpsArgFilePath,
|
|
66 |
EDpsArgCopyID,
|
|
67 |
EDpsArgProgress,
|
|
68 |
EDpsArgImagePrinted,
|
|
69 |
EDpsArgDpsPrintServiceStatus,
|
|
70 |
EDpsArgJobEndReason,
|
|
71 |
EDpsArgErrorStatus,
|
|
72 |
EDpsArgErrorReason,
|
|
73 |
EDpsArgDisconnectEnable,
|
|
74 |
EDpsArgCapabilityChanged,
|
|
75 |
EDpsArgNewJobOk,
|
|
76 |
EDpsArgQuality,
|
|
77 |
EDpsArgPaperSize,
|
|
78 |
EDpsArgPaperType,
|
|
79 |
EDpsArgFileType,
|
|
80 |
EDpsArgDatePrint,
|
|
81 |
EDpsArgFileNamePrint,
|
|
82 |
EDpsArgImageOptimize,
|
|
83 |
EDpsArgLayout,
|
|
84 |
EDpsArgFixedSize,
|
|
85 |
EDpsArgCropping,
|
|
86 |
EDpsArgCroppingArea,
|
|
87 |
EDpsArgFileID,
|
|
88 |
EDpsArgFileName,
|
|
89 |
EDpsArgDate,
|
|
90 |
EDpsArgCopies,
|
|
91 |
EDpsArgAbortStyle,
|
|
92 |
EDpsArgImagesPrinted,
|
|
93 |
EDpsArgBasePathID,
|
|
94 |
EDpsArgFileSize,
|
|
95 |
EDpsArgThumbFormat,
|
|
96 |
EDpsArgThumbSize,
|
|
97 |
EDpsArgBytesRead,
|
|
98 |
EDpsArgOffset,
|
|
99 |
EDpsArgMaxSize,
|
|
100 |
EDpsArgParentFileID,
|
|
101 |
EDpsArgMaxNumIDs,
|
|
102 |
EDpsArgFileIDs,
|
|
103 |
EDpsArgNumIDs,
|
|
104 |
EDpsArgMax
|
|
105 |
};
|
|
106 |
|
|
107 |
// define the DPS action result
|
|
108 |
// ref: DPS spec page 52
|
|
109 |
// high bits
|
|
110 |
enum TDpsResultMajorCode
|
|
111 |
{
|
|
112 |
EDpsResultOk = 0x1000,
|
|
113 |
EDpsResultNotExecuted = 0x1001,
|
|
114 |
EDpsResultNotSupported = 0x1002,
|
|
115 |
EDpsResultNotRecognized = 0x1003
|
|
116 |
};
|
|
117 |
|
|
118 |
// define the DPS action result minor code
|
|
119 |
// ref: DPS spec page 52
|
|
120 |
// low bits
|
|
121 |
enum TDpsResultMinorCode
|
|
122 |
{
|
|
123 |
EDpsResultNone = 0x0000,
|
|
124 |
EDpsResultUnrecognizedParam = 0x0001,
|
|
125 |
EDpsResultillegalParam = 0x0002,
|
|
126 |
EDpsResultMissingParam = 0x0003,
|
|
127 |
EDpsResultBufferOverflow = 0x0004
|
|
128 |
};
|
|
129 |
|
|
130 |
// define the DPS service availability
|
|
131 |
// ref: DPS spec page 53
|
|
132 |
// only high bits are useful
|
|
133 |
enum TDpsServiceAvailability
|
|
134 |
{
|
|
135 |
EDpsPrintServiceAvailableFalse = 0x3000,
|
|
136 |
EDpsPrintServiceAvailableTrue = 0x3001
|
|
137 |
};
|
|
138 |
|
|
139 |
// define printing qualities
|
|
140 |
// ref: DPS spec page 54
|
|
141 |
// only high bits are useful
|
|
142 |
enum TDpsPrintQuality
|
|
143 |
{
|
|
144 |
EDpsPrintQualityDefault = 0x5000,
|
|
145 |
EDpsPrintQualityNormal = 0x5001,
|
|
146 |
EDpsPrintQualityDraft = 0x5002,
|
|
147 |
EDpsPrintQualityFine = 0x5003
|
|
148 |
};
|
|
149 |
|
|
150 |
// define paper sizes
|
|
151 |
// ref: DPS spec page 54
|
|
152 |
// only high bits are useful
|
|
153 |
enum TDpsPaperSizes
|
|
154 |
{
|
|
155 |
EDpsPaperSizeDefault = 0x5100,
|
|
156 |
EDpsPaperSizeL = 0x5101,
|
|
157 |
EDpsPaperSize2L = 0x5102,
|
|
158 |
EDpsPaperSizePostcard = 0x5103,
|
|
159 |
EDpsPaperSizeCard = 0x5104,
|
|
160 |
EDpsPaperSize100x150 = 0x5105,
|
|
161 |
EDpsPaperSize4x6 = 0x5106,
|
|
162 |
EDpsPaperSize8x10 = 0x5107,
|
|
163 |
EDpsPaperSizeLetter = 0x5108,
|
|
164 |
EDpsPaperSize11x17 = 0x510A,
|
|
165 |
EDpsPaperSizeA0 = 0x5110,
|
|
166 |
EDpsPaperSizeA1 = 0x5111,
|
|
167 |
EDpsPaperSizeA2 = 0x5112,
|
|
168 |
EDpsPaperSizeA3 = 0x5113,
|
|
169 |
EDpsPaperSizeA4 = 0x5114,
|
|
170 |
EDpsPaperSizeA5 = 0x5115,
|
|
171 |
EDpsPaperSizeA6 = 0x5116,
|
|
172 |
EDpsPaperSizeA7 = 0x5117,
|
|
173 |
EDpsPaperSizeA8 = 0x5118,
|
|
174 |
EDpsPaperSizeA9 = 0x5119,
|
|
175 |
EDpsPaperSizeB0 = 0x5120,
|
|
176 |
EDpsPaperSizeB1 = 0x5121,
|
|
177 |
EDpsPaperSizeB2 = 0x5122,
|
|
178 |
EDpsPaperSizeB3 = 0x5123,
|
|
179 |
EDpsPaperSizeB4 = 0x5124,
|
|
180 |
EDpsPaperSizeB5 = 0x5125,
|
|
181 |
EDpsPaperSizeB6 = 0x5126,
|
|
182 |
EDpsPaperSizeB7 = 0x5127,
|
|
183 |
EDpsPaperSizeB8 = 0x5128,
|
|
184 |
EDpsPaperSizeB9 = 0x5129,
|
|
185 |
EDpsPaperSize89 = 0x5181,
|
|
186 |
EDpsPaperSize127 = 0x5182,
|
|
187 |
EDpsPaperSize100 = 0x5186,
|
|
188 |
EDpsPaperSize210 = 0x5194
|
|
189 |
};
|
|
190 |
// define paper types
|
|
191 |
// ref: DPS spec page 54
|
|
192 |
// only high bits are useful
|
|
193 |
enum TDpsPaperTypeMajor
|
|
194 |
{
|
|
195 |
EDpsPaperTypeDefault = 0x5200,
|
|
196 |
EDpsPaperTypePlainPaper = 0x5201,
|
|
197 |
EDpsPaperTypePhotoPaper = 0x5202,
|
|
198 |
EDpsPaperTypeFastPhotopaper = 0x5203
|
|
199 |
};
|
|
200 |
|
|
201 |
enum TDpsPaperTypeMinor
|
|
202 |
{
|
|
203 |
EDpsPaperTypeStationery = 1,
|
|
204 |
EDpsPaperTypeStationeryCoated,
|
|
205 |
EDpsPaperTypeStationeryInkjet,
|
|
206 |
EDpsPaperTypeStationeryPreprinted,
|
|
207 |
EDpsPaperTypeStationeryLetterhead,
|
|
208 |
EDpsPaperTypeStationeryPrepunched,
|
|
209 |
EDpsPaperTypeStationeryFine,
|
|
210 |
EDpsPaperTypeStationeryHeavyweight,
|
|
211 |
EDpsPaperTypeStationeryLightweight,
|
|
212 |
EDpsPaperTypeTransparency,
|
|
213 |
EDpsPaperTypeEnvelope,
|
|
214 |
EDpsPaperTypeEnvelopePlain,
|
|
215 |
EDpsPaperTypeEnvelopeWindow,
|
|
216 |
EDpsPaperTypeContinuous,
|
|
217 |
EDpsPaperTypeContinuousLong,
|
|
218 |
EDpsPaperTypeContinuousShort,
|
|
219 |
EDpsPaperTypeTabStock,
|
|
220 |
EDpsPaperTypePreCutTabs,
|
|
221 |
EDpsPaperTypeFullCutTabs,
|
|
222 |
EDpsPaperTypeMultiPartForm,
|
|
223 |
EDpsPaperTypeLabels,
|
|
224 |
EDpsPaperTypeMultiLayer,
|
|
225 |
EDpsPaperTypeScreen,
|
|
226 |
EDpsPaperTypeScreenPaged,
|
|
227 |
EDpsPaperTypePhotographic,
|
|
228 |
EDpsPaperTypePhotographicGlossy,
|
|
229 |
EDpsPaperTypePhotographicHighGloss,
|
|
230 |
EDpsPaperTypePhotographicSemiGloss,
|
|
231 |
EDpsPaperTypePhotographicSatin,
|
|
232 |
EDpsPaperTypePhotographicMatte,
|
|
233 |
EDpsPaperTypePhotographicFilm,
|
|
234 |
EDpsPaperTypeBackPrintFilm,
|
|
235 |
EDpsPaperTypeCardStock
|
|
236 |
};
|
|
237 |
|
|
238 |
struct TDpsPaperType
|
|
239 |
{
|
|
240 |
TDpsPaperTypeMajor iMajor;
|
|
241 |
TDpsPaperTypeMinor iMinor;
|
|
242 |
};
|
|
243 |
|
|
244 |
// define file types
|
|
245 |
// ref: DPS sepc page 55
|
|
246 |
// only high bits are useful
|
|
247 |
enum TDpsFileType
|
|
248 |
{
|
|
249 |
EDpsFileTypeDefault = 0x5300,
|
|
250 |
EDpsFileTypeEXIF = 0x5301,
|
|
251 |
EDpsFileTypeJPEG = 0x5303
|
|
252 |
};
|
|
253 |
|
|
254 |
// define date print
|
|
255 |
// ref: DPS sepc page 55
|
|
256 |
// only high bits are useful
|
|
257 |
enum TDpsDatePrint
|
|
258 |
{
|
|
259 |
EDpsDatePrintDefault = 0x5400,
|
|
260 |
EDpsDatePrintOff = 0x5401,
|
|
261 |
EDpsDatePrintOn = 0x5402
|
|
262 |
};
|
|
263 |
|
|
264 |
// define fle name print
|
|
265 |
// ref: DPS sepc page 56
|
|
266 |
// only high bits are useful
|
|
267 |
enum TDpsFileNamePrint
|
|
268 |
{
|
|
269 |
EDpsFileNamePrintDefault = 0x5500,
|
|
270 |
EDpsFileNamePrintOff = 0x5501,
|
|
271 |
EDpsFileNamePrintOn = 0x5503
|
|
272 |
};
|
|
273 |
|
|
274 |
// define image optimization
|
|
275 |
// ref: DPS sepc page 56
|
|
276 |
// only high bits are useful
|
|
277 |
enum TDpsImageOptimize
|
|
278 |
{
|
|
279 |
EDpsImageOptimizeDefault = 0x5600,
|
|
280 |
EDpsImageOptimizeOff = 0x5601,
|
|
281 |
EDpsImageOptimizeOn = 0x5603
|
|
282 |
};
|
|
283 |
|
|
284 |
// define layouts
|
|
285 |
// ref: DPS sepc page 56
|
|
286 |
// only high bits are useful
|
|
287 |
enum TDpsLayout
|
|
288 |
{
|
|
289 |
EDpsLayoutDefault = 0x5700,
|
|
290 |
EDpsLayout1Up = 0x5701,
|
|
291 |
EDpsLayout2Up = 0x5702,
|
|
292 |
EDpsLayout3Up = 0x5703,
|
|
293 |
EDpsLayout4Up = 0x5704,
|
|
294 |
EDpsLayout5Up = 0x5705,
|
|
295 |
EDpsLayout6Up = 0x5706,
|
|
296 |
EDpsLayout7Up = 0x5707,
|
|
297 |
EDpsLayout8Up = 0x5708,
|
|
298 |
EDpsLayout9Up = 0x5709,
|
|
299 |
EDpsLayoutIndex = 0x57FE,
|
|
300 |
EDpsLayoutBorderless = 0x57FF
|
|
301 |
};
|
|
302 |
|
|
303 |
// define fixed sizes
|
|
304 |
// ref: DPS sepc page 57
|
|
305 |
// only high bits are useful
|
|
306 |
enum TDpsFixedSizes
|
|
307 |
{
|
|
308 |
EDpsFixedSizeDefault = 0x5800,
|
|
309 |
EDpsFixedSize4x6 = 0x5803,
|
|
310 |
EDpsFixedSize5x7 = 0x5804,
|
|
311 |
EDpsFixedSizeA4 = 0x5811,
|
|
312 |
EDpsFixedSizeLetter = 0x5812
|
|
313 |
};
|
|
314 |
|
|
315 |
// define croppings
|
|
316 |
// ref: DPS sepc page 57
|
|
317 |
// only high bits are useful
|
|
318 |
enum TDpsCropping
|
|
319 |
{
|
|
320 |
EDpsCroppingDefault = 0x5900,
|
|
321 |
EDpsCroppingOff = 0x5901,
|
|
322 |
EDpsCroppingOn = 0x5902
|
|
323 |
};
|
|
324 |
|
|
325 |
// define Device status
|
|
326 |
// ref: DPS sepc page 61
|
|
327 |
// only high bits are useful
|
|
328 |
// 1. Print service status
|
|
329 |
enum TDpsPrintServiceStatus
|
|
330 |
{
|
|
331 |
EDpsPrintServiceStatusInit = 0,
|
|
332 |
EDpsPrintServiceStatusPrinting = 0x7000,
|
|
333 |
EDpsPrintServiceStatusIdle = 0x7001,
|
|
334 |
EDpsPrintServiceStatusPaused = 0x7002
|
|
335 |
};
|
|
336 |
|
|
337 |
enum TDpsJobStatus
|
|
338 |
{
|
|
339 |
// 2. Job end reasons
|
|
340 |
EDpsJobStatusNotEnded = 0x7100,
|
|
341 |
EDpsJobStatusEndedOk = 0x7101,
|
|
342 |
EDpsJobStatusEndedAbortImmediately = 0x7102,
|
|
343 |
EDpsJobStatusEndedAbortCompleteCurrent = 0x7103,
|
|
344 |
EDpsJobStatusEndedOther = 0x7104
|
|
345 |
};
|
|
346 |
|
|
347 |
// 3. Error status
|
|
348 |
enum TDpsErrorStatus
|
|
349 |
{
|
|
350 |
EDpsErrorStatusOk = 0x7200,
|
|
351 |
EDpsErrorStatusWarning = 0x7201,
|
|
352 |
EDpsErrorStatusFatal = 0x7202
|
|
353 |
};
|
|
354 |
|
|
355 |
enum TDpsJobEndReasonMajor
|
|
356 |
{
|
|
357 |
// 4. Job end reasons
|
|
358 |
EDpsJobErrorNone = 0x7300,
|
|
359 |
EDpsJobErrorPaper = 0x7301,
|
|
360 |
EDpsJobErrorInk = 0x7302,
|
|
361 |
EDpsJobErrorHardware = 0x7303,
|
|
362 |
EDpsJobErrorFile = 0x7304
|
|
363 |
};
|
|
364 |
|
|
365 |
enum TDpsJobEndReasonPaper
|
|
366 |
{
|
|
367 |
EDpsPaperDefault = 0,
|
|
368 |
EDpsPaperEmpty = 0x0100,
|
|
369 |
EDpsPaperLoad = 0x200,
|
|
370 |
EDpsPaperEject = 0x300,
|
|
371 |
EDpsPaperMedia = 0x400,
|
|
372 |
EDpsPaperJam = 0x500,
|
|
373 |
EDpsPaperNearlyEmpty = 0x600,
|
|
374 |
EDpsPaperTypeSizeNoMatch = 0x700
|
|
375 |
};
|
|
376 |
|
|
377 |
enum TDpsJobEndReasonInk
|
|
378 |
{
|
|
379 |
EDpsInkDefault = 0,
|
|
380 |
EDpsInkEmpty = 0x100,
|
|
381 |
EDpsInkLow = 0x200,
|
|
382 |
EDpsInkWaste = 0x300
|
|
383 |
};
|
|
384 |
|
|
385 |
enum TDpsJobEndReasonHard
|
|
386 |
{
|
|
387 |
EDpsHardDefault = 0,
|
|
388 |
EDpsHardFatal = 0x0100,
|
|
389 |
EDpsHardServiceCall = 0x0200,
|
|
390 |
EDpsHardNotAvailable = 0x0300,
|
|
391 |
EDpsHardBusy = 0x0400,
|
|
392 |
EDpsHardLever = 0x0500,
|
|
393 |
EDpsHardCoverOpen = 0x0600,
|
|
394 |
EDpsHardNoMarkingHead = 0x0700,
|
|
395 |
EDpsHardInkCoverOpen = 0x0800,
|
|
396 |
EDpsHardNoInkCartridge = 0x0900
|
|
397 |
};
|
|
398 |
|
|
399 |
enum TDpsJobEndReasonFile
|
|
400 |
{
|
|
401 |
EDpsFileDefault = 0,
|
|
402 |
EDpsFilePrintInfo = 0x0100,
|
|
403 |
EDpsFileDecode = 0x0200
|
|
404 |
};
|
|
405 |
|
|
406 |
struct TDpsJobEndReason
|
|
407 |
{
|
|
408 |
TDpsJobEndReasonMajor iMajor;
|
|
409 |
TDpsJobEndReasonPaper iPaperMinor;
|
|
410 |
TDpsJobEndReasonInk iInkMinor;
|
|
411 |
TDpsJobEndReasonHard iHardMinor;
|
|
412 |
TDpsJobEndReasonFile iFileMinor;
|
|
413 |
};
|
|
414 |
|
|
415 |
enum TDpsDisconnectEnable
|
|
416 |
{
|
|
417 |
// 5. Disconnect Enable
|
|
418 |
EDpsDisconnectEnableFalse = 0x7400,
|
|
419 |
EDpsDisconnectEnableTrue = 0x7401
|
|
420 |
};
|
|
421 |
|
|
422 |
enum TDpsCapabilityChanged
|
|
423 |
{
|
|
424 |
// 6. Capability changes
|
|
425 |
EDpsCapabilityChangedFalse = 0x7500,
|
|
426 |
EDpsCapabilityChangedTrue = 0x7501
|
|
427 |
};
|
|
428 |
|
|
429 |
enum TDpsNewJobOk
|
|
430 |
{
|
|
431 |
// 7. New Job Ok
|
|
432 |
EDpsNewJobOkFalse = 0x7600,
|
|
433 |
EDpsNewJobOkTrue = 0x7601
|
|
434 |
};
|
|
435 |
|
|
436 |
|
|
437 |
// define error reason minor codes
|
|
438 |
// ref: DPS sepc page 62
|
|
439 |
enum TDpsErrorMinorCode
|
|
440 |
{
|
|
441 |
EDpsErrorPaperEmpty = 0x0100,
|
|
442 |
EDpsErrorPaperJam = 0x0500,
|
|
443 |
EDpsErrorPaperUnsupport = 0x0700,
|
|
444 |
EDpsErrorInkEmpty = 0x0100
|
|
445 |
};
|
|
446 |
|
|
447 |
// define About style
|
|
448 |
// ref: DPS spec page 68
|
|
449 |
// only high bits are useful
|
|
450 |
enum TDpsAbortStyle
|
|
451 |
{
|
|
452 |
EDpsAbortStyleImmediately = 0x9000,
|
|
453 |
EDpsAbortStyleCompleteCurrent = 0x9001
|
|
454 |
};
|
|
455 |
|
|
456 |
typedef TUint TDpsAttribute;
|
|
457 |
|
|
458 |
struct TDpsEle
|
|
459 |
{
|
|
460 |
TDpsElement iElement;
|
|
461 |
// number of arguments included in this element
|
|
462 |
TInt iNum;
|
|
463 |
};
|
|
464 |
|
|
465 |
typedef RArray<TDpsEle> TDpsEleArray;
|
|
466 |
|
|
467 |
struct TDpsArg
|
|
468 |
{
|
|
469 |
TDpsArgument iElement;
|
|
470 |
TBuf8<KMaxArgLen> iContent;
|
|
471 |
};
|
|
472 |
|
|
473 |
// used for get DPS respond
|
|
474 |
typedef RArray<TDpsArg> TDpsArgArray;
|
|
475 |
|
|
476 |
struct TDpsResult
|
|
477 |
{
|
|
478 |
TDpsResultMajorCode iMajorCode;
|
|
479 |
TDpsResultMinorCode iMinorCode;
|
|
480 |
};
|
|
481 |
|
|
482 |
#endif
|
|
483 |
|