btobexprofiles/obexsendservices/obexservicesendutils/src/BTSBIPController.cpp
author hgs
Fri, 28 May 2010 17:03:06 +0300
changeset 32 19bd632b5100
child 40 997690c3397a
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  Image push implementation
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
// INCLUDE FILES
hgs
parents:
diff changeset
    21
#include "BTSBIPController.h"
hgs
parents:
diff changeset
    22
#include "BTSUDebug.h"
hgs
parents:
diff changeset
    23
#include "BTSUImageConverter.h"
hgs
parents:
diff changeset
    24
#include "BTSUXmlParser.h"
hgs
parents:
diff changeset
    25
#include <Obexutils.rsg>
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
// CONSTANTS
hgs
parents:
diff changeset
    30
// image push target header
hgs
parents:
diff changeset
    31
_LIT8( KBIPImagePushID, "\xE3\x3D\x95\x45\x83\x74\x4A\xD7\x9E\xC5\xC1\x6B\xE3\x1E\xDE\x8E" );
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
// type headers
hgs
parents:
diff changeset
    34
_LIT8( KBTSBIPCapabilities, "x-bt/img-capabilities\0");
hgs
parents:
diff changeset
    35
_LIT8( KBTSBIPImageType,    "x-bt/img-img\0");
hgs
parents:
diff changeset
    36
_LIT8( KBTSBIPThmType,      "x-bt/img-thm\0");
hgs
parents:
diff changeset
    37
hgs
parents:
diff changeset
    38
// imageBTS descriptor
hgs
parents:
diff changeset
    39
_LIT8( KBTSBIPDescriptorStart,     "<image-descriptor version=\"1.0\">\r" );
hgs
parents:
diff changeset
    40
_LIT8( KBTSBIPDescriptorEncoding,  "<image encoding=\"" );
hgs
parents:
diff changeset
    41
_LIT8( KBTSBIPDescriptorPixel,     "\" pixel=\"" );
hgs
parents:
diff changeset
    42
_LIT8( KBTSBIPDescriptorSize,      "\" size=\"" );
hgs
parents:
diff changeset
    43
_LIT8( KBTSBIPDescriptorEnd,       "\"/>\r</image-descriptor>" );
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
// temp file path for capabilities object
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
//temp file path drive letter
hgs
parents:
diff changeset
    48
_LIT(KBTSBIPTempPathDrive,"c:");
hgs
parents:
diff changeset
    49
const TInt KBTSUMaxPathLenght=256;
hgs
parents:
diff changeset
    50
const TInt KBTSUMaxPrivatePathLenght=20;
hgs
parents:
diff changeset
    51
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
// ============================ MEMBER FUNCTIONS ===============================
hgs
parents:
diff changeset
    55
hgs
parents:
diff changeset
    56
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    57
// CBTSBIPController::CBTSBIPController
hgs
parents:
diff changeset
    58
// C++ default constructor can NOT contain any code, that
hgs
parents:
diff changeset
    59
// might leave.
hgs
parents:
diff changeset
    60
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    61
//
hgs
parents:
diff changeset
    62
CBTSBIPController::CBTSBIPController( MBTServiceObserver* aObserver, 
hgs
parents:
diff changeset
    63
                                      CBTServiceParameterList* aList ) :
hgs
parents:
diff changeset
    64
                                      iListPtr( aList ),
hgs
parents:
diff changeset
    65
                                      iObserverPtr( aObserver )
hgs
parents:
diff changeset
    66
									  
hgs
parents:
diff changeset
    67
    {
hgs
parents:
diff changeset
    68
    }
hgs
parents:
diff changeset
    69
hgs
parents:
diff changeset
    70
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    71
// CBTSBIPController::ConstructL
hgs
parents:
diff changeset
    72
// Symbian 2nd phase constructor can leave.
hgs
parents:
diff changeset
    73
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    74
//
hgs
parents:
diff changeset
    75
void CBTSBIPController::ConstructL( const TUint aRemotePort, 
hgs
parents:
diff changeset
    76
                                    const TBTDevAddr& aRemoteDeviceAddr )
hgs
parents:
diff changeset
    77
    {
hgs
parents:
diff changeset
    78
    FLOG(_L("[BTSU]\t CBTSBIPController::ConstructL()"));
hgs
parents:
diff changeset
    79
    
hgs
parents:
diff changeset
    80
    // Add image push target header
hgs
parents:
diff changeset
    81
    //
hgs
parents:
diff changeset
    82
    CObexHeader* header = CObexHeader::NewL();
hgs
parents:
diff changeset
    83
    CleanupStack::PushL( header );
hgs
parents:
diff changeset
    84
    header->SetByteSeqL( KBTSUTargetHeader, KBIPImagePushID );
hgs
parents:
diff changeset
    85
hgs
parents:
diff changeset
    86
    RArray<CObexHeader*> headerList;
hgs
parents:
diff changeset
    87
    CleanupClosePushL( headerList );
hgs
parents:
diff changeset
    88
    headerList.Append( header );
hgs
parents:
diff changeset
    89
    
hgs
parents:
diff changeset
    90
    CreateClientL ( this, aRemoteDeviceAddr, aRemotePort, headerList );    
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
    CleanupStack::Pop( 2 ); //header, headerlist
hgs
parents:
diff changeset
    93
    headerList.Close();
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
    FLOG(_L("[BTSU]\t CBTSBIPController::ConstructL() completed"));
hgs
parents:
diff changeset
    96
    }
hgs
parents:
diff changeset
    97
hgs
parents:
diff changeset
    98
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    99
// CBTSBIPController::NewL
hgs
parents:
diff changeset
   100
// Two-phased constructor.
hgs
parents:
diff changeset
   101
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   102
//
hgs
parents:
diff changeset
   103
CBTSBIPController* CBTSBIPController::NewL( MBTServiceObserver* aObserver,
hgs
parents:
diff changeset
   104
                                           const TUint aRemotePort,
hgs
parents:
diff changeset
   105
                                           const TBTDevAddr& aRemoteDeviceAddr,
hgs
parents:
diff changeset
   106
                                           CBTServiceParameterList* aList )
