usbuis/imageprintui/src/imageprintuiappui.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 14:38:00 +0300
changeset 38 218231f2b3b3
parent 35 9d8b04ca6939
child 63 ef2686f7597e
permissions -rw-r--r--
Revision: 201021 Kit: 2010123
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  S60 AppUi class
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include <avkon.hrh>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <avkon.rsg> 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <AiwGenericParam.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <GenericParamConsumer.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <aknnavide.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <imageprintui.rsg>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <AknWaitDialog.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <f32file.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <s32file.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
// #include <d32usbc.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <badesca.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <bautils.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <e32std.h>
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <pathinfo.h> 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include "imageprintui.hrh"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include "imageprintuiappui.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include "imageprintuidocument.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include "emptyview.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "settingsview.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "imageprintuidebug.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include "connectionmanager.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include "capabilitymanager.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include "requestmanager.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include "eventmanager.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include "notes.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include "notetimer.h"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
// ======== MEMBER FUNCTIONS ========
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
//  ConstructL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
void CImagePrintUiAppUi::ConstructL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ConstructL()"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
    BaseConstructL( EAknEnableSkin | EAknEnableMSK );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
    iEngine = static_cast<CImagePrintUiDocument*>(Document())->Engine();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
    iImageFiles = new (ELeave) CDesCArrayFlat(KImageDefaultArray);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
    iNotes = CNotes::NewL(this);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
    iNoteShowed = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
    LoadImagesL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    CAknView* emptyview = CEmptyView::NewLC();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    AddViewL(emptyview);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
    CleanupStack::Pop(emptyview); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    CAknView* settingsview = CSettingsView::NewLC();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    AddViewL(settingsview);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
    CleanupStack::Pop(settingsview);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
    ActivateLocalViewL( emptyview->Id() ); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
    iCableConnected = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
    iActiveNote = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
    iNumberOfUnSuppFiles = 0;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
    iCapabilityChanged = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    iPrintActive = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
    iErrorState = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
    iStartJobOK = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
    iPaperEmpty = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    iNoteTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
    iCloseTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    iCapabilityTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
    iRequestTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    iNoteTimer = CNoteTimer::NewL(this);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    ReadNumberOfUnSuppL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
   
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
    iConnectionManager = CConnectionManager::NewL(this, iEngine, iNotes);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
    iConnectionManager->StartSearchPrinter();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
      
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ConstructL() complete"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
// Destructor
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
CImagePrintUiAppUi::~CImagePrintUiAppUi()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    delete iNaviDecorator;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
    delete iCapabilityManager; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
    delete iRequestManager; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
    delete iEventManager;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    delete iConnectionManager; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
       
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    delete iNoteTimer;    	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    delete iNotes;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    delete iImageFiles;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
// Handle global commands
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
void CImagePrintUiAppUi::HandleCommandL(TInt aCommand)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::HandleCommandL()"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
    // Handle global events
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    switch ( aCommand )
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
        {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
        case EAknSoftkeyExit: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
        case EAknSoftkeyBack:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
        case EAknCmdExit:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
        case EEikCmdExit:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
            {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
            Exit(); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
            }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
        default:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
        }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::HandleCommandL() complete"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
// Closes the application when the cable is disconnected or when some other
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
// mode is selected. 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
void CImagePrintUiAppUi::CloseApplication(TBool aDisconnect)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
    iNotes->SetDisconnectState(aDisconnect);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    if(iPrintActive)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication show note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
    	TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_CONNECTION_LOST));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    	if(!iNoteTimer->IsActive())
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    		iCloseTimeOut = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    		iNoteTimer->After(KRetryClose);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    else
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseApplication just now"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
    	TRAPD(err, ProcessCommandL(EAknCmdExit));  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
    	if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
    		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
    		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::error when CloseApplication"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
    		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
