1 /* |
|
2 * Copyright (c) 2004-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32svr.h> |
|
20 #include <e32math.h> |
|
21 |
|
22 #include "rimageprintclient.h" |
|
23 #include "imageprintclientserver.h" |
|
24 #include "tprintcapability.h" |
|
25 #include "clog.h" |
|
26 #include "tidleguarddata.h" |
|
27 #include "tdiscoveryguarddata.h" |
|
28 #include "tjobguarddata.h" |
|
29 |
|
30 namespace |
|
31 { |
|
32 // Server startup code |
|
33 TInt StartServer() |
|
34 { |
|
35 // EPOC and EKA2 is easy, we just create a new server process. Simultaneous |
|
36 // launching of two such processes should be detected when the second one |
|
37 // attempts to create the server object, failing with KErrAlreadyExists. |
|
38 RProcess server; |
|
39 TInt r = server.Create( KImagePrintServerImg, KNullDesC ); |
|
40 |
|
41 if( r != KErrNone ) |
|
42 return r; |
|
43 TRequestStatus stat; |
|
44 server.Rendezvous(stat); |
|
45 if (stat!=KRequestPending) |
|
46 server.Kill(0); // abort startup |
|
47 else |
|
48 server.Resume(); // logon OK - start the server |
|
49 User::WaitForRequest(stat); // wait for start or death |
|
50 // we can't use the 'exit reason' if the server panicked as this |
|
51 // is the panic 'reason' and may be '0' which cannot be distinguished |
|
52 // from KErrNone |
|
53 r=(server.ExitType()==EExitPanic) ? KErrGeneral : stat.Int(); |
|
54 |
|
55 server.Close(); |
|
56 return r; |
|
57 } |
|
58 } |
|
59 |
|
60 TVersion RImagePrintClient::Version() const |
|
61 { |
|
62 return TVersion( KImagePrintServerMajor, KImagePrintServerMinor, KImagePrintServerBuild ); |
|
63 } |
|
64 |
|
65 EXPORT_C RImagePrintClient::RImagePrintClient() : RSessionBase(), |
|
66 iDicsoveryDataPtr(NULL, 0, 0), |
|
67 iIdleDataPtr(NULL, 0, 0), |
|
68 iJobDataPtr(NULL, 0, 0) |
|
69 { |
|
70 iCapability = NULL; |
|
71 } |
|
72 |
|
73 EXPORT_C TInt RImagePrintClient::ConnectL() |
|
74 { |
|
75 LOG1("RImagePrintClient::Connect Handle(): %d", Handle()); |
|
76 // check against double-connect |
|
77 if( Handle() != KNullHandle ) return KErrAlreadyExists; |
|
78 |
|
79 iCapability = new (ELeave) TPrintCapability(); |
|
80 if( ! iCapability ) return KErrNoMemory; |
|
81 |
|
82 TInt retry = 2; |
|
83 for (;;) |
|
84 { |
|
85 LOG1("RImagePrintClient::Connect retry: %d", retry); |
|
86 TInt r = CreateSession( KImagePrintServerName, Version() ); |
|
87 LOG1("RImagePrintClient::Connect r after CreateSession: %d", r); |
|
88 |
|
89 if( r != KErrNotFound && r!= KErrServerTerminated ) |
|
90 return r; |
|
91 if( --retry == 0 ) |
|
92 return r; |
|
93 r = StartServer(); |
|
94 LOG1("RImagePrintClient::Connect r after StartServer: %d", r); |
|
95 if( r != KErrNone && r != KErrAlreadyExists ) |
|
96 return r; |
|
97 } |
|
98 } |
|
99 |
|
100 EXPORT_C void RImagePrintClient::Close() |
|
101 { |
|
102 LOG("RImagePrintClient::Close begin"); |
|
103 if( iCapability ) |
|
104 { |
|
105 delete iCapability; |
|
106 iCapability = NULL; |
|
107 } |
|
108 RSessionBase::Close(); |
|
109 LOG("RImagePrintClient::Close end"); |
|
110 } |
|
111 |
|
112 EXPORT_C TInt RImagePrintClient::CountConnections( TInt& aConnections ) const |
|
113 { |
|
114 TPckg<TInt> connsBuf( aConnections ); |
|
115 return SendReceive( ECountConnections, TIpcArgs( &connsBuf ) ); |
|
116 } |
|
117 |
|
118 EXPORT_C TInt RImagePrintClient::SetForeground( TInt aFg ) const |
|
119 { |
|
120 return SendReceive( ESetForeground, TIpcArgs( aFg ) ); |
|
121 } |
|
122 |
|
123 EXPORT_C TInt RImagePrintClient::ReserveEngine() const |
|
124 { |
|
125 return SendReceive( EReserveEngine ); |
|
126 } |
|
127 |
|
128 EXPORT_C TInt RImagePrintClient::ReleaseEngine() const |
|
129 { |
|
130 return SendReceive( EReleaseEngine ); |
|
131 } |
|
132 |
|
133 EXPORT_C TInt RImagePrintClient::SupportedProtocols() const |
|
134 { |
|
135 LOG("RImagePrintClient::SupportedProtocols ESupportedProtocols"); |
|
136 TInt prots = SendReceive( ESupportedProtocols ); |
|
137 LOG1("RImagePrintClient::SupportedProtocols end with: %d", prots); |
|
138 return prots; |
|
139 } |
|
140 |
|
141 EXPORT_C TInt RImagePrintClient::GetNumPrintPages() const |
|
142 { |
|
143 LOG("RImagePrintClient::GetNumPrintPages EGetNumPrintPages"); |
|
144 TInt pages = SendReceive( EGetNumPrintPages ); |
|
145 LOG1("RImagePrintClient::GetNumPrintPages end with: %d", pages); |
|
146 return pages; |
|
147 } |
|
148 |
|
149 EXPORT_C TInt RImagePrintClient::GetJobStatus() const |
|
150 { |
|
151 LOG("RImagePrintClient::GetJobStatus EGetJobStatus"); |
|
152 TInt status = SendReceive( EGetJobStatus ); |
|
153 LOG1("RImagePrintClient::GetJobStatus end with: %d", status); |
|
154 return status; |
|
155 } |
|
156 |
|
157 EXPORT_C TInt RImagePrintClient::GetPrinterStatus( TInt aPrinterID ) const |
|
158 { |
|
159 LOG1("RImagePrintClient::GetPrinterStatus EGetPrinterStatus aPrinterID: %d", aPrinterID); |
|
160 TInt status = SendReceive( EGetPrinterStatus, TIpcArgs( aPrinterID ) ); |
|
161 LOG1("RImagePrintClient::GetPrinterStatus end with: %d", status); |
|
162 return status; |
|
163 } |
|
164 |
|
165 EXPORT_C TInt RImagePrintClient::CancelDiscovery() const |
|
166 { |
|
167 LOG("RImagePrintClient::CancelDiscovery ECancelDiscovery"); |
|
168 TInt err = SendReceive( ECancelDiscovery ); |
|
169 LOG1("RImagePrintClient::CancelDiscovery end with: %d", err); |
|
170 return err; |
|
171 } |
|
172 |
|
173 EXPORT_C TInt RImagePrintClient::SubmitPrintJob() const |
|
174 { |
|
175 LOG("RImagePrintClient::SubmitPrintJob ESubmitPrintJob"); |
|
176 TInt err = SendReceive( ESubmitPrintJob ); |
|
177 LOG1("RImagePrintClient::SubmitPrintJob end with: %d", err); |
|
178 return err; |
|
179 } |
|
180 |
|
181 EXPORT_C TInt RImagePrintClient::CancelPrintJob() const |
|
182 { |
|
183 LOG("RImagePrintClient::CancelPrintJob ECancelPrintJob"); |
|
184 TInt err = SendReceive( ECancelPrintJob ); |
|
185 LOG1("RImagePrintClient::CancelPrintJob end with: %d", err); |
|
186 return err; |
|
187 } |
|
188 |
|
189 EXPORT_C TInt RImagePrintClient::ContinuePrintJob() const |
|
190 { |
|
191 LOG("RImagePrintClient::ContinuePrintJob EContinuePrintJob"); |
|
192 TInt err = SendReceive( EContinuePrintJob ); |
|
193 LOG1("RImagePrintClient::ContinuePrintJob end with: %d", err); |
|
194 return err; |
|
195 } |
|
196 |
|
197 EXPORT_C TInt RImagePrintClient::RemoveCachedPrinter( TInt aPrinterID ) const |
|
198 { |
|
199 LOG1("RImagePrintClient::RemoveCachedPrinter ERemoveCachedPrinter aPrinterID: %d", aPrinterID); |
|
200 TInt err = SendReceive( ERemoveCachedPrinter, TIpcArgs( aPrinterID ) ); |
|
201 LOG1("RImagePrintClient::RemoveCachedPrinter end with: %d", err); |
|
202 return err; |
|
203 } |
|
204 |
|
205 EXPORT_C TInt RImagePrintClient::GetJobTemplateIcon( TInt aTemplateID, TInt& aFbsBitmapHandle ) const |
|
206 { |
|
207 TPckg<TInt> handleBuf( aFbsBitmapHandle ); |
|
208 LOG1("RImagePrintClient::GetJobTemplateIcon EGetJobTemplateIcon aTemplateID: %d", aTemplateID); |
|
209 TInt err = SendReceive( EGetJobTemplateIcon, TIpcArgs( aTemplateID, &handleBuf ) ); |
|
210 LOG1("RImagePrintClient::GetJobTemplateIcon aFbsBitmapHandle: %d", aFbsBitmapHandle); |
|
211 LOG1("RImagePrintClient::GetJobTemplateIcon end with: %d", err); |
|
212 return err; |
|
213 } |
|
214 |
|
215 EXPORT_C TInt RImagePrintClient::GetNumPreviewPages() const |
|
216 { |
|
217 LOG("RImagePrintClient::GetNumPreviewPages EGetNumPreviewPages"); |
|
218 TInt pages = SendReceive( EGetNumPreviewPages ); |
|
219 LOG1("RImagePrintClient::GetNumPreviewPages end with: %d", pages); |
|
220 return pages; |
|
221 } |
|
222 |
|
223 EXPORT_C TInt RImagePrintClient::SetJobSetting( TInt aCapabilityID, TInt aValue, TInt& aAffectedCapability ) const |
|
224 { |
|
225 TPckg<TInt> capBuf( aAffectedCapability ); |
|
226 LOG1("RImagePrintClient::SetJobSetting ESetJobSetting aCapabilityID: %d", aCapabilityID); |
|
227 LOG1("RImagePrintClient::SetJobSetting ESetJobSetting aValue: %d", aValue); |
|
228 TInt err = SendReceive( ESetJobSetting, TIpcArgs( aCapabilityID, aValue, &capBuf ) ); |
|
229 LOG1("RImagePrintClient::SetJobSetting aAffectedCapability: %d", aAffectedCapability); |
|
230 LOG1("RImagePrintClient::SetJobSetting end with: %d", err); |
|
231 return err; |
|
232 } |
|
233 |
|
234 EXPORT_C TInt RImagePrintClient::GetJobSetting( TInt aCapabilityID, TInt& aValue ) const |
|
235 { |
|
236 TPckg<TInt> valueBuf( aValue ); |
|
237 LOG1("RImagePrintClient::GetJobSetting EGetJobSetting aCapabilityID: %d", aCapabilityID); |
|
238 TInt err = SendReceive( EGetJobSetting, TIpcArgs( aCapabilityID, &valueBuf ) ); |
|
239 LOG1("RImagePrintClient::GetJobSetting aValue: %d", aValue); |
|
240 LOG1("RImagePrintClient::GetJobSetting end with: %d", err); |
|
241 return err; |
|
242 } |
|
243 |
|
244 EXPORT_C TInt RImagePrintClient::GetPrinterCapability(TInt aPrinterID, TInt aCapabilityID, TPrintCapability& aCapability) const |
|
245 { |
|
246 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapability aPrinterID: %d", aPrinterID); |
|
247 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapability aCapabilityID: %d", aCapabilityID); |
|
248 TInt err = SendReceive( EGetPrinterCapability, TIpcArgs( aPrinterID, aCapabilityID ) ); |
|
249 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapability err: %d", err); |
|
250 |
|
251 if( !err ) |
|
252 { |
|
253 TInt capId; |
|
254 TPckg<TInt> capIdBuf( capId ); |
|
255 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapId"); |
|
256 err = SendReceive( EGetPrinterCapId, TIpcArgs( &capIdBuf ) ); |
|
257 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapId err: %d", err); |
|
258 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapId capId: %d", capId); |
|
259 if( !err ) |
|
260 { |
|
261 iCapability->iCapabilityID = capId; |
|
262 } |
|
263 } |
|
264 |
|
265 if( !err ) |
|
266 { |
|
267 TInt type; |
|
268 TPckg<TInt> typeBuf( type ); |
|
269 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapType"); |
|
270 err = SendReceive( EGetPrinterCapType, TIpcArgs( &typeBuf ) ); |
|
271 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapType err: %d", err); |
|
272 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapType type: %d", type); |
|
273 if( !err ) |
|
274 { |
|
275 iCapability->iType = static_cast<TPrintCapability::ECapType>(type); |
|
276 } |
|
277 } |
|
278 |
|
279 if( !err ) |
|
280 { |
|
281 TInt def; |
|
282 TPckg<TInt> defBuf( def ); |
|
283 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapDef"); |
|
284 err = SendReceive( EGetPrinterCapDef, TIpcArgs( &defBuf ) ); |
|
285 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapDef err: %d", err); |
|
286 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapDef def: %d", def); |
|
287 if( !err ) |
|
288 { |
|
289 iCapability->iDefaultValue = def; |
|
290 } |
|
291 } |
|
292 |
|
293 if( !err ) |
|
294 { |
|
295 TInt low; |
|
296 TPckg<TInt> lowBuf( low ); |
|
297 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapLow"); |
|
298 err = SendReceive( EGetPrinterCapLow, TIpcArgs( &lowBuf ) ); |
|
299 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapLow err: %d", err); |
|
300 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapLow low: %d", low); |
|
301 if( !err ) |
|
302 { |
|
303 iCapability->iLow = low; |
|
304 } |
|
305 } |
|
306 |
|
307 if( !err ) |
|
308 { |
|
309 TInt high; |
|
310 TPckg<TInt> highBuf( high ); |
|
311 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapHigh"); |
|
312 err = SendReceive( EGetPrinterCapHigh, TIpcArgs( &highBuf ) ); |
|
313 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapHigh err: %d", err); |
|
314 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapHigh high: %d", high); |
|
315 if( !err ) |
|
316 { |
|
317 iCapability->iHigh = high; |
|
318 } |
|
319 } |
|
320 |
|
321 if( !err ) |
|
322 { |
|
323 TInt count; |
|
324 TPckg<TInt> countBuf( count ); |
|
325 LOG("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnumCount"); |
|
326 err = SendReceive( EGetPrinterCapEnumCount, TIpcArgs( &countBuf ) ); |
|
327 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnumCount err: %d", err); |
|
328 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnumCount count: %d", count); |
|
329 |
|
330 if( !err ) |
|
331 { |
|
332 iCapability->iEnumCount = count; |
|
333 for( TInt i = 0; i < count && ! err; i++ ) |
|
334 { |
|
335 TInt value; |
|
336 TPckg<TInt> valueBuf( value ); |
|
337 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnum i: %d",i); |
|
338 TInt err = SendReceive( EGetPrinterCapEnum, TIpcArgs( i, &valueBuf ) ); |
|
339 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnum err: %d", err); |
|
340 LOG1("RImagePrintClient::GetPrinterCapability EGetPrinterCapEnum value: %d", value); |
|
341 |
|
342 if( !err ) |
|
343 { |
|
344 iCapability->iEnumCodes[i] = value; |
|
345 } |
|
346 } |
|
347 } |
|
348 } |
|
349 |
|
350 if( !err ) |
|
351 { |
|
352 aCapability = *iCapability; |
|
353 } |
|
354 |
|
355 LOG1("RImagePrintClient::GetPrinterCapability end with: %d", err); |
|
356 return err; |
|
357 } |
|
358 |
|
359 |
|
360 EXPORT_C TInt RImagePrintClient::GetPrinterCapabilityIDs( TInt aPrinterID, RArray<TInt>& aCapabilityIDs ) const |
|
361 { |
|
362 TInt count; |
|
363 TPckg<TInt> countBuf( count ); |
|
364 |
|
365 LOG1("RImagePrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount aPrinterID: %d", aPrinterID); |
|
366 TInt err = SendReceive( EGetPrinterCapabilityIDsCount, TIpcArgs( aPrinterID, &countBuf ) ); |
|
367 LOG1("RImagePrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount err: %d", err); |
|
368 if( !err ) |
|
369 { |
|
370 LOG1("RImagePrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityIDsCount count: %d", count); |
|
371 for( TInt i = 0; i < count && !err; i++ ) |
|
372 { |
|
373 TInt capability; |
|
374 TPckg<TInt> capBuf( capability ); |
|
375 LOG1("RImagePrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityID i: %d", i); |
|
376 err = SendReceive( EGetPrinterCapabilityID, TIpcArgs( i, &capBuf ) ); |
|
377 LOG1("RImagePrintClient::GetPrinterCapabilityIDs EGetPrinterCapabilityID err: %d", err); |
|
378 if( !err ) |
|
379 { |
|
380 LOG1("RImagePrintClient::GetPrinterCapabilityIDs capability id: %d", capability); |
|
381 err = aCapabilityIDs.Append( capability ); |
|
382 LOG1("RImagePrintClient::GetPrinterCapabilityIDs append err: %d", err); |
|
383 } |
|
384 } |
|
385 } |
|
386 |
|
387 LOG1("RImagePrintClient::GetPrinterCapabilityIDs end with: %d", err); |
|
388 return err; |
|
389 } |
|
390 |
|
391 EXPORT_C TInt RImagePrintClient::RegisterIdleObserver( TIdleGuardData& aData, TRequestStatus& aStatus ) |
|
392 { |
|
393 LOG("RImagePrintClient::RegisterIdleObserver EReserveEngine"); |
|
394 TInt err = SendReceive( EReserveEngine ); |
|
395 LOG1("RImagePrintClient::RegisterIdleObserver EReserveEngine err: %d", err); |
|
396 if( !err ) |
|
397 { |
|
398 LOG("RImagePrintClient::RegisterIdleObserver ERegisterIdleObserver"); |
|
399 iIdleDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData)); |
|
400 SendReceive( ERegisterIdleObserver, TIpcArgs( &iIdleDataPtr ), aStatus ); |
|
401 } |
|
402 LOG1("RImagePrintClient::RegisterIdleObserver end with: %d", err); |
|
403 return err; |
|
404 } |
|
405 |
|
406 EXPORT_C TInt RImagePrintClient::CancelRegisterIdleObserver() const |
|
407 { |
|
408 LOG("RImagePrintClient::CancelRegisterIdleObserver ECancelRegisterIdleObserver"); |
|
409 TInt err = SendReceive( EReleaseEngine ); |
|
410 LOG1("RImagePrintClient::RegisterIdleObserver EReleaseEngine err: %d", err); |
|
411 |
|
412 err = SendReceive( ECancelRegisterIdleObserver ); |
|
413 LOG1("RImagePrintClient::RegisterIdleObserver ECancelRegisterIdleObserver err: %d", err); |
|
414 |
|
415 LOG1("RImagePrintClient::CancelRegisterIdleObserver end with: %d", err); |
|
416 return err; |
|
417 } |
|
418 |
|
419 EXPORT_C TInt RImagePrintClient::StartDiscovery( TDiscoveryGuardData& aData, TUint aProtocols, TRequestStatus& aStatus ) |
|
420 { |
|
421 LOG("RImagePrintClient::StartDiscovery EReserveEngine"); |
|
422 TInt err = SendReceive( EReserveEngine ); |
|
423 LOG1("RImagePrintClient::StartDiscovery EReserveEngine err: %d", err); |
|
424 if( !err ) |
|
425 { |
|
426 LOG1("RImagePrintClient::StartDiscovery EStartDiscovery aProtocols: %d", aProtocols); |
|
427 err = SendReceive( EStartDiscovery, TIpcArgs( aProtocols ) ); |
|
428 LOG1("RImagePrintClient::StartDiscovery EStartDiscovery err: %d", err); |
|
429 } |
|
430 if( !err ) |
|
431 { |
|
432 LOG("RImagePrintClient::StartDiscovery EContinueDiscovery"); |
|
433 iDicsoveryDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData)); |
|
434 SendReceive( EContinueDiscovery, TIpcArgs( &iDicsoveryDataPtr ), aStatus ); |
|
435 } |
|
436 LOG1("RImagePrintClient::StartDiscovery end with: %d", err); |
|
437 return err; |
|
438 } |
|
439 |
|
440 EXPORT_C TInt RImagePrintClient::ContinueDiscovery( TDiscoveryGuardData& aData, TRequestStatus& aStatus ) |
|
441 { |
|
442 LOG("RImagePrintClient::ContinueDiscovery EReserveEngine"); |
|
443 TInt err = SendReceive( EReserveEngine ); |
|
444 LOG1("RImagePrintClient::ContinueDiscovery EReserveEngine err: %d", err); |
|
445 if( !err ) |
|
446 { |
|
447 LOG("RImagePrintClient::ContinueDiscovery EContinueDiscovery"); |
|
448 iDicsoveryDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData)); |
|
449 SendReceive( EContinueDiscovery, TIpcArgs( &iDicsoveryDataPtr ), aStatus ); |
|
450 } |
|
451 LOG1("RImagePrintClient::ContinueDiscovery end with: %d", err); |
|
452 return err; |
|
453 } |
|
454 |
|
455 EXPORT_C TInt RImagePrintClient::CreateJob( TInt aPrinterID, TJobGuardData& aData, RPointerArray<TDesC>& aImages, TRequestStatus& aStatus ) |
|
456 { |
|
457 LOG("RImagePrintClient::CreateJob EReserveEngine"); |
|
458 TInt err = SendReceive( EReserveEngine ); |
|
459 LOG1("RImagePrintClient::CreateJob EReserveEngine err: %d", err); |
|
460 if( !err ) |
|
461 { |
|
462 TInt count = aImages.Count(); |
|
463 LOG1("RImagePrintClient::CreateJob aImages.Count(): %d", aImages.Count()); |
|
464 for( TInt i = 0; i < count && !err; i++ ) |
|
465 { |
|
466 LOG("RImagePrintClient::CreateJob EPrepareJob"); |
|
467 err = SendReceive( EPrepareJob, TIpcArgs( aImages[i] ) ); |
|
468 LOG1("RImagePrintClient::CreateJob EPrepareJob err: %d", err); |
|
469 } |
|
470 } |
|
471 if( !err ) |
|
472 { |
|
473 LOG("RImagePrintClient::CreateJob ECreateJob"); |
|
474 err = SendReceive( ECreateJob, TIpcArgs( aPrinterID ) ); |
|
475 LOG1("RImagePrintClient::CreateJob ECreateJob err: %d", err); |
|
476 } |
|
477 if( !err ) |
|
478 { |
|
479 LOG("RImagePrintClient::CreateJob EContinueCreateJob"); |
|
480 iJobDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData)); |
|
481 SendReceive( EContinueCreateJob, TIpcArgs( &iJobDataPtr ), aStatus ); |
|
482 } |
|
483 LOG1("RImagePrintClient::CreateJob end with: %d", err); |
|
484 return err; |
|
485 } |
|
486 |
|
487 EXPORT_C TInt RImagePrintClient::ContinueCreateJob( TJobGuardData& aData, TRequestStatus& aStatus ) |
|
488 { |
|
489 LOG("RImagePrintClient::ContinueCreateJob EReserveEngine"); |
|
490 TInt err = SendReceive( EReserveEngine ); |
|
491 LOG1("RImagePrintClient::ContinueCreateJob EReserveEngine err: %d", err); |
|
492 if( !err ) |
|
493 { |
|
494 LOG("RImagePrintClient::ContinueCreateJob EContinueCreateJob"); |
|
495 iJobDataPtr.Set(reinterpret_cast<TUint8*>(&aData), sizeof(aData), sizeof(aData)); |
|
496 SendReceive( EContinueCreateJob, TIpcArgs( &iJobDataPtr ), aStatus ); |
|
497 } |
|
498 LOG1("RImagePrintClient::ContinueCreateJob end with: %d", err); |
|
499 return err; |
|
500 } |
|
501 |
|
502 EXPORT_C TInt RImagePrintClient::CancelStartDiscovery() const |
|
503 { |
|
504 LOG("RImagePrintClient::CancelStartDiscovery ECancelStartDiscovery"); |
|
505 TInt err = SendReceive( ECancelStartDiscovery ); |
|
506 LOG1("RImagePrintClient::CancelStartDiscovery end with: %d", err); |
|
507 return err; |
|
508 } |
|
509 |
|
510 EXPORT_C TInt RImagePrintClient::CancelCreateJob() const |
|
511 { |
|
512 LOG("RImagePrintClient::CancelCreateJob ECancelCreateJob"); |
|
513 TInt err = SendReceive( ECancelCreateJob ); |
|
514 LOG1("RImagePrintClient::CancelCreateJob end with: %d", err); |
|
515 return err; |
|
516 } |
|
517 |
|
518 EXPORT_C TInt RImagePrintClient::IsPictBridgeMode() const |
|
519 { |
|
520 LOG("RImagePrintClient::IsPictBridgeMode EIsPictBridgeMode"); |
|
521 #ifdef __WINS__ |
|
522 TInt err( KErrNotFound ); |
|
523 #else |
|
524 TInt err = SendReceive( EIsPictBridgeMode ); |
|
525 #endif |
|
526 LOG1("RImagePrintClient::IsPictBridgeMode end with: %d", err); |
|
527 return err; |
|
528 } |
|
529 |
|
530 EXPORT_C TInt RImagePrintClient::SetNumberOfCopies( const RArray<TInt>& aArray ) const |
|
531 { |
|
532 LOG("RImagePrintClient::SetNumberOfCopies EReserveEngine"); |
|
533 TInt err = SendReceive( EReserveEngine ); |
|
534 LOG1("RImagePrintClient::SetNumberOfCopies EReserveEngine err: %d", err); |
|
535 if( !err ) |
|
536 { |
|
537 TInt count = aArray.Count(); |
|
538 LOG1("RImagePrintClient::SetNumberOfCopies count: %d", count); |
|
539 LOG("RImagePrintClient::SetNumberOfCopies ESetNumberOfCopiesCount"); |
|
540 err = SendReceive( ESetNumberOfCopiesCount, TIpcArgs( count ) ); |
|
541 LOG1("RImagePrintClient::SetNumberOfCopies ESetNumberOfCopiesCount err: %d", err); |
|
542 for( TInt i = 0; i < count && !err; i++ ) |
|
543 { |
|
544 LOG1("RImagePrintClient::SetNumberOfCopies i: %d", i); |
|
545 LOG("RImagePrintClient::SetNumberOfCopies ESetNumberOfCopies"); |
|
546 err = SendReceive( ESetNumberOfCopies, TIpcArgs( aArray[i] ) ); |
|
547 LOG1("RImagePrintClient::SetNumberOfCopies ESetNumberOfCopies err: %d", err); |
|
548 } |
|
549 } |
|
550 LOG1("RImagePrintClient::SetNumberOfCopies end with: %d", err); |
|
551 return err; |
|
552 } |
|
553 |
|
554 // End of File |
|