hgs
parents:
diff changeset
   107
    {
hgs
parents:
diff changeset
   108
    CBTSBIPController* self = 
hgs
parents:
diff changeset
   109
        new( ELeave ) CBTSBIPController( aObserver, aList );
hgs
parents:
diff changeset
   110
    CleanupStack::PushL( self );
hgs
parents:
diff changeset
   111
    self->ConstructL( aRemotePort, aRemoteDeviceAddr );
hgs
parents:
diff changeset
   112
    CleanupStack::Pop(self);
hgs
parents:
diff changeset
   113
    return self;
hgs
parents:
diff changeset
   114
    }
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
// Destructor
hgs
parents:
diff changeset
   117
CBTSBIPController::~CBTSBIPController()
hgs
parents:
diff changeset
   118
    {
hgs
parents:
diff changeset
   119
    DeleteTempFile( iThumbnailFileName );
hgs
parents:
diff changeset
   120
    }
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   123
// CBTSBIPController::ConnectCompleted
hgs
parents:
diff changeset
   124
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   125
//
hgs
parents:
diff changeset
   126
void CBTSBIPController::ConnectCompleted( TInt aStatus )
hgs
parents:
diff changeset
   127
    {
hgs
parents:
diff changeset
   128
    FLOG(_L("[BTSU]\t CBTSBIPController::ConnectCompleted()"));
hgs
parents:
diff changeset
   129
hgs
parents:
diff changeset
   130
    if ( aStatus == KErrNone )
hgs
parents:
diff changeset
   131
        {
hgs
parents:
diff changeset
   132
        iFileIndex = 0;
hgs
parents:
diff changeset
   133
        // get remote device capabilities
hgs
parents:
diff changeset
   134
        //
hgs
parents:
diff changeset
   135
        TRAPD( error, GetL() );
hgs
parents:
diff changeset
   136
        if ( error != KErrNone )
hgs
parents:
diff changeset
   137
            {
hgs
parents:
diff changeset
   138
            iObserverPtr->ControllerComplete( EBTSGettingFailed );
hgs
parents:
diff changeset
   139
            }
hgs
parents:
diff changeset
   140
        }
hgs
parents:
diff changeset
   141
    else
hgs
parents:
diff changeset
   142
        {
hgs
parents:
diff changeset
   143
        //Error on Obex level
hgs
parents:
diff changeset
   144
        //
hgs
parents:
diff changeset
   145
        iObserverPtr->ControllerComplete( EBTSConnectingFailed );
hgs
parents:
diff changeset
   146
        }
hgs
parents:
diff changeset
   147
hgs
parents:
diff changeset
   148
    FLOG(_L("[BTSU]\t CBTSBIPController::ConnectCompleted() completed"));
hgs
parents:
diff changeset
   149
    }
hgs
parents:
diff changeset
   150
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   151
// CBTSBIPController::ClientConnectionClosed
hgs
parents:
diff changeset
   152
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   153
//
hgs
parents:
diff changeset
   154
void CBTSBIPController::ClientConnectionClosed()
hgs
parents:
diff changeset
   155
    {
hgs
parents:
diff changeset
   156
    FLOG(_L("[BTSU]\t CBTSBIPController::ClientConnectionClosed()"));
hgs
parents:
diff changeset
   157
hgs
parents:
diff changeset
   158
    // Everything ready, stop service
hgs
parents:
diff changeset
   159
    //    
hgs
parents:
diff changeset
   160
    iObserverPtr->ControllerComplete( EBTSNoError );	
hgs
parents:
diff changeset
   161
    FLOG(_L("[BTSU]\t CBTSBIPController::ClientConnectionClosed() completed"));
hgs
parents:
diff changeset
   162
    }
hgs
parents:
diff changeset
   163
hgs
parents:
diff changeset
   164
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   165
// CBTSBIPController::PutCompleted
hgs
parents:
diff changeset
   166
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   167
//
hgs
parents:
diff changeset
   168
void CBTSBIPController::PutCompleted( TInt aStatus, 
hgs
parents:
diff changeset
   169
                                      const CObexHeaderSet* aPutResponse )
hgs
parents:
diff changeset
   170
    {
hgs
parents:
diff changeset
   171
    FLOG(_L("[BTSU]\t CBTSBIPController::PutCompleted()"));
hgs
parents:
diff changeset
   172
hgs
parents:
diff changeset
   173
    // Remove temporary thumbnail file
hgs
parents:
diff changeset
   174
    //
hgs
parents:
diff changeset
   175
    DeleteTempFile( iThumbnailFileName );
hgs
parents:
diff changeset
   176
    if ( aStatus == KErrNone )
hgs
parents:
diff changeset
   177
        {              
hgs
parents:
diff changeset
   178
        iFileIndex++;
hgs
parents:
diff changeset
   179
        // Send was ok. Start sending next image
hgs
parents:
diff changeset
   180
        //
hgs
parents:
diff changeset
   181
        TRAPD( error, SendL() );
hgs
parents:
diff changeset
   182
        if ( error )
hgs
parents:
diff changeset
   183
            {
hgs
parents:
diff changeset
   184
            FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::Send leaved with %d"), error ));
hgs
parents:
diff changeset
   185
            iObserverPtr->ControllerComplete( EBTSPuttingFailed);
hgs
parents:
diff changeset
   186
            }                
hgs
parents:
diff changeset
   187
        }
hgs
parents:
diff changeset
   188
    else if ( aStatus == KErrIrObexRespPartialContent )
hgs
parents:
diff changeset
   189
        {
hgs
parents:
diff changeset
   190
        // Remote device has requested a thumbnail image
hgs
parents:
diff changeset
   191
        //
hgs
parents:
diff changeset
   192
        TRAPD( error, SendThumbnailL(aPutResponse ) );
hgs
parents:
diff changeset
   193
        if ( error )
hgs
parents:
diff changeset
   194
            {
hgs
parents:
diff changeset
   195
            FTRACE(FPrint(_L("[BTSU]\t CBTSBPPController::Send thumbnail leaved with %d"), error ));
hgs
parents:
diff changeset
   196
            iObserverPtr->ControllerComplete( EBTSPuttingFailed );
hgs
parents:
diff changeset
   197
            }
hgs
parents:
diff changeset
   198
        }
hgs
parents:
diff changeset
   199
    else
hgs
parents:
diff changeset
   200
        {
hgs
parents:
diff changeset
   201
        // Some error on Obex level
hgs
parents:
diff changeset
   202
        //
hgs
parents:
diff changeset
   203
        iObserverPtr->ControllerComplete( EBTSPuttingFailed);
hgs
parents:
diff changeset
   204
        }
hgs
parents:
diff changeset
   205
hgs
parents:
diff changeset
   206
    FLOG(_L("[BTSU]\t CBTSBIPController::PutCompleted() done"));
hgs
parents:
diff changeset
   207
    }