// Closes the application after showing note
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
void CImagePrintUiAppUi::CloseAfterNoteL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CloseAfterNoteL "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
	ProcessCommandL(EAknCmdExit);  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
//	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
void CImagePrintUiAppUi::NotifyPrintStatus(TInt aStatus)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
	FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
	FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi  aStatus is %x"), aStatus ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
	FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi  aStatus is %d"), aStatus ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
	if(aStatus == EDpsPrintServiceStatusPrinting || aStatus == EDpsPrintServiceStatusIdle)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
		FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus set flag false "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
		iPaperEmpty = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
	if(aStatus == EDpsPrintServiceStatusPrinting)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
		FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::Print status active "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
	    iPrintActive = ETrue;	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
	if(aStatus == EDpsPrintServiceStatusIdle)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
		FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::Print status idle"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
		iNotes->PrintProgress(KPrintFinishValue);   
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
	    iPrintActive = EFalse;	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
	FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUiAppUi::NotifyPrintStatus "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
void CImagePrintUiAppUi::NotifyPrintProgress(TInt aImagesPrinted, TInt aProgress)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aImagesPrinted value is %d"), aImagesPrinted ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aProgress value is %d"), aProgress ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi iNumberOfImages value is %d"), iNumberOfImages ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
    TInt realProgress;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
    TUint currentlayout;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
    currentlayout = iCapabilityManager->Layout();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
	if(currentlayout == EDpsLayoutDefault || currentlayout == EDpsLayout1Up)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress progress print"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
		if(iNumberOfImages == KImageNumber)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
			FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress layout case 1 image"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
			aImagesPrinted = aImagesPrinted*KPrintFinishValue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
			realProgress = aImagesPrinted/iNumberOfImages;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
			realProgress = (realProgress <= KPrintFinishValue) ? realProgress : KPrintFinishValue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
		    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
			if(!iErrorState)	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
				{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
				FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
			    iNotes->PrintProgress(realProgress);	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
				}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
		if(iNumberOfImages > KImageNumber)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
			FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress one print image several images"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
			if(aProgress < KPrintFinishValue)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
				{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
				FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress one print image several images update"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
			    if(!iErrorState)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
			    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
			    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error state "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
			        iNotes->PrintProgress(aProgress); 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
			    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
				}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
	else
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress NumberOfImages print"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
		aImagesPrinted = aImagesPrinted*KPrintFinishValue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
		realProgress = aImagesPrinted/iNumberOfImages;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
		realProgress = (realProgress <= KPrintFinishValue) ? realProgress : KPrintFinishValue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
		if(realProgress == KPrintFinishValue)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
			FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress printing done layout big"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
	    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
		if(realProgress < KPrintFinishValue)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
			FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress show progress layout big"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
			if(!iErrorState)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
				{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
				FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress no error state"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
			    iNotes->PrintProgress(realProgress); 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
				}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
		    else
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
		    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
		    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyPrintProgress error state"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
		    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
