iaupdate/IAD/swhandlerplugin/src/swhandlerplugin.cpp
branchRCL_3
changeset 73 79647526f98c
equal deleted inserted replaced
70:e8965914fac7 73:79647526f98c
       
     1 /*
       
     2 * Copyright (c) 2010- 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 the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 //  Include Files  
       
    19 #include "swhandlerplugin.h"	// CSwHandlerPlugin
       
    20 
       
    21 #include <ecom/ecom.h>
       
    22 #include <AknServerApp.h>
       
    23 #ifdef _DEBUG
       
    24 #include <e32debug.h>
       
    25 #endif
       
    26 
       
    27 // ================= MACROS =======================
       
    28 #ifdef _DEBUG
       
    29 #define LOG(str) {RDebug::Printf(str);}
       
    30 #define LOG1(str, a) {RDebug::Printf(str, a);}
       
    31 #else
       
    32 #define LOG(str)
       
    33 #define LOG1(str, a)
       
    34 #endif
       
    35 
       
    36 //  Member Functions
       
    37 
       
    38 CSwHandlerPlugin* CSwHandlerPlugin::NewL()
       
    39     {
       
    40     CSwHandlerPlugin* self = new (ELeave) CSwHandlerPlugin;
       
    41     CleanupStack::PushL(self);
       
    42     self->ConstructL();
       
    43     CleanupStack::Pop(self);
       
    44     return self;
       
    45     }
       
    46 
       
    47 CSwHandlerPlugin::CSwHandlerPlugin()
       
    48 // note, CBase initialises all member variables to zero
       
    49     {
       
    50     }
       
    51 
       
    52 void CSwHandlerPlugin::ConstructL()
       
    53     {
       
    54     // second phase constructor, anything that may leave must be constructed here
       
    55     LOG("CSwHandlerPlugin::ConstructL()");
       
    56     }
       
    57 
       
    58 CSwHandlerPlugin::~CSwHandlerPlugin()
       
    59     {
       
    60     }
       
    61 
       
    62 /**
       
    63  * Url Handler with embedding
       
    64  * @param -
       
    65  */
       
    66 void CSwHandlerPlugin::HandleUrlEmbeddedL()
       
    67     {
       
    68     LOG("CSwHandlerPlugin::HandleUrlEmbeddedL()");
       
    69     
       
    70     HandleUrlStandaloneL();
       
    71     }
       
    72 
       
    73 /**
       
    74  * Url Handler without embedding
       
    75  * @param -
       
    76  */
       
    77 void CSwHandlerPlugin::HandleUrlStandaloneL()
       
    78     {
       
    79     LOG("CSwHandlerPlugin::HandleUrlStandaloneL()");
       
    80     
       
    81     _LIT(KIAUpdateLauncherExe, "iaupdatelauncher.exe");
       
    82     _LIT(KEmptyDescriptor, "");
       
    83 
       
    84     RProcess rProcess;
       
    85     User::LeaveIfError(rProcess.Create(KIAUpdateLauncherExe,KEmptyDescriptor));
       
    86     LOG("CSwHandlerPlugin::HandleUrlStandaloneL() >> Created rProcess");
       
    87     
       
    88     // start the process running! Don't forget this.
       
    89     rProcess.Resume();
       
    90     LOG("CSwHandlerPlugin::HandleUrlStandaloneL() >> Resumed process");
       
    91 
       
    92     // free resources before returning
       
    93     rProcess.Close();
       
    94     LOG("CSwHandlerPlugin::HandleUrlStandaloneL() >> Closed rProcess (handle)");
       
    95 
       
    96     if(iSchemeDoc)
       
    97         {
       
    98         LOG("CSwHandlerPlugin::HandleUrlStandaloneL() >> Calling HandlerServerAppExit for observer");
       
    99         iSchemeDoc->HandleServerAppExit(KErrNone);
       
   100         }
       
   101     
       
   102     LOG("CSwHandlerPlugin::HandleUrlStandaloneL() returning");
       
   103     }
       
   104 
       
   105 /**
       
   106  * Observer
       
   107  * @param - aSchemeDoc
       
   108  */
       
   109 void CSwHandlerPlugin::Observer(MAknServerAppExitObserver* aSchemeDoc)
       
   110     {
       
   111     LOG("CSwHandlerPlugin::Observer()");
       
   112     
       
   113     iSchemeDoc = aSchemeDoc;
       
   114     }
       
   115 
       
   116 // End of File