hgs
parents:
diff changeset
   208
hgs
parents:
diff changeset
   209
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   210
// CBTSBIPController::GetCompleted
hgs
parents:
diff changeset
   211
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   212
//
hgs
parents:
diff changeset
   213
void CBTSBIPController::GetCompleted( TInt aStatus, 
hgs
parents:
diff changeset
   214
                                      CObexBufObject* aGetResponse )
hgs
parents:
diff changeset
   215
    {
hgs
parents:
diff changeset
   216
    FLOG(_L("[BTSU]\t CBTSBIPController::GetCompleted()"));	
hgs
parents:
diff changeset
   217
hgs
parents:
diff changeset
   218
    if ( aStatus == KErrAbort )
hgs
parents:
diff changeset
   219
        {
hgs
parents:
diff changeset
   220
        // Connection is cancelled
hgs
parents:
diff changeset
   221
        //
hgs
parents:
diff changeset
   222
        iObserverPtr->ControllerComplete( EBTSGettingFailed );
hgs
parents:
diff changeset
   223
        }
hgs
parents:
diff changeset
   224
    
hgs
parents:
diff changeset
   225
    else if ( aStatus == KErrNone )
hgs
parents:
diff changeset
   226
        {
hgs
parents:
diff changeset
   227
        TRAPD( error, HandleGetCompleteIndicationL( aGetResponse ) );
hgs
parents:
diff changeset
   228
        if ( error != KErrNone )
hgs
parents:
diff changeset
   229
            {
hgs
parents:
diff changeset
   230
            DeleteTempFile( iTempFileName );
hgs
parents:
diff changeset
   231
            // Error on capability handling
hgs
parents:
diff changeset
   232
            //
hgs
parents:
diff changeset
   233
            iObserverPtr->ControllerComplete( EBTSGettingFailed );
hgs
parents:
diff changeset
   234
            }
hgs
parents:
diff changeset
   235
        }
hgs
parents:
diff changeset
   236
    else if( aStatus != KErrAbort && aGetResponse->BytesReceived()==0 )
hgs
parents:
diff changeset
   237
        {
hgs
parents:
diff changeset
   238
        TRAPD( error,iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() ) );
hgs
parents:
diff changeset
   239
        error=KErrNone;
hgs
parents:
diff changeset
   240
        TRAP(error, SendL() );    	 
hgs
parents:
diff changeset
   241
        if ( error != KErrNone )
hgs
parents:
diff changeset
   242
            {            
hgs
parents:
diff changeset
   243
            iObserverPtr->ControllerComplete( EBTSPuttingFailed );
hgs
parents:
diff changeset
   244
            }    	      
hgs
parents:
diff changeset
   245
        } 	
hgs
parents:
diff changeset
   246
    else if ( aStatus != KErrNone && aGetResponse->BytesReceived()>0 )
hgs
parents:
diff changeset
   247
        {
hgs
parents:
diff changeset
   248
        // Error on Obex level
hgs
parents:
diff changeset
   249
        //
hgs
parents:
diff changeset
   250
        iObserverPtr->ControllerComplete( EBTSGettingFailed );
hgs
parents:
diff changeset
   251
        }
hgs
parents:
diff changeset
   252
    
hgs
parents:
diff changeset
   253
hgs
parents:
diff changeset
   254
    FLOG(_L("[BTSU]\t CBTSBIPController::GetCompleted() done"));
hgs
parents:
diff changeset
   255
    }
hgs
parents:
diff changeset
   256
hgs
parents:
diff changeset
   257
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   258
// CBTSBIPController::SendL
hgs
parents:
diff changeset
   259
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   260
//
hgs
parents:
diff changeset
   261
