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 implements the dps constant strings.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include "dpsxmlstring.h"
|
|
20 |
#include "dpsdefs.h"
|
|
21 |
#include "dpsconst.h"
|
|
22 |
#include <e32debug.h>
|
|
23 |
|
|
24 |
#ifdef _DEBUG
|
|
25 |
# define IF_DEBUG(t) {RDebug::t;}
|
|
26 |
#else
|
|
27 |
# define IF_DEBUG(t)
|
|
28 |
#endif
|
|
29 |
|
|
30 |
// ---------------------------------------------------------------------------
|
|
31 |
//
|
|
32 |
// ---------------------------------------------------------------------------
|
|
33 |
//
|
|
34 |
TDpsXmlString* TDpsXmlString::NewL()
|
|
35 |
{
|
|
36 |
TDpsXmlString* self = new (ELeave) TDpsXmlString();
|
|
37 |
CleanupStack::PushL(self);
|
|
38 |
self->ConstructL();
|
|
39 |
CleanupStack::Pop();
|
|
40 |
return self;
|
|
41 |
}
|
|
42 |
|
|
43 |
// ---------------------------------------------------------------------------
|
|
44 |
//
|
|
45 |
// ---------------------------------------------------------------------------
|
|
46 |
//
|
|
47 |
TDpsXmlString::TDpsXmlString()
|
|
48 |
{
|
|
49 |
iDpsOperationStrings = TDpsStrings(EDpsOpMax - 1);
|
|
50 |
iDpsElementStrings = TDpsStrings(KDpsEleMax - 1);
|
|
51 |
iDpsEventStrings = TDpsStrings(KDpsEvtMax - 1);
|
|
52 |
iDpsArgStrings = TDpsStrings(EDpsArgMax);
|
|
53 |
}
|
|
54 |
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
//
|
|
59 |
void TDpsXmlString::ConstructL()
|
|
60 |
{
|
|
61 |
// define Print Service Operations
|
|
62 |
// ref: DPS spec page 14
|
|
63 |
for (TInt i = 1; i < EDpsOpMax; i++)
|
|
64 |
{
|
|
65 |
switch (i)
|
|
66 |
{
|
|
67 |
case EDpsOpConfigPrintService:
|
|
68 |
iDpsOperationStrings.AppendL(_L8("configurePrintService"));
|
|
69 |
break;
|
|
70 |
|
|
71 |
case EDpsOpGetCapability:
|
|
72 |
iDpsOperationStrings.AppendL(_L8("getCapability"));
|
|
73 |
break;
|
|
74 |
|
|
75 |
case EDpsOpGetJobStatus:
|
|
76 |
iDpsOperationStrings.AppendL(_L8("getJobStatus"));
|
|
77 |
break;
|
|
78 |
|
|
79 |
case EDpsOpGetDeviceStatus:
|
|
80 |
iDpsOperationStrings.AppendL(_L8("getDeviceStatus"));
|
|
81 |
break;
|
|
82 |
|
|
83 |
case EDpsOpStartJob:
|
|
84 |
iDpsOperationStrings.AppendL(_L8("startJob"));
|
|
85 |
break;
|
|
86 |
|
|
87 |
case EDpsOpAbortJob:
|
|
88 |
iDpsOperationStrings.AppendL(_L8("abortJob"));
|
|
89 |
break;
|
|
90 |
|
|
91 |
// define Storage Service Operation
|
|
92 |
// ref: DPS spec page 34
|
|
93 |
case EDpsOpContinueJob:
|
|
94 |
iDpsOperationStrings.AppendL(_L8("continueJob"));
|
|
95 |
break;
|
|
96 |
|
|
97 |
case EDpsOpGetFileID:
|
|
98 |
iDpsOperationStrings.AppendL(_L8("getFileID"));
|
|
99 |
break;
|
|
100 |
|
|
101 |
case EDpsOpGetFileInfo:
|
|
102 |
iDpsOperationStrings.AppendL(_L8("getFileInfo"));
|
|
103 |
break;
|
|
104 |
|
|
105 |
case EDpsOpGetFile:
|
|
106 |
iDpsOperationStrings.AppendL(_L8("getFile"));
|
|
107 |
break;
|
|
108 |
|
|
109 |
case EDpsOpGetPartialFile:
|
|
110 |
iDpsOperationStrings.AppendL(_L8("getPartialFile"));
|
|
111 |
break;
|
|
112 |
|
|
113 |
case EDpsOpGetFileList:
|
|
114 |
iDpsOperationStrings.AppendL(_L8("getFileList"));
|
|
115 |
break;
|
|
116 |
|
|
117 |
case EDpsOpGetThumb:
|
|
118 |
iDpsOperationStrings.AppendL(_L8("getThumb"));
|
|
119 |
break;
|
|
120 |
|
|
121 |
default:
|
|
122 |
IF_DEBUG(Print(_L("wrong in OperationString")));
|
|
123 |
User::Leave(KErrArgument);
|
|
124 |
break;
|
|
125 |
}
|
|
126 |
}
|
|
127 |
|
|
128 |
// define the special element which includes other elements
|
|
129 |
for (TInt i = 1; i < KDpsEleMax; i++)
|
|
130 |
{
|
|
131 |
switch(i)
|
|
132 |
{
|
|
133 |
case EDpsCapability:
|
|
134 |
iDpsElementStrings.AppendL(_L8("capability"));
|
|
135 |
break;
|
|
136 |
|
|
137 |
case EDpsJobConfig:
|
|
138 |
iDpsElementStrings.AppendL(_L8("jobConfig"));
|
|
139 |
break;
|
|
140 |
|
|
141 |
case EDpsPrintInfo:
|
|
142 |
iDpsElementStrings.AppendL(_L8("printInfo"));
|
|
143 |
break;
|
|
144 |
|
|
145 |
default:
|
|
146 |
IF_DEBUG(Print(_L("wrong in ElementString")));
|
|
147 |
User::Leave(KErrArgument);
|
|
148 |
break;
|
|
149 |
}
|
|
150 |
}
|
|
151 |
|
|
152 |
// define Print Service Event Notification
|
|
153 |
// ref: DPS spec page 14
|
|
154 |
for (TInt i = 1; i < KDpsEvtMax; i++)
|
|
155 |
{
|
|
156 |
switch(i)
|
|
157 |
{
|
|
158 |
case EDpsEvtNotifyJobStatus:
|
|
159 |
iDpsEventStrings.AppendL(_L8("notifyJobStatus"));
|
|
160 |
break;
|
|
161 |
|
|
162 |
case EDpsEvtNotifyDeviceStatus:
|
|
163 |
iDpsEventStrings.AppendL(_L8("notifyDeviceStatus"));
|
|
164 |
break;
|
|
165 |
|
|
166 |
default:
|
|
167 |
IF_DEBUG(Print(_L("wrong in Event String")));
|
|
168 |
User::Leave(KErrArgument);
|
|
169 |
break;
|
|
170 |
}
|
|
171 |
}
|
|
172 |
|
|
173 |
for (TInt i = 0; i < EDpsArgMax; i++)
|
|
174 |
{
|
|
175 |
switch (i)
|
|
176 |
{
|
|
177 |
case EDpsArgDpsVersions:
|
|
178 |
iDpsArgStrings.AppendL(_L8("dpsVersions"));
|
|
179 |
break;
|
|
180 |
|
|
181 |
case EDpsArgVendorName:
|
|
182 |
iDpsArgStrings.AppendL(_L8("vendorName"));
|
|
183 |
break;
|
|
184 |
|
|
185 |
case EDpsArgVendorSpecificVersion:
|
|
186 |
iDpsArgStrings.AppendL(_L8("vendorSpecificVersion"));
|
|
187 |
break;
|
|
188 |
|
|
189 |
case EDpsArgProductName:
|
|
190 |
iDpsArgStrings.AppendL(_L8("productName"));
|
|
191 |
break;
|
|
192 |
|
|
193 |
case EDpsArgSerialNo:
|
|
194 |
iDpsArgStrings.AppendL(_L8("serialNo"));
|
|
195 |
break;
|
|
196 |
|
|
197 |
case EDpsArgPrintServiceAvailable:
|
|
198 |
iDpsArgStrings.AppendL(_L8("printServiceAvailable"));
|
|
199 |
break;
|
|
200 |
|
|
201 |
case EDpsArgQualities:
|
|
202 |
iDpsArgStrings.AppendL(_L8("qualities"));
|
|
203 |
break;
|
|
204 |
|
|
205 |
case EDpsArgPaperSizes:
|
|
206 |
iDpsArgStrings.AppendL(_L8("paperSizes"));
|
|
207 |
break;
|
|
208 |
|
|
209 |
case EDpsArgPaperTypes:
|
|
210 |
iDpsArgStrings.AppendL(_L8("paperTypes"));
|
|
211 |
break;
|
|
212 |
|
|
213 |
case EDpsArgFileTypes:
|
|
214 |
iDpsArgStrings.AppendL(_L8("fileTypes"));
|
|
215 |
break;
|
|
216 |
|
|
217 |
case EDpsArgDatePrints:
|
|
218 |
iDpsArgStrings.AppendL(_L8("datePrints"));
|
|
219 |
break;
|
|
220 |
|
|
221 |
case EDpsArgFileNamePrints:
|
|
222 |
iDpsArgStrings.AppendL(_L8("fileNamePrints"));
|
|
223 |
break;
|
|
224 |
|
|
225 |
case EDpsArgImageOptimizes:
|
|
226 |
iDpsArgStrings.AppendL(_L8("imageOptimizes"));
|
|
227 |
break;
|
|
228 |
|
|
229 |
case EDpsArgLayouts:
|
|
230 |
iDpsArgStrings.AppendL(_L8("layouts"));
|
|
231 |
break;
|
|
232 |
|
|
233 |
case EDpsArgFixedSizes:
|
|
234 |
iDpsArgStrings.AppendL(_L8("fixedSizes"));
|
|
235 |
break;
|
|
236 |
|
|
237 |
case EDpsArgChroppings:
|
|
238 |
iDpsArgStrings.AppendL(_L8("chroppings"));
|
|
239 |
break;
|
|
240 |
|
|
241 |
case EDpsArgPrtPID:
|
|
242 |
iDpsArgStrings.AppendL(_L8("prtPID"));
|
|
243 |
break;
|
|
244 |
|
|
245 |
case EDpsArgFilePath:
|
|
246 |
iDpsArgStrings.AppendL(_L8("filePath"));
|
|
247 |
break;
|
|
248 |
|
|
249 |
case EDpsArgCopyID:
|
|
250 |
iDpsArgStrings.AppendL(_L8("copyID"));
|
|
251 |
break;
|
|
252 |
|
|
253 |
case EDpsArgProgress:
|
|
254 |
iDpsArgStrings.AppendL(_L8("progress"));
|
|
255 |
break;
|
|
256 |
|
|
257 |
case EDpsArgImagePrinted:
|
|
258 |
iDpsArgStrings.AppendL(_L8("imagePrinted"));
|
|
259 |
break;
|
|
260 |
|
|
261 |
case EDpsArgDpsPrintServiceStatus:
|
|
262 |
iDpsArgStrings.AppendL(_L8("dpsPrintServiceStatus"));
|
|
263 |
break;
|
|
264 |
|
|
265 |
case EDpsArgJobEndReason:
|
|
266 |
iDpsArgStrings.AppendL(_L8("jobEndReason"));
|
|
267 |
break;
|
|
268 |
|
|
269 |
case EDpsArgErrorStatus:
|
|
270 |
iDpsArgStrings.AppendL(_L8("errorStatus"));
|
|
271 |
break;
|
|
272 |
|
|
273 |
case EDpsArgErrorReason:
|
|
274 |
iDpsArgStrings.AppendL(_L8("errorReason"));
|
|
275 |
break;
|
|
276 |
|
|
277 |
case EDpsArgDisconnectEnable:
|
|
278 |
iDpsArgStrings.AppendL(_L8("disconnectEnable"));
|
|
279 |
break;
|
|
280 |
|
|
281 |
case EDpsArgCapabilityChanged:
|
|
282 |
iDpsArgStrings.AppendL(_L8("capabilityChanged"));
|
|
283 |
break;
|
|
284 |
|
|
285 |
case EDpsArgNewJobOk:
|
|
286 |
iDpsArgStrings.AppendL(_L8("newJobOK"));
|
|
287 |
break;
|
|
288 |
|
|
289 |
case EDpsArgQuality:
|
|
290 |
iDpsArgStrings.AppendL(_L8("quality"));
|
|
291 |
break;
|
|
292 |
|
|
293 |
case EDpsArgPaperSize:
|
|
294 |
iDpsArgStrings.AppendL(_L8("paperSize"));
|
|
295 |
break;
|
|
296 |
|
|
297 |
case EDpsArgPaperType:
|
|
298 |
iDpsArgStrings.AppendL(_L8("paperType"));
|
|
299 |
break;
|
|
300 |
|
|
301 |
case EDpsArgFileType:
|
|
302 |
iDpsArgStrings.AppendL(_L8("fileType"));
|
|
303 |
break;
|
|
304 |
|
|
305 |
case EDpsArgDatePrint:
|
|
306 |
iDpsArgStrings.AppendL(_L8("datePrint"));
|
|
307 |
break;
|
|
308 |
|
|
309 |
case EDpsArgFileNamePrint:
|
|
310 |
iDpsArgStrings.AppendL(_L8("fileNamePrint"));
|
|
311 |
break;
|
|
312 |
|
|
313 |
case EDpsArgImageOptimize:
|
|
314 |
iDpsArgStrings.AppendL(_L8("imageOptimize"));
|
|
315 |
break;
|
|
316 |
|
|
317 |
case EDpsArgLayout:
|
|
318 |
iDpsArgStrings.AppendL(_L8("layout"));
|
|
319 |
break;
|
|
320 |
|
|
321 |
case EDpsArgFixedSize:
|
|
322 |
iDpsArgStrings.AppendL(_L8("fixedSize"));
|
|
323 |
break;
|
|
324 |
|
|
325 |
case EDpsArgCropping:
|
|
326 |
iDpsArgStrings.AppendL(_L8("cropping"));
|
|
327 |
break;
|
|
328 |
|
|
329 |
case EDpsArgCroppingArea:
|
|
330 |
iDpsArgStrings.AppendL(_L8("croppingArea"));
|
|
331 |
break;
|
|
332 |
|
|
333 |
case EDpsArgFileID:
|
|
334 |
iDpsArgStrings.AppendL(_L8("fileID"));
|
|
335 |
break;
|
|
336 |
|
|
337 |
case EDpsArgFileName:
|
|
338 |
iDpsArgStrings.AppendL(_L8("fileName"));
|
|
339 |
break;
|
|
340 |
|
|
341 |
case EDpsArgDate:
|
|
342 |
iDpsArgStrings.AppendL(_L8("date"));
|
|
343 |
break;
|
|
344 |
|
|
345 |
case EDpsArgCopies:
|
|
346 |
iDpsArgStrings.AppendL(_L8("copies"));
|
|
347 |
break;
|
|
348 |
|
|
349 |
case EDpsArgAbortStyle:
|
|
350 |
iDpsArgStrings.AppendL(_L8("abortStyle"));
|
|
351 |
break;
|
|
352 |
|
|
353 |
case EDpsArgImagesPrinted:
|
|
354 |
iDpsArgStrings.AppendL(_L8("imagesPrinted"));
|
|
355 |
break;
|
|
356 |
|
|
357 |
case EDpsArgBasePathID:
|
|
358 |
iDpsArgStrings.AppendL(_L8("basePathID"));
|
|
359 |
break;
|
|
360 |
|
|
361 |
case EDpsArgFileSize:
|
|
362 |
iDpsArgStrings.AppendL(_L8("fileSize"));
|
|
363 |
break;
|
|
364 |
|
|
365 |
case EDpsArgThumbFormat:
|
|
366 |
iDpsArgStrings.AppendL(_L8("thumbFormat"));
|
|
367 |
break;
|
|
368 |
|
|
369 |
case EDpsArgThumbSize:
|
|
370 |
iDpsArgStrings.AppendL(_L8("thumbSize"));
|
|
371 |
break;
|
|
372 |
|
|
373 |
case EDpsArgBytesRead:
|
|
374 |
iDpsArgStrings.AppendL(_L8("bytesRead"));
|
|
375 |
break;
|
|
376 |
|
|
377 |
case EDpsArgOffset:
|
|
378 |
iDpsArgStrings.AppendL(_L8("offset"));
|
|
379 |
break;
|
|
380 |
|
|
381 |
case EDpsArgMaxSize:
|
|
382 |
iDpsArgStrings.AppendL(_L8("maxSize"));
|
|
383 |
break;
|
|
384 |
|
|
385 |
case EDpsArgParentFileID:
|
|
386 |
iDpsArgStrings.AppendL(_L8("parentFileID"));
|
|
387 |
break;
|
|
388 |
|
|
389 |
case EDpsArgMaxNumIDs:
|
|
390 |
iDpsArgStrings.AppendL(_L8("maxNumIDs"));
|
|
391 |
break;
|
|
392 |
|
|
393 |
case EDpsArgFileIDs:
|
|
394 |
iDpsArgStrings.AppendL(_L8("fileIDs"));
|
|
395 |
break;
|
|
396 |
|
|
397 |
case EDpsArgNumIDs:
|
|
398 |
iDpsArgStrings.AppendL(_L8("numIDs"));
|
|
399 |
break;
|
|
400 |
|
|
401 |
default:
|
|
402 |
IF_DEBUG(Print(_L("wrong in ArgString")));
|
|
403 |
User::Leave(KErrArgument);
|
|
404 |
break;
|
|
405 |
}
|
|
406 |
}
|
|
407 |
}
|
|
408 |
|
|
409 |
// ---------------------------------------------------------------------------
|
|
410 |
//
|
|
411 |
// ---------------------------------------------------------------------------
|
|
412 |
//
|
|
413 |
TDpsXmlString::~TDpsXmlString()
|
|
414 |
{
|
|
415 |
iDpsArgStrings.Close();
|
|
416 |
iDpsElementStrings.Close();
|
|
417 |
iDpsEventStrings.Close();
|
|
418 |
iDpsOperationStrings.Close();
|
|
419 |
}
|