275 |
275 |
276 // --------------------------------------------------------------------------- |
276 // --------------------------------------------------------------------------- |
277 // |
277 // |
278 // --------------------------------------------------------------------------- |
278 // --------------------------------------------------------------------------- |
279 // |
279 // |
280 RArray<TUint>& CCapabilityManager::GetCapabilities(TInt aCapabilities) |
280 RArray<TUint>& CCapabilityManager::GetCapabilitiesL(TInt aCapabilities) |
281 { |
281 { |
282 FLOG(_L("[IMAGEPRINTUI]<<<CCapabilityManager.GetCapabilities")); |
282 FLOG(_L("[IMAGEPRINTUI]<<<CCapabilityManager.GetCapabilities")); |
283 iReturnArray.Reset(); |
283 iReturnArray.Reset(); |
284 |
284 |
285 switch ( aCapabilities ) |
285 switch ( aCapabilities ) |
286 { |
286 { |
287 case EDpsArgQualities: |
287 case EDpsArgQualities: |
288 for(int i = 0; i < iCurrentQualities.Count(); i++ ) |
288 for(int i = 0; i < iCurrentQualities.Count(); i++ ) |
289 { |
289 { |
290 iReturnArray.Append(iCurrentQualities.operator[](i)); |
290 iReturnArray.AppendL(iCurrentQualities.operator[](i)); |
291 } |
291 } |
292 break; |
292 break; |
293 |
293 |
294 case EDpsArgPaperSizes: |
294 case EDpsArgPaperSizes: |
295 for(int i = 0; i < iCurrentPaperSizes.Count(); i++ ) |
295 for(int i = 0; i < iCurrentPaperSizes.Count(); i++ ) |
296 { |
296 { |
297 iReturnArray.Append(iCurrentPaperSizes.operator[](i)); |
297 iReturnArray.AppendL(iCurrentPaperSizes.operator[](i)); |
298 } |
298 } |
299 break; |
299 break; |
300 |
300 |
301 case EDpsArgLayouts: |
301 case EDpsArgLayouts: |
302 for(int i = 0; i < iCurrentLayouts.Count(); i++ ) |
302 for(int i = 0; i < iCurrentLayouts.Count(); i++ ) |
303 { |
303 { |
304 iReturnArray.Append(iCurrentLayouts.operator[](i)); |
304 iReturnArray.AppendL(iCurrentLayouts.operator[](i)); |
305 } |
305 } |
306 break; |
306 break; |
307 default: |
307 default: |
308 FLOG(_L("[IMAGEPRINTUI]>>>CCapabilityManager.GetCapabilities default brach")); |
308 FLOG(_L("[IMAGEPRINTUI]>>>CCapabilityManager.GetCapabilities default brach")); |
309 break; |
309 break; |
430 { |
430 { |
431 if(compareValue == iPhoneSuppQuality[d]) |
431 if(compareValue == iPhoneSuppQuality[d]) |
432 { |
432 { |
433 iIsCapabilityEmpty = ETrue; |
433 iIsCapabilityEmpty = ETrue; |
434 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save quality is %x"), compareValue )); |
434 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save quality is %x"), compareValue )); |
435 iCurrentQualities.Append(compareValue); |
435 iCurrentQualities.AppendL(compareValue); |
436 } |
436 } |
437 } |
437 } |
438 } |
438 } |
439 if(!iIsCapabilityEmpty) |
439 if(!iIsCapabilityEmpty) |
440 { |
440 { |
441 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities add default value")); |
441 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities add default value")); |
442 iCurrentQualities.Append(EDpsPrintQualityDefault); |
442 iCurrentQualities.AppendL(EDpsPrintQualityDefault); |
443 } |
443 } |
444 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities stored, ask layout")); |
444 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: qualities stored, ask layout")); |
445 iCurrentQualities.Sort(); |
445 iCurrentQualities.Sort(); |
446 AskLayoutL(); |
446 AskLayoutL(); |
447 } |
447 } |
472 { |
472 { |
473 if(compareValue == iPhoneSuppPaperSize[f]) |
473 if(compareValue == iPhoneSuppPaperSize[f]) |
474 { |
474 { |
475 iIsCapabilityEmpty = ETrue; |
475 iIsCapabilityEmpty = ETrue; |
476 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save paper size is %x"), compareValue )); |
476 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save paper size is %x"), compareValue )); |
477 iCurrentPaperSizes.Append(compareValue); |
477 iCurrentPaperSizes.AppendL(compareValue); |
478 } |
478 } |
479 } |
479 } |
480 } |
480 } |
481 if(!iIsCapabilityEmpty) |
481 if(!iIsCapabilityEmpty) |
482 { |
482 { |
483 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper size add default value")); |
483 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper size add default value")); |
484 iCurrentPaperSizes.Append(EDpsPaperSizeDefault); |
484 iCurrentPaperSizes.AppendL(EDpsPaperSizeDefault); |
485 } |
485 } |
486 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper sizes stored, ask quality")); |
486 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: paper sizes stored, ask quality")); |
487 iCurrentPaperSizes.Sort(); |
487 iCurrentPaperSizes.Sort(); |
488 AskQualityL(); |
488 AskQualityL(); |
489 } |
489 } |
494 // --------------------------------------------------------------------------- |
494 // --------------------------------------------------------------------------- |
495 void CCapabilityManager::StoreLayouts(RArray<TUint>& aPrinterLayouts) |
495 void CCapabilityManager::StoreLayouts(RArray<TUint>& aPrinterLayouts) |
496 { |
496 { |
497 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts")); |
497 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts")); |
498 TInt countPrinter, countPhone; |
498 TInt countPrinter, countPhone; |
|
499 TInt ret = KErrNone; |
499 TUint compareValue; |
500 TUint compareValue; |
500 countPrinter = aPrinterLayouts.Count(); |
501 countPrinter = aPrinterLayouts.Count(); |
501 countPhone = iPhoneSuppLayout.Count(); |
502 countPhone = iPhoneSuppLayout.Count(); |
502 iIsCapabilityEmpty = EFalse; |
503 iIsCapabilityEmpty = EFalse; |
503 iCurrentLayouts.Reset(); |
504 iCurrentLayouts.Reset(); |
511 { |
512 { |
512 if(compareValue == iPhoneSuppLayout[e]) |
513 if(compareValue == iPhoneSuppLayout[e]) |
513 { |
514 { |
514 iIsCapabilityEmpty = ETrue; |
515 iIsCapabilityEmpty = ETrue; |
515 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save layout is %x"), compareValue )); |
516 FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CCapabilityManager compareValue save layout is %x"), compareValue )); |
516 iCurrentLayouts.Append(compareValue); |
517 if ( (ret = iCurrentLayouts.Append(compareValue)) != KErrNone) |
|
518 { |
|
519 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts *** append error")); |
|
520 } |
517 } |
521 } |
518 } |
522 } |
519 } |
523 } |
520 |
524 |
521 if(!iIsCapabilityEmpty) |
525 if(!iIsCapabilityEmpty) |
522 { |
526 { |
523 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: layout add default value")); |
527 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: layout add default value")); |
524 iCurrentLayouts.Append(EDpsLayoutDefault); |
528 ret = iCurrentLayouts.Append(EDpsLayoutDefault); |
|
529 if (ret != KErrNone) |
|
530 { |
|
531 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Store layouts *** append error")); |
|
532 } |
525 } |
533 } |
526 |
534 |
527 iCurrentLayouts.Sort(); |
535 iCurrentLayouts.Sort(); |
528 if(iCapabilityAskFailed) |
536 if(iCapabilityAskFailed) |
529 { |
537 { |
573 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request qualities capability NOK")); |
581 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request qualities capability NOK")); |
574 iCapabilityAskFailed = ETrue; |
582 iCapabilityAskFailed = ETrue; |
575 // if fails add default value |
583 // if fails add default value |
576 iAppUi->NotifyError(); |
584 iAppUi->NotifyError(); |
577 iCurrentQualities.Reset(); |
585 iCurrentQualities.Reset(); |
578 iCurrentQualities.Append(EDpsPrintQualityDefault); |
586 iCurrentQualities.AppendL(EDpsPrintQualityDefault); |
579 AskLayoutL(); |
587 AskLayoutL(); |
580 } |
588 } |
581 |
589 |
582 } |
590 } |
583 else if(aType == EPaperSize) |
591 else if(aType == EPaperSize) |
598 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request paper size capability NOK")); |
606 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request paper size capability NOK")); |
599 iCapabilityAskFailed = ETrue; |
607 iCapabilityAskFailed = ETrue; |
600 // if fails add default value; |
608 // if fails add default value; |
601 iAppUi->NotifyError(); |
609 iAppUi->NotifyError(); |
602 iCurrentPaperSizes.Reset(); |
610 iCurrentPaperSizes.Reset(); |
603 iCurrentPaperSizes.Append(EDpsPaperSizeDefault); |
611 iCurrentPaperSizes.AppendL(EDpsPaperSizeDefault); |
604 AskQualityL(); |
612 AskQualityL(); |
605 } |
613 } |
606 |
614 |
607 } |
615 } |
608 else if(aType == ELayouts) |
616 else if(aType == ELayouts) |
622 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request layout capability NOK")); |
630 FLOG(_L("[IMAGEPRINTUI]<<< CCapabilityManager: Dps request layout capability NOK")); |
623 iCapabilityAskFailed = ETrue; |
631 iCapabilityAskFailed = ETrue; |
624 //if fails add default value |
632 //if fails add default value |
625 iAppUi->NotifyError(); |
633 iAppUi->NotifyError(); |
626 iCurrentLayouts.Reset(); |
634 iCurrentLayouts.Reset(); |
627 iCurrentLayouts.Append(EDpsLayoutDefault); |
635 iCurrentLayouts.AppendL(EDpsLayoutDefault); |
628 // complete even if not succesfull, UI must activate |
636 // complete even if not succesfull, UI must activate |
629 iAppUi->CapabilitiesReady(); |
637 iAppUi->CapabilitiesReady(); |
630 } |
638 } |
631 |
639 |
632 } |
640 } |
664 TInt layoutCount = reader.ReadUint8(); |
672 TInt layoutCount = reader.ReadUint8(); |
665 |
673 |
666 |
674 |
667 for (TInt i = 0; i < qualityCount; i++) |
675 for (TInt i = 0; i < qualityCount; i++) |
668 { |
676 { |
669 iPhoneSuppQuality.Append(reader.ReadUint16()); |
677 iPhoneSuppQuality.AppendL(reader.ReadUint16()); |
670 } |
678 } |
671 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, quality readed")); |
679 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, quality readed")); |
672 |
680 |
673 for (TInt i = 0; i < papersizeCount; i++) |
681 for (TInt i = 0; i < papersizeCount; i++) |
674 { |
682 { |
675 iPhoneSuppPaperSize.Append(reader.ReadUint16()); |
683 iPhoneSuppPaperSize.AppendL(reader.ReadUint16()); |
676 } |
684 } |
677 |
685 |
678 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, papersize readed")); |
686 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, papersize readed")); |
679 for (TInt i = 0; i < layoutCount; i++) |
687 for (TInt i = 0; i < layoutCount; i++) |
680 { |
688 { |
681 iPhoneSuppLayout.Append(reader.ReadUint16()); |
689 iPhoneSuppLayout.AppendL(reader.ReadUint16()); |
682 } |
690 } |
683 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, layout readed")); |
691 FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, layout readed")); |
684 |
692 |
685 CleanupStack::PopAndDestroy(id); |
693 CleanupStack::PopAndDestroy(id); |
686 CleanupStack::PopAndDestroy(&resource); |
694 CleanupStack::PopAndDestroy(&resource); |