void CBTSBIPController::SendL()
hgs
parents:
diff changeset
   262
    {
hgs
parents:
diff changeset
   263
    FLOG(_L("[BTSU]\t CBTSBIPController::SendL()"));
hgs
parents:
diff changeset
   264
hgs
parents:
diff changeset
   265
    
hgs
parents:
diff changeset
   266
    if ( iListPtr->ImageCount() > 0 && iFileIndex < iListPtr->ImageCount())
hgs
parents:
diff changeset
   267
        {        
hgs
parents:
diff changeset
   268
        
hgs
parents:
diff changeset
   269
        RArray<CObexHeader*> headerList;
hgs
parents:
diff changeset
   270
        CleanupClosePushL( headerList );
hgs
parents:
diff changeset
   271
hgs
parents:
diff changeset
   272
        // Add Type header
hgs
parents:
diff changeset
   273
        //
hgs
parents:
diff changeset
   274
        CObexHeader* typeHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   275
        CleanupStack::PushL( typeHeader );
hgs
parents:
diff changeset
   276
        typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPImageType );
hgs
parents:
diff changeset
   277
        headerList.Append( typeHeader );
hgs
parents:
diff changeset
   278
hgs
parents:
diff changeset
   279
        // Add image descriptor
hgs
parents:
diff changeset
   280
        //
hgs
parents:
diff changeset
   281
        HBufC8* imagedescriptor = CreateImageDescriptorL( );
hgs
parents:
diff changeset
   282
        CleanupStack::PushL( imagedescriptor );
hgs
parents:
diff changeset
   283
  
hgs
parents:
diff changeset
   284
        CObexHeader* imageDescriptorHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   285
        CleanupStack::PushL( imageDescriptorHeader );
hgs
parents:
diff changeset
   286
        imageDescriptorHeader->SetByteSeqL( KBTSUImgDescriptorHeader, imagedescriptor->Des() );
hgs
parents:
diff changeset
   287
        headerList.Append( imageDescriptorHeader );
hgs
parents:
diff changeset
   288
hgs
parents:
diff changeset
   289
        // Send image
hgs
parents:
diff changeset
   290
        //
hgs
parents:
diff changeset
   291
        
hgs
parents:
diff changeset
   292
        TBTSUImageParam imageparam = iListPtr->ImageAtL( iFileIndex );        
hgs
parents:
diff changeset
   293
        RBuf filename;
hgs
parents:
diff changeset
   294
        filename.CreateL(256);
hgs
parents:
diff changeset
   295
        CleanupClosePushL(filename);
hgs
parents:
diff changeset
   296
        imageparam.iFile.Name(filename);
hgs
parents:
diff changeset
   297
        
hgs
parents:
diff changeset
   298
        iObserverPtr->UpdateProgressNoteL(imageparam.iFileSize,iFileIndex,filename);
hgs
parents:
diff changeset
   299
        CleanupStack::PopAndDestroy(&filename);
hgs
parents:
diff changeset
   300
        
hgs
parents:
diff changeset
   301
        iListPtr->MarkAsSendL(iFileIndex);
hgs
parents:
diff changeset
   302
        
hgs
parents:
diff changeset
   303
        
hgs
parents:
diff changeset
   304
        iClient->PutObjectL( headerList, imageparam.iFile );
hgs
parents:
diff changeset
   305
        
hgs
parents:
diff changeset
   306
          
hgs
parents:
diff changeset
   307
        CleanupStack::Pop(4); // headerList, imageDescriptorHeader, typeHeader, imagedescriptor
hgs
parents:
diff changeset
   308
        delete imagedescriptor;
hgs
parents:
diff changeset
   309
        headerList.Close();
hgs
parents:
diff changeset
   310
        }
hgs
parents:
diff changeset
   311
    else
hgs
parents:
diff changeset
   312
        {
hgs
parents:
diff changeset
   313
        FLOG(_L("[BTSU]\t CBTSBIPController::SendL() all images sent, closing connection"));
hgs
parents:
diff changeset
   314
hgs
parents:
diff changeset
   315
        // All images sent, close client connection.
hgs
parents:
diff changeset
   316
        //
hgs
parents:
diff changeset
   317
        iClient->CloseClientConnection();
hgs
parents:
diff changeset
   318
        }
hgs
parents:
diff changeset
   319
hgs
parents:
diff changeset
   320
    FLOG(_L("[BTSU]\t CBTSBIPController::SendL() completed"));
hgs
parents:
diff changeset
   321
    }
hgs
parents:
diff changeset
   322
hgs
parents:
diff changeset
   323
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   324
// CBTSBIPController::GetL
hgs
parents:
diff changeset
   325
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   326
//
hgs
parents:
diff changeset
   327
void CBTSBIPController::GetL()
hgs
parents:
diff changeset
   328
    {
hgs
parents:
diff changeset
   329
    FLOG(_L("[BTSU]\t CBTSBIPController::GetL()"));
hgs
parents:
diff changeset
   330
hgs
parents:
diff changeset
   331
    RArray<CObexHeader*> headerList;
hgs
parents:
diff changeset
   332
    CleanupClosePushL(headerList);
hgs
parents:
diff changeset
   333
    
hgs
parents:
diff changeset
   334
    // Add capabilities type header
hgs
parents:
diff changeset
   335
    //
hgs
parents:
diff changeset
   336
    CObexHeader* typeHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   337
    CleanupStack::PushL( typeHeader );
hgs
parents:
diff changeset
   338
    typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPCapabilities );
hgs
parents:
diff changeset
   339
    headerList.Append( typeHeader );
hgs
parents:
diff changeset
   340
hgs
parents:
diff changeset
   341
    // Get capabilities object from remote device
hgs
parents:
diff changeset
   342
    //
hgs
parents:
diff changeset
   343
    iClient->GetObjectL( headerList );
hgs
parents:
diff changeset
   344
hgs
parents:
diff changeset
   345
    CleanupStack::Pop(2); // headerList, typeHeader
hgs
parents:
diff changeset
   346
    headerList.Close();
hgs
parents:
diff changeset
   347
    }
hgs
parents:
diff changeset
   348
hgs
parents:
diff changeset
   349
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   350
// CBTSBIPController::SendThumbnailL
hgs
parents:
diff changeset
   351
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   352
//
hgs
parents:
diff changeset
   353