// To inform about info from eventmanager
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
void CImagePrintUiAppUi::NotifyEventL( TInt aEventNotifyType)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
	FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyEvent start"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aEventNotifyType is  %d"), aEventNotifyType ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
	switch(aEventNotifyType)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
        case CEventManager::ENewJobOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
            FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> New job OK"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
            
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
        case CEventManager::ENewJobNOK: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> New job NOK"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
             iNotes->ShowErrorMsgL(R_ERROR_PRINTER_BUSY);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
             break;    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
        case CEventManager::ECapabilityChange:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> Capability change"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
             TRAPD(err, iCapabilityManager->AskCapabilitiesL(ETrue));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
             if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
             	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
             	iNotes->ShowErrorMsgL(R_ERROR_GENERAL);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
             	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
             break; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
        case EDpsPaperJam: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Paper Jam"));	 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
        	 iNotes->ShowErrorMsgL(R_ERROR_PAPER_JAM);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
             break;  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
        case EDpsPaperEmpty: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Paper empty"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
        	 iPaperEmpty = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
        	 iNotes->ShowErrorMsgL(R_ERROR_OUT_OF_PAPER);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
             break;       
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
        case CEventManager::EInkEmpty:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Ink empty"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
        	 iNotes->PrintFinished();	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
        	 iNotes->ShowErrorMsgL(R_ERROR_OUT_OF_INK); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
             break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
        case EDpsInkLow: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
        	 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi Ink low"));	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
        	 iNotes->ShowErrorMsgL(R_ERROR_INK_LOW);  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
             break;   
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
                 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
		case EDpsJobStatusEndedOther: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
			 FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> User cancel from printer"));	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
			 if(iPrintActive )
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
			 	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
			 	iNotes->PrintFinished();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
				FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> User cancel print active"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
				iPrintActive = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
			 	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
			 break;	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
        case EDpsJobStatusEndedOk: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> Job eneded normally"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
        	break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
        	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
		case EDpsJobStatusEndedAbortImmediately: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
			FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  User aborted"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
			break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
			
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
		case EDpsErrorStatusFatal: 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
		    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  Fatal error in printer side"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
		    if(iPrintActive)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
		    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
		    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  Fatal error in printer side, stop progress note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
		    	iNotes->PrintFinished();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
		    	iPrintActive = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
		    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
		    iNotes->ShowErrorMsgL(R_ERROR_CHECK_STATUS);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
            
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
        case CEventManager::EWarning:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  Warning in printer side"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
        	if(!iPaperEmpty)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
        		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
        		if(iPrintActive)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
			    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
			    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  Warning in printer side, stop progress note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
			    	iNotes->PrintFinished();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
			    	iPrintActive = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
			    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
			    	iNotes->ShowErrorMsgL(R_ERROR_CHECK_STATUS);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
        		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
            
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
        case CEventManager::ENotErrorState:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi,  Not Error State"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
        	iErrorState = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
        	break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        case CEventManager::EErrorState:  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi,  Error State"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
        	iErrorState = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
        	break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
        case CEventManager::EShowError:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, EShowError"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
        	if(iPrintActive)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
		    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
		    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  EShowError in printer side, stop progress note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
		    	iNotes->PrintFinished();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
		    	iPrintActive = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
		    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
        	iNotes->ShowErrorMsgL(R_ERROR_GENERAL);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
        	break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
	// 	case KErrUsbInterfaceNotReady:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
		// 	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi, KErrUsbInterfaceNotReady"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
			// break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
        default:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
        	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi  NotifyEvent::Default branch"));  		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
            break;   
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
// To inform about info from requestmanager
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
void CImagePrintUiAppUi::NotifyRequestL(TInt aNotifyType)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
	FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyRequest start"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi aNotifyType is  %d"), aNotifyType ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
	switch(aNotifyType)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
        case CRequestManager::EConfigurePrintServiceOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
            FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EConfigurePrintServiceOK "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
            TRAPD(err, iCapabilityManager->AskCapabilitiesL(EFalse));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
            if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
            	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
            	iNotes->ShowErrorMsgL(R_ERROR_GENERAL);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
            	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
            break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
            
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
                 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
        case CRequestManager::EConfigurePrintServiceNOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
             //printer does not support
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EConfigurePrintServiceNOK "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
             iNotes->ShowErrorMsgL(R_ERROR_UNABLE_TO_CONNECT); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
             break;    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
        case CRequestManager::EGetJobStatusOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
        	 FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetJobStatusOK "));	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
             break; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
        case CRequestManager::EGetJobStatusNOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetJobStatusNOK "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
             iNotes->ShowErrorMsgL(R_ERROR_GENERAL);  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
             break;      
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
        case CRequestManager::EGetDeviceStatusOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetDeviceStatusOK, start print "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
             break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
        case CRequestManager::EGetDeviceStatusNOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
             // printer is busy
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EGetDeviceStatusNOK "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
             iNotes->ShowErrorMsgL(R_ERROR_PRINTER_BUSY); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
             break;  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
        case CRequestManager::EStartJobOK:	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
             //printing start ok
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
             FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::EStartJobOK"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
             iPrintActive = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
             iStartJobOK = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
             FTRACE(FPrint(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi EStartJobOK  iPrintActiveis  %d"), iPrintActive ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
             break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
        case CRequestManager::EStartJobNOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
             //printing start nok
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EStartJobNOK "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
             iNotes->ShowErrorMsgL(R_ERROR_GENERAL); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
             break;     
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
        case CRequestManager::EAbortJobOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EAbortJobOK ")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
             break; 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
        case CRequestManager::EAbortJobNOK:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
             iNotes->ShowErrorMsgL(R_ERROR_GENERAL); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
             CloseApplication(EFalse);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
             FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EAbortJobNOK ")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
             break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
             
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
        case CRequestManager::EPicturesNotFound:  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
        	FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; EPicturesNotFound ")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
        	iNotes->ShowErrorMsgL(R_ERROR_FILE_NOT_FOUND); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
        	break;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
        		  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
        default:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
            FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUiAppUi NotifyRequest; Default branch")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
            break;   
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
	FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi NotifyRequest; END "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
// To inform number of images
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
void CImagePrintUiAppUi::NumberOfImages(TInt aNumberOfImages)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
	FTRACE(FPrint(_L("[IMAGEPRINTUI]\t NumberOfImages iNumberOfImages  is %d"), iNumberOfImages));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
	iNumberOfImages = aNumberOfImages;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
// To handle timer timeout
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
void CImagePrintUiAppUi::HandleTimeOutL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
	if(iNoteTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
		iNoteTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
		ShowNoteL(); 		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
	else if(iCloseTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, close"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
		iCloseTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
		CloseAfterNoteL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
	else if(iCapabilityTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, capability"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
		iCapabilityTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
		iCapabilityManager->AskCapabilitiesL(EFalse);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
	else if(iRequestTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeOutL, request"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
		iRequestTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
		iRequestManager->ReIssueDoDpsRequestL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> HandleTimeOutL"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
// To handle timer error
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
void CImagePrintUiAppUi::HandleTimeErrorL(TInt aError)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
	if(iNoteTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, note"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
		if(aError == KErrTimedOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
			iNoteTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
			ShowNoteL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
	else if(iCloseTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, close"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
		if(aError == KErrTimedOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
		    iCloseTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
			CloseAfterNoteL(); 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
	else if(iCapabilityTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, capability"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
		if(aError == KErrTimedOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
			{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
			iCapabilityTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
			iCapabilityManager->AskCapabilitiesL(EFalse);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
			}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
	else if(iRequestTimeOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
		FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleTimeErrorL, request"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
		if(aError == KErrTimedOut)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
    		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
			iRequestTimeOut = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
			iRequestManager->ReIssueDoDpsRequestL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
    		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
// To handle request timeout
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
void CImagePrintUiAppUi::HandleRequestTime(TInt aTime)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
	{	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleRequestTimeL"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
	iRequestTimeOut = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
	if(!iNoteTimer->IsActive())
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
	    iNoteTimer->After(aTime); 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
// To handle capability timeout
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
void CImagePrintUiAppUi::HandleCapabilityTime(TInt aTime)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
	{	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< HandleCapabilityTimeL"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
	iCapabilityTimeOut = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
	if(!iNoteTimer->IsActive())
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
	    iNoteTimer->After(aTime);	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
		}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
		
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
// To inform when the cable is connected
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
void CImagePrintUiAppUi::CableConnectedL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi <<< CableConnected"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
      
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
    iCableConnected = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
    iEventManager = CEventManager::NewL(this, iEngine);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
    iCapabilityManager = CCapabilityManager::NewL(this, iEngine);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
    iRequestManager    = CRequestManager::NewL(iEngine, iCapabilityManager, this);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CableConnected"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
// To inform when the cable is disconnected
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
void CImagePrintUiAppUi::NotifyError()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::NotifyError"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
	TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
// To inform when the cable is disconnected
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
void CImagePrintUiAppUi::CableDisConnected()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
	iCableConnected = EFalse;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
// CapabilityManager informs here when capabilities are fetched from dps engine
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
void CImagePrintUiAppUi::CapabilitiesReady()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::CapabilitiesReady, activate local view"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
    TRAPD(err,ActivateLocalViewL(KImagePrintSettingsViewId));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
    if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
    	TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
    	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
    TRAPD(err2, SetNavipaneTextL()); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
    if(err2)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
    	FLOG(_L("[IMAGEPRINTUI] CImagePrintUiAppUi::Unable to show printer name"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
} 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
// This is called when the user presses Options->Print
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
void CImagePrintUiAppUi::StartPrinting()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
    // get first device status, then if OK  dps type start job
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting called")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
    iCapabilityManager->CheckIfNewCapabilityDiffer();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
    if(iCableConnected)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
        iNotes->SetCancelState(EFalse);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting, cable connected")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
        TRAPD(err, iRequestManager->ChooseDpsRequestTypeL(CRequestManager::EGetDeviceStatus )); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
        if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
        	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
        	TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
        	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
    else
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> StartPrinting, cable NOT connected")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
    	TRAP_IGNORE(iNotes->ShowNoteL(R_CONNECT_USB));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
    	iActiveNote = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
    	}                                          
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
// This is called when the user presses Options->Cancel Print
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
void CImagePrintUiAppUi::CancelPrinting()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CancelPrinting BEGIN"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
	TBool cancel = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
    iNotes->SetCancelState(cancel);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
	TRAPD(err, iRequestManager->ChooseDpsRequestTypeL(CRequestManager::EAbortJob ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
	if(err)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
        TRAP_IGNORE(iNotes->ShowErrorMsgL(R_ERROR_GENERAL));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
        }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi >>> CancelPrinting END"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
CDesCArrayFlat* CImagePrintUiAppUi::ImagesToPrint()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ImagesToPrint()"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
    FTRACE(FPrint(_L("[IMAGEPRINTUI] ImagesToPrint; iImageFiles  is %x"), iImageFiles ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
    return iImageFiles;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
void CImagePrintUiAppUi::ReadNumberOfUnSuppL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL start()"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
    TFileName unSuppFile( KResource ); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
    unSuppFile = PathInfo::PhoneMemoryRootPath(); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
    TBuf<KResource> lengthUn(KUnSuppFile);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
    unSuppFile.SetLength(KDriver + lengthUn.Length());
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
    unSuppFile.Replace(KDriver, lengthUn.Length(), KUnSuppFile);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
    RFileReadStream readStream;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
    User::LeaveIfError( readStream.Open(CCoeEnv::Static()->FsSession(), unSuppFile, EFileRead) );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
    readStream.PushL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
    iNumberOfUnSuppFiles = readStream.ReadInt16L();	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
    FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi iNumberOfUnSuppFiles  is %d"), iNumberOfUnSuppFiles ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
    CleanupStack::PopAndDestroy(&readStream); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
    if(iNumberOfUnSuppFiles < KNumberOfUnsupportedFiles)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL none"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
    else if(iNumberOfUnSuppFiles == KNumberOfUnsupportedFiles ||
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
            iNumberOfUnSuppFiles > KNumberOfUnsupportedFiles)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
    	FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::ReadNumberOfUnSuppL one or more"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
    	if(!iNoteTimer->IsActive())
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
    	    iNoteTimeOut = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
    		iNoteTimer->After(KRetryInterval);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
    	} 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
void CImagePrintUiAppUi::LoadImagesL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL()"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
    TFileName printNameFile( KResource ); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
    printNameFile = PathInfo::PhoneMemoryRootPath();  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
    TBuf<KResource> length(KParamFile);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
    printNameFile.SetLength(KDriver + length.Length());
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
    printNameFile.Replace(KDriver, length.Length(), KParamFile);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
    RFileReadStream readStream;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
    CleanupClosePushL(readStream); //1
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
    User::LeaveIfError( readStream.Open(CCoeEnv::Static()->FsSession(),
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
                        printNameFile, EFileRead) );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
    CAiwGenericParamList* paramList = CAiwGenericParamList::NewLC(readStream); //2
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
    TInt index( 0 ); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
    const TAiwGenericParam* param = paramList->FindFirst(index,
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
            EGenericParamFile,
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
            EVariantTypeDesC);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
    while ( index != KErrNotFound )
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
		{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
        TFileName filename( param->Value().AsDes() );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
        FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL; append picture")); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
        iImageFiles->AppendL( filename ); 	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
        	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
        param = paramList->FindNext(index,
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
            EGenericParamFile,
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
            EVariantTypeDesC);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
        }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
    CleanupStack::PopAndDestroy(paramList);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
    CleanupStack::PopAndDestroy(&readStream);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
  
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::LoadImagesL() complete"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
// Set navi pane text
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
void CImagePrintUiAppUi::SetNavipaneTextL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::SetNavipaneTextL Start"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
    CEikStatusPane* sp =
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
        iEikonEnv->AppUiFactory()->StatusPane();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
       
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
    CAknNavigationControlContainer* np =
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
        static_cast<CAknNavigationControlContainer*>(
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
            sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
           
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
    delete iNaviDecorator;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
    iNaviDecorator = NULL;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
    TInt blank(1);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
    TBuf8<KMaxPrinterName> printername;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
    TBuf8<KMaxPrinterName> productname;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
    iRequestManager->GetPrinterName(printername, productname); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
    // convert to HBuf16 because CreateNavigationLabel needs TDesC16, not TDesC8
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
    HBufC* temp = HBufC::NewLC(printername.Length() + productname.Length() + blank); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
    HBufC* temp2 = HBufC::NewLC(productname.Length()); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
    FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi printername  is %S"), &printername ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
    FTRACE(FPrint(_L("[IMAGEPRINTUI] CImagePrintUiAppUi productname  is %S"), &productname ));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
    temp->Des().Copy(printername); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
    temp->Des().Append(_L(" "));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
    temp2->Des().Copy(productname);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
    temp->Des().Append(temp2->Des());
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
    iNaviDecorator = np->CreateNavigationLabelL( *temp );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
    CleanupStack::PopAndDestroy(temp2);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
    CleanupStack::PopAndDestroy(temp);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
    np->PushL( *iNaviDecorator );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
    sp->DrawNow(); 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
    FLOG(_L("[IMAGEPRINTUI]\t CImagePrintUiAppUi::SetNavipaneText END"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
CCapabilityManager* CImagePrintUiAppUi::CapabilityManager()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
	return iCapabilityManager;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
CNotes* CImagePrintUiAppUi::Notes()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
	return iNotes;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
TBool CImagePrintUiAppUi::PrintActive()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
	return iPrintActive;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
// 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
// ---------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
void CImagePrintUiAppUi::ShowNoteL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
    iNoteShowed = ETrue;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
    if(iNumberOfUnSuppFiles == KNumberOfUnsupportedFiles)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
        iNotes->ShowInfoNoteL(R_ERROR_FILE_NOT_SUPPORTED);	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
    	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
    else if(iNumberOfUnSuppFiles > KNumberOfUnsupportedFiles)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
    	{
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
    	iNotes->ShowInfoNoteL(R_ERROR_UNSUPPORTED_FILES_REMOVED);
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
    	}	
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
	}
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
// end of file