phonebookui/Phonebook2/ccapplication/ccacontactorservice/src/ccacontactorurloperation.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of url launching operation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ccacontactorheaders.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CCCAContactorURLOperation::CCCAContactorURLOperation()
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 CCCAContactorURLOperation::CCCAContactorURLOperation(const TDesC& aParam) : CCCAContactorOperation(aParam)
       
    29     {
       
    30     // No implementation required
       
    31     }
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CCCAContactorURLOperation::~CCCAContactorURLOperation()
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CCCAContactorURLOperation::~CCCAContactorURLOperation()
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // CCCAContactorURLOperation::NewLC()
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 CCCAContactorURLOperation* CCCAContactorURLOperation::NewLC(const TDesC& aParam)
       
    46     {
       
    47     CCCAContactorURLOperation* self = new (ELeave)CCCAContactorURLOperation(aParam);
       
    48     CleanupStack::PushL(self);
       
    49     self->ConstructL();
       
    50     return self;
       
    51     }
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CCCAContactorURLOperation::NewL()
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 CCCAContactorURLOperation* CCCAContactorURLOperation::NewL(const TDesC& aParam)
       
    58     {
       
    59     CCCAContactorURLOperation* self=CCCAContactorURLOperation::NewLC(aParam);
       
    60     CleanupStack::Pop(); // self;
       
    61     return self;
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CCCAContactorURLOperation::ConstructL()
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 void CCCAContactorURLOperation::ConstructL()
       
    69     {
       
    70 
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CCCAContactorURLOperation::ExecuteLD()
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 void CCCAContactorURLOperation::ExecuteLD()
       
    78     {
       
    79     CleanupStack::PushL(this);
       
    80     _LIT(KFourAndSpace, "4 ");
       
    81     const TInt KBrowserUid = 0x10008D39;
       
    82     HBufC* param = HBufC::NewLC( iParam.Size() + 2 );
       
    83     param->Des().Copy( KFourAndSpace );
       
    84     param->Des().Append( iParam );
       
    85     TUid id( TUid::Uid( KBrowserUid ) );
       
    86     TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
       
    87     TApaTask task = taskList.FindApp( id );
       
    88     if ( task.Exists() )
       
    89         {
       
    90         HBufC8* param8 = HBufC8::NewLC( param->Length() );
       
    91         param8->Des().Append( *param );
       
    92         task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
       
    93         CleanupStack::PopAndDestroy(param8);
       
    94         }
       
    95     else 
       
    96         {
       
    97         RApaLsSession appArcSession;
       
    98         User::LeaveIfError( appArcSession.Connect() ); // connect to AppArc server
       
    99         CleanupClosePushL( appArcSession );
       
   100         TThreadId id;
       
   101         User::LeaveIfError
       
   102             ( appArcSession.StartDocument( *param, TUid::Uid( KBrowserUid ), id ) );
       
   103         CleanupStack::PopAndDestroy( &appArcSession );
       
   104         }
       
   105     CleanupStack::PopAndDestroy(); // param
       
   106     CleanupStack::PopAndDestroy(this);
       
   107     }
       
   108 // Enf of File