void CBTSBIPController::SendThumbnailL( const CObexHeaderSet *aPutResponse )
hgs
parents:
diff changeset
   354
    {
hgs
parents:
diff changeset
   355
    FLOG(_L("[BTSU]\t CBTSBIPController::SendThumbnail()"));
hgs
parents:
diff changeset
   356
hgs
parents:
diff changeset
   357
    // Create thumbnail for sending
hgs
parents:
diff changeset
   358
    // Delete the created thumbnail on PutComplete
hgs
parents:
diff changeset
   359
    //
hgs
parents:
diff changeset
   360
hgs
parents:
diff changeset
   361
    // Fill header array
hgs
parents:
diff changeset
   362
    //
hgs
parents:
diff changeset
   363
	
hgs
parents:
diff changeset
   364
    RArray<CObexHeader*> headerList;
hgs
parents:
diff changeset
   365
    CleanupClosePushL(headerList);
hgs
parents:
diff changeset
   366
hgs
parents:
diff changeset
   367
    // Add ImageHandle header
hgs
parents:
diff changeset
   368
    //
hgs
parents:
diff changeset
   369
    CObexHeader* imageHandleHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   370
    CleanupStack::PushL( imageHandleHeader );
hgs
parents:
diff changeset
   371
hgs
parents:
diff changeset
   372
    aPutResponse->First();
hgs
parents:
diff changeset
   373
	User::LeaveIfError(aPutResponse->Find(KBTSUImageHandleHeader,
hgs
parents:
diff changeset
   374
			 *imageHandleHeader ) );
hgs
parents:
diff changeset
   375
	headerList.Append( imageHandleHeader );
hgs
parents:
diff changeset
   376
	
hgs
parents:
diff changeset
   377
    // Add Type header
hgs
parents:
diff changeset
   378
    //
hgs
parents:
diff changeset
   379
    CObexHeader* typeHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   380
    CleanupStack::PushL( typeHeader );
hgs
parents:
diff changeset
   381
    typeHeader->SetByteSeqL( KBTSUTypeHeader, KBTSBIPThmType );
hgs
parents:
diff changeset
   382
    headerList.Append( typeHeader );
hgs
parents:
diff changeset
   383
	
hgs
parents:
diff changeset
   384
	
hgs
parents:
diff changeset
   385
    CreateTempFileL( iThumbnailFileName );
hgs
parents:
diff changeset
   386
    CBTSUImageConverter* imageConverter = CBTSUImageConverter::NewL();
hgs
parents:
diff changeset
   387
    CleanupStack::PushL( imageConverter );
hgs
parents:
diff changeset
   388
    
hgs
parents:
diff changeset
   389
    TBTSUImageParam imgparam = iListPtr->ImageAtL( iFileIndex );
hgs
parents:
diff changeset
   390
    imageConverter->CreateThumbnailL(imgparam.iFile, iThumbnailFileName );
hgs
parents:
diff changeset
   391
    
hgs
parents:
diff changeset
   392
    CleanupStack::PopAndDestroy(imageConverter);    
hgs
parents:
diff changeset
   393
hgs
parents:
diff changeset
   394
	// Add Name header
hgs
parents:
diff changeset
   395
    //
hgs
parents:
diff changeset
   396
    TParse parse;
hgs
parents:
diff changeset
   397
    User::LeaveIfError( parse.Set( iThumbnailFileName, NULL, NULL ) );
hgs
parents:
diff changeset
   398
    CObexHeader* nameHeader = CObexHeader::NewL();
hgs
parents:
diff changeset
   399
    CleanupStack::PushL( nameHeader );
hgs
parents:
diff changeset
   400
    nameHeader->SetUnicodeL( KBTSUNameHeader, parse.NameAndExt() );
hgs
parents:
diff changeset
   401
    headerList.Append( nameHeader );
hgs
parents:
diff changeset
   402
hgs
parents:
diff changeset
   403
    // send thumbnail
hgs
parents:
diff changeset
   404
    //
hgs
parents:
diff changeset
   405
    iClient->PutObjectL( headerList, iThumbnailFileName );
hgs
parents:
diff changeset
   406
    
hgs
parents:
diff changeset
   407
    // Cleanup
hgs
parents:
diff changeset
   408
    //
hgs
parents:
diff changeset
   409
    CleanupStack::Pop(4); // headerList, imageHandleHeader, typeHeader, nameHeader
hgs
parents:
diff changeset
   410
    headerList.Close();
hgs
parents:
diff changeset
   411
    }
hgs
parents:
diff changeset
   412
hgs
parents:
diff changeset
   413
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   414
// CBTSBIPController::CreateTempFileL
hgs
parents:
diff changeset
   415
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   416
//
hgs
parents:
diff changeset
   417
void CBTSBIPController::CreateTempFileL( TFileName& aFileName )
hgs
parents:
diff changeset
   418
    {
hgs
parents:
diff changeset
   419
    FLOG(_L("[BTSU]\t CBTSBIPController::CreateTempFileL()"));
hgs
parents:
diff changeset
   420
hgs
parents:
diff changeset
   421
    RFs fileSession;
hgs
parents:
diff changeset
   422
    RFile file;    
hgs
parents:
diff changeset
   423
    
hgs
parents:
diff changeset
   424
    TBuf<KBTSUMaxPrivatePathLenght> privatepath;     
hgs
parents:
diff changeset
   425
    TBuf<KBTSUMaxPathLenght> tempPath;     
hgs
parents:
diff changeset
   426
    
hgs
parents:
diff changeset
   427
    User::LeaveIfError( fileSession.Connect() );
hgs
parents:
diff changeset
   428
    CleanupClosePushL( fileSession );    
hgs
parents:
diff changeset
   429
    
hgs
parents:
diff changeset
   430
    User::LeaveIfError(fileSession.CreatePrivatePath(EDriveC));
hgs
parents:
diff changeset
   431
    User::LeaveIfError(fileSession.PrivatePath(privatepath));
hgs
parents:
diff changeset
   432
    tempPath.Append(KBTSBIPTempPathDrive());
hgs
parents:
diff changeset
   433
    tempPath.Append(privatepath);    
hgs
parents:
diff changeset
   434
    User::LeaveIfError( file.Temp( fileSession, privatepath, 
hgs
parents:
diff changeset
   435
                            aFileName, EFileWrite ) );
hgs
parents:
diff changeset
   436
    
hgs
parents:
diff changeset
   437
    file.Flush();
hgs
parents:
diff changeset
   438
    file.Close();
hgs
parents:
diff changeset
   439
    CleanupStack::Pop();    // Close fileSession
hgs
parents:
diff changeset
   440
    fileSession.Close();
hgs
parents:
diff changeset
   441
    }
hgs
parents:
diff changeset
   442
hgs
parents:
diff changeset
   443
hgs
parents:
diff changeset
   444
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   445
// CBTSBIPController::GenerateTempFileNameL
hgs
parents:
diff changeset
   446
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   447
//
hgs
parents:
diff changeset
   448
void CBTSBIPController::GenerateTempFileNameL( TFileName& aFileName )
hgs
parents:
diff changeset
   449
    {
hgs
parents:
diff changeset
   450
    FLOG(_L("[BTSU]\t CBTSBIPController::GenerateTempFileNameL()"));
hgs
parents:
diff changeset
   451
hgs
parents:
diff changeset
   452
    RFs fileSession;
hgs
parents:
diff changeset
   453
    RFile file;  
hgs
parents:
diff changeset
   454
    
hgs
parents:
diff changeset
   455
    TBuf<KBTSUMaxPrivatePathLenght> privatepath;     
hgs
parents:
diff changeset
   456
    TBuf<KBTSUMaxPathLenght> tempPath;     
hgs
parents:
diff changeset
   457
    
hgs
parents:
diff changeset
   458
    User::LeaveIfError( fileSession.Connect() );
hgs
parents:
diff changeset
   459
    CleanupClosePushL( fileSession );
hgs
parents:
diff changeset
   460
    
hgs
parents:
diff changeset
   461
    User::LeaveIfError(fileSession.CreatePrivatePath(EDriveC));
hgs
parents:
diff changeset
   462
    User::LeaveIfError(fileSession.PrivatePath(privatepath ));
hgs
parents:
diff changeset
   463
    tempPath.Append(KBTSBIPTempPathDrive());
hgs
parents:
diff changeset
   464
    tempPath.Append(privatepath);
hgs
parents:
diff changeset
   465
    User::LeaveIfError(file.Temp( fileSession, tempPath, 
hgs
parents:
diff changeset
   466
                            aFileName, EFileWrite ) );                            
hgs
parents:
diff changeset
   467
    
hgs
parents:
diff changeset
   468
    file.Flush();
hgs
parents:
diff changeset
   469
    file.Close();
hgs
parents:
diff changeset
   470
    // Delete the file so that only a unique name is created
hgs
parents:
diff changeset
   471
    fileSession.Delete( aFileName );
hgs
parents:
diff changeset
   472
    CleanupStack::Pop();    // Close fileSession
hgs
parents:
diff changeset
   473
    fileSession.Close();
hgs
parents:
diff changeset
   474
    }    
hgs
parents:
diff changeset
   475
hgs
parents:
diff changeset
   476
hgs
parents:
diff changeset
   477
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   478
// CBTSBIPController::DeleteTempFileL
hgs
parents:
diff changeset
   479
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   480
//
hgs
parents:
diff changeset
   481
void CBTSBIPController::DeleteTempFile( TFileName& aFileName )
hgs
parents:
diff changeset
   482
    {
hgs
parents:
diff changeset
   483
    FLOG(_L("[BTSU]\t CBTSBIPController::DeleteTempFile()"));
hgs
parents:
diff changeset
   484
hgs
parents:
diff changeset
   485
    if ( &aFileName != NULL )
hgs
parents:
diff changeset
   486
        {
hgs
parents:
diff changeset
   487
        if ( aFileName.Length() > 0 )
hgs
parents:
diff changeset
   488
            {
hgs
parents:
diff changeset
   489
            RFs fileSession;
hgs
parents:
diff changeset
   490
            TInt retVal = fileSession.Connect();
hgs
parents:
diff changeset
   491
            if (retVal == KErrNone)
hgs
parents:
diff changeset
   492
                {
hgs
parents:
diff changeset
   493
                fileSession.Delete( aFileName );
hgs
parents:
diff changeset
   494
                }
hgs
parents:
diff changeset
   495
            fileSession.Close();
hgs
parents:
diff changeset
   496
            }
hgs
parents:
diff changeset
   497
        }
hgs
parents:
diff changeset
   498
hgs
parents:
diff changeset
   499
    FLOG(_L("[BTSU]\t CBTSBIPController::DeleteTempFile() complete"));
hgs
parents:
diff changeset
   500
    }
hgs
parents:
diff changeset
   501
hgs
parents:
diff changeset
   502
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   503
// CBTSBIPController::CreateImageDescriptorL
hgs
parents:
diff changeset
   504
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   505
//
hgs
parents:
diff changeset
   506
HBufC8*  CBTSBIPController::CreateImageDescriptorL()
hgs
parents:
diff changeset
   507
    {
hgs
parents:
diff changeset
   508
    FLOG(_L("[BTSU]\t CBTSBIPController::CreateImageDescriptorL()"));
hgs
parents:
diff changeset
   509
hgs
parents:
diff changeset
   510
    //   Example image descriptor of an small jpeg picture
hgs
parents:
diff changeset
   511
    //   with size 160*120 pixels and a size of 5000 bytes.
hgs
parents:
diff changeset
   512
    //
hgs
parents:
diff changeset
   513
    //  <image-descriptor version=\"1.0\">
hgs
parents:
diff changeset
   514
    //  <image encoding=\"JPEG\" pixel=\"160*120\" size=\"5000\"/>
hgs
parents:
diff changeset
   515
    //  </image-descriptor>
hgs
parents:
diff changeset
   516
    TBTSUImageParam param = iListPtr->ImageAtL( iFileIndex );
hgs
parents:
diff changeset
   517
    
hgs
parents:
diff changeset
   518
    // Add start of image description
hgs
parents:
diff changeset
   519
    //
hgs
parents:
diff changeset
   520
    TBuf8<KBTSUMaxStringLength> string( KBTSBIPDescriptorStart );
hgs
parents:
diff changeset
   521
hgs
parents:
diff changeset
   522
    // Add image encoding
hgs
parents:
diff changeset
   523
    //
hgs
parents:
diff changeset
   524
    string.Append( KBTSBIPDescriptorEncoding );
hgs
parents:
diff changeset
   525
    string.Append( *param.iDisplayName );
hgs
parents:
diff changeset
   526
hgs
parents:
diff changeset
   527
    // Add image pixel size
hgs
parents:
diff changeset
   528
    //
hgs
parents:
diff changeset
   529
    string.Append( KBTSBIPDescriptorPixel );
hgs
parents:
diff changeset
   530
    string.AppendNum( param.iPixelSize.iWidth );
hgs
parents:
diff changeset
   531
    string.Append( '*' );
hgs
parents:
diff changeset
   532
    string.AppendNum( param.iPixelSize.iHeight );
hgs
parents:
diff changeset
   533
hgs
parents:
diff changeset
   534
    // Add image size
hgs
parents:
diff changeset
   535
    //
hgs
parents:
diff changeset
   536
    string.Append( KBTSBIPDescriptorSize );
hgs
parents:
diff changeset
   537
    string.AppendNum( param.iFileSize );
hgs
parents:
diff changeset
   538
hgs
parents:
diff changeset
   539
    // Add end of image description
hgs
parents:
diff changeset
   540
    //
hgs
parents:
diff changeset
   541
    string.Append( KBTSBIPDescriptorEnd );
hgs
parents:
diff changeset
   542
hgs
parents:
diff changeset
   543
    FLOG(_L("[BTSU]\t CBTSBIPController::CreateImageDescriptorL() completed"));
hgs
parents:
diff changeset
   544
    
hgs
parents:
diff changeset
   545
    return string.AllocL();
hgs
parents:
diff changeset
   546
    }
hgs
parents:
diff changeset
   547
hgs
parents:
diff changeset
   548
hgs
parents:
diff changeset
   549
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   550
// CBTSBIPController::HandleGetCompleteIndicationL
hgs
parents:
diff changeset
   551
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   552
//
hgs
parents:
diff changeset
   553
void CBTSBIPController::HandleGetCompleteIndicationL( CObexBufObject* aGetResponse )
hgs
parents:
diff changeset
   554
    {
hgs
parents:
diff changeset
   555
    FLOG(_L("[BTSU]\t CBTSBIPController::HandleGetCompleteIndicationL()"));
hgs
parents:
diff changeset
   556
hgs
parents:
diff changeset
   557
    TBool found;
hgs
parents:
diff changeset
   558
    TBool allSupported;
hgs
parents:
diff changeset
   559
    TInt picindex,capindex;
hgs
parents:
diff changeset
   560
    TInt confirm=0;
hgs
parents:
diff changeset
   561
    CBTSUXmlParser* xmlParser = CBTSUXmlParser::NewL();
hgs
parents:
diff changeset
   562
    CleanupStack::PushL( xmlParser );
hgs
parents:
diff changeset
   563
    GenerateTempFileNameL( iTempFileName );
hgs
parents:
diff changeset
   564
    aGetResponse->WriteToFile( iTempFileName );
hgs
parents:
diff changeset
   565
    aGetResponse->Reset();
hgs
parents:
diff changeset
   566
    
hgs
parents:
diff changeset
   567
    // Parse capability object and create a list of supported image encodings
hgs
parents:
diff changeset
   568
    //
hgs
parents:
diff changeset
   569
    RArray<TBTSUImageCap>* remoteCapabilityList = 
hgs
parents:
diff changeset
   570
        xmlParser->GetImgCapabilityListL( iTempFileName );
hgs
parents:
diff changeset
   571
    
hgs
parents:
diff changeset
   572
    // Delete the temp file since we dont need it anymore
hgs
parents:
diff changeset
   573
    //
hgs
parents:
diff changeset
   574
    DeleteTempFile( iTempFileName );
hgs
parents:
diff changeset
   575
hgs
parents:
diff changeset
   576
    // Go through all the images on our sending list and check 
hgs
parents:
diff changeset
   577
    // if remote device is capable of receiving those.
hgs
parents:
diff changeset
   578
    // 
hgs
parents:
diff changeset
   579
    allSupported= ETrue;   
hgs
parents:
diff changeset
   580
    for (picindex=0; picindex< iListPtr->ImageCount(); picindex++ )
hgs
parents:
diff changeset
   581
    	{
hgs
parents:
diff changeset
   582
    	found=EFalse;
hgs
parents:
diff changeset
   583
    	for (capindex=0; capindex < remoteCapabilityList->Count(); capindex++)
hgs
parents:
diff changeset
   584
    		{
hgs
parents:
diff changeset
   585
    		//Find first is encoding suported			
hgs
parents:
diff changeset
   586
    		if((iListPtr->ImageAtL( picindex ).iDisplayName->Compare(*(*remoteCapabilityList)[capindex].iEncoding))==0)		
hgs
parents:
diff changeset
   587
    			{
hgs
parents:
diff changeset
   588
    			found=ETrue;    			
hgs
parents:
diff changeset
   589
    			//Check pixel size
hgs
parents:
diff changeset
   590
    			if((*remoteCapabilityList)[capindex].iMinPixelSize.iHeight>=0)
hgs
parents:
diff changeset
   591
    				{
hgs
parents:
diff changeset
   592
    				if(((*remoteCapabilityList)[capindex].iMaxPixelSize.iWidth < iListPtr->ImageAtL( picindex ).iPixelSize.iWidth)  ||
hgs
parents:
diff changeset
   593
    				   ((*remoteCapabilityList)[capindex].iMaxPixelSize.iHeight < iListPtr->ImageAtL( picindex ).iPixelSize.iHeight)|| 
hgs
parents:
diff changeset
   594
    				   ((*remoteCapabilityList)[capindex].iMinPixelSize.iHeight > iListPtr->ImageAtL( picindex ).iPixelSize.iHeight)||
hgs
parents:
diff changeset
   595
    				   ((*remoteCapabilityList)[capindex].iMinPixelSize.iWidth > iListPtr->ImageAtL( picindex ).iPixelSize.iWidth)
hgs
parents:
diff changeset
   596
    				   )
hgs
parents:
diff changeset
   597
    					{
hgs
parents:
diff changeset
   598
    					found=EFalse;
hgs
parents:
diff changeset
   599
    					}
hgs
parents:
diff changeset
   600
    				}
hgs
parents:
diff changeset
   601
    		
hgs
parents:
diff changeset
   602
    			//Check byte size
hgs
parents:
diff changeset
   603
    			if((*remoteCapabilityList)[capindex].iMaxByteSize>=0)
hgs
parents:
diff changeset
   604
    				{    				
hgs
parents:
diff changeset
   605
    				if((*remoteCapabilityList)[capindex].iMaxByteSize<iListPtr->ImageAtL( picindex ).iFileSize)
hgs
parents:
diff changeset
   606
    					{
hgs
parents:
diff changeset
   607
    					found=EFalse;
hgs
parents:
diff changeset
   608
    					}
hgs
parents:
diff changeset
   609
    				}    	
hgs
parents:
diff changeset
   610
    			// If file is supported, stop the loop.
hgs
parents:
diff changeset
   611
    			//
hgs
parents:
diff changeset
   612
    			if ( found )
hgs
parents:
diff changeset
   613
    			    break;
hgs
parents:
diff changeset
   614
    			}
hgs
parents:
diff changeset
   615
     		}
hgs
parents:
diff changeset
   616
    	allSupported = found & allSupported;
hgs
parents:
diff changeset
   617
    	}
hgs
parents:
diff changeset
   618
    	
hgs
parents:
diff changeset
   619
	for (TInt index=0; index < remoteCapabilityList->Count(); index++)
hgs
parents:
diff changeset
   620
		{
hgs
parents:
diff changeset
   621
		if((*remoteCapabilityList)[index].iEncoding)
hgs
parents:
diff changeset
   622
			{
hgs
parents:
diff changeset
   623
			delete ((*remoteCapabilityList)[index].iEncoding);
hgs
parents:
diff changeset
   624
			}
hgs
parents:
diff changeset
   625
hgs
parents:
diff changeset
   626
		}
hgs
parents:
diff changeset
   627
		
hgs
parents:
diff changeset
   628
	remoteCapabilityList->Close();
hgs
parents:
diff changeset
   629
	delete remoteCapabilityList;
hgs
parents:
diff changeset
   630
    CleanupStack::PopAndDestroy( xmlParser ); 
hgs
parents:
diff changeset
   631
    
hgs
parents:
diff changeset
   632
    if(!allSupported  && iListPtr->ImageCount() > 1)
hgs
parents:
diff changeset
   633
    	{      	
hgs
parents:
diff changeset
   634
    	
hgs
parents:
diff changeset
   635
    	confirm=iObserverPtr->LaunchConfirmationQuery(R_BT_NOT_SEND_ALL_QUERY_MIXED);    	
hgs
parents:
diff changeset
   636
    		
hgs
parents:
diff changeset
   637
    	if(confirm==EAknSoftkeyYes)
hgs
parents:
diff changeset
   638
    		{
hgs
parents:
diff changeset
   639
    		// Everything went ok. Start sending images
hgs
parents:
diff changeset
   640
    		//
hgs
parents:
diff changeset
   641
    		iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() );
hgs
parents:
diff changeset
   642
    
hgs
parents:
diff changeset
   643
		    // Start sending images
hgs
parents:
diff changeset
   644
    		//
hgs
parents:
diff changeset
   645
   			SendL();
hgs
parents:
diff changeset
   646
    		}
hgs
parents:
diff changeset
   647
    	
hgs
parents:
diff changeset
   648
    		
hgs
parents:
diff changeset
   649
    	}
hgs
parents:
diff changeset
   650
    else if ( !allSupported  &&  iListPtr->ImageCount() == 1)
hgs
parents:
diff changeset
   651
        {
hgs
parents:
diff changeset
   652
        // We allow user to choose wheather to send the image file which is not supported on target device
hgs
parents:
diff changeset
   653
        // Original codeline: iObserverPtr->ControllerComplete( EBTSBIPOneNotSend ); 
hgs
parents:
diff changeset
   654
        confirm=iObserverPtr->LaunchConfirmationQuery(R_BT_NOT_SEND_ALL_QUERY_SINGLE);       
hgs
parents:
diff changeset
   655
                    
hgs
parents:
diff changeset
   656
        if(confirm==EAknSoftkeyYes)
hgs
parents:
diff changeset
   657
            {
hgs
parents:
diff changeset
   658
            // Everything went ok. Start sending the images
hgs
parents:
diff changeset
   659
            //
hgs
parents:
diff changeset
   660
            iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize(),iListPtr->ImageCount() );
hgs
parents:
diff changeset
   661
            
hgs
parents:
diff changeset
   662
            // Start sending images
hgs
parents:
diff changeset
   663
            //
hgs
parents:
diff changeset
   664
            SendL();
hgs
parents:
diff changeset
   665
            }
hgs
parents:
diff changeset
   666
        } 	
hgs
parents:
diff changeset
   667
    else if( allSupported )  	
hgs
parents:
diff changeset
   668
        {
hgs
parents:
diff changeset
   669
    	iObserverPtr->LaunchProgressNoteL( iClient, iListPtr->ImageListSize() + iListPtr->ObjectListSizeL(),iListPtr->ImageCount() + iListPtr->ObjectCount());
hgs
parents:
diff changeset
   670
    
hgs
parents:
diff changeset
   671
	    // Start sending images
hgs
parents:
diff changeset
   672
    	//   	
hgs
parents:
diff changeset
   673
   		SendL();   		
hgs
parents:
diff changeset
   674
    	}
hgs
parents:
diff changeset
   675
    	
hgs
parents:
diff changeset
   676
    
hgs
parents:
diff changeset
   677
    FLOG(_L("[BTSU]\t CBTSBIPController::HandleGetCompleteIndicationL() #3"));
hgs
parents:
diff changeset
   678
    }
hgs
parents:
diff changeset
   679
    
hgs
parents:
diff changeset
   680
hgs
parents:
diff changeset
   681
//-----------------------------------------------------------------------------
hgs
parents:
diff changeset
   682
// void CBTSBIPController::ConnectTimedOut()
hgs
parents:
diff changeset
   683
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   684
//        
hgs
parents:
diff changeset
   685
void CBTSBIPController::ConnectTimedOut()    
hgs
parents:
diff changeset
   686
    {
hgs
parents:
diff changeset
   687
    iObserverPtr->ConnectTimedOut();    
hgs
parents:
diff changeset
   688
    }
hgs
parents:
diff changeset
   689
hgs
parents:
diff changeset
   690
hgs
parents:
diff changeset
   691
//  End of File