browserui/browser/BrowserAppSrc/BrowserAsyncExit.cpp
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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 *  CBrowserAsyncExit class can exit the Browser in async mode. It calls the CBrowserAppUi`s
       
    16 *  ExitBrowser() method, when the object completes the request.
       
    17 *  The class helps avoiding to send  event.iCode  EKeyApplication1; event
       
    18 *  to the embedded browser to exit.
       
    19 *
       
    20 *
       
    21 */
       
    22 
       
    23 
       
    24 #include "BrowserAsyncExit.h"
       
    25 #include "ApiProvider.h"
       
    26 #include "Logger.h"
       
    27 
       
    28 
       
    29 // ---------------------------------------------------------------------------
       
    30 // staticCBrowserAsyncExit* CBrowserAsyncExit::NewL( )
       
    31 // Create a CBrowserAsyncExit object. Leaves on failure.
       
    32 // ---------------------------------------------------------------------------
       
    33 //
       
    34 CBrowserAsyncExit* CBrowserAsyncExit::NewL( MApiProvider* aApiProvider )
       
    35     {
       
    36     LOG_ENTERFN("CBrowserAsyncExit::NewL");    
       
    37     CBrowserAsyncExit* self = NewLC( aApiProvider );
       
    38     CleanupStack::Pop(self);
       
    39     return self;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 //	static CBrowserAsyncExit* CBrowserAsyncExit::NewLC( )
       
    44 //  Create a CBrowserAsyncExit object. Leaves on failure.
       
    45 // ---------------------------------------------------------------------------
       
    46 //    
       
    47 CBrowserAsyncExit* CBrowserAsyncExit::NewLC( MApiProvider* aApiProvider )
       
    48     {
       
    49     LOG_ENTERFN("CBrowserAsyncExit::NewLC");        
       
    50     CBrowserAsyncExit* self = new (ELeave) CBrowserAsyncExit( aApiProvider );
       
    51     CleanupStack::PushL(self);
       
    52     self->ConstructL();
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 //	CBrowserAsyncExit::CBrowserAsyncExit( ):CActive(CActive::EPriorityStandard)
       
    58 //  Constructs this object
       
    59 // ---------------------------------------------------------------------------
       
    60 //    
       
    61 CBrowserAsyncExit::CBrowserAsyncExit( MApiProvider* aApiProvider ):CActive(CActive::EPriorityStandard)
       
    62     {
       
    63     LOG_ENTERFN("CBrowserAsyncExit::CBrowserAsyncExit");            
       
    64     CActiveScheduler::Add( this );
       
    65     iApiProvider = aApiProvider;
       
    66     }
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 //	CBrowserAsyncExit::~CBrowserAsyncExit()
       
    70 //  Destroy the object and release all memory objects
       
    71 // ---------------------------------------------------------------------------
       
    72 //    
       
    73 CBrowserAsyncExit::~CBrowserAsyncExit()
       
    74     {
       
    75     LOG_ENTERFN("CBrowserAsyncExit::~CBrowserAsyncExit");                
       
    76     Cancel();
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 //	void CBrowserAsyncExit::ConstructL()
       
    81 //  Two-pase constructor
       
    82 // ---------------------------------------------------------------------------
       
    83 //    
       
    84 void CBrowserAsyncExit::ConstructL()
       
    85     {  
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 //	void CBrowserAsyncExit::Start()
       
    90 //  Complete an asynchronous request.
       
    91 // ---------------------------------------------------------------------------
       
    92 //    
       
    93 void CBrowserAsyncExit::Start()
       
    94     {
       
    95 	if ( !IsActive() )
       
    96 		{
       
    97 		LOG_ENTERFN("CBrowserAsyncExit::Start");  
       
    98 		TRequestStatus* status = &iStatus;
       
    99 		SetActive();    
       
   100 		User::RequestComplete( status, KErrNone );
       
   101 		}
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 //	void CBrowserAsyncExit::DoCancel()
       
   106 //  Cancel any outstanding requests.
       
   107 // ---------------------------------------------------------------------------
       
   108 //    
       
   109 void CBrowserAsyncExit::DoCancel()
       
   110     {
       
   111     LOG_ENTERFN("CBrowserAsyncExit::DoCancel");         
       
   112     }
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 //	void CBrowserAsyncExit::RunL()
       
   116 //  Handles object`s request completion event.
       
   117 // ---------------------------------------------------------------------------
       
   118 //    
       
   119 void CBrowserAsyncExit::RunL()
       
   120     {
       
   121     LOG_ENTERFN("CBrowserAsyncExit::RunL");     
       
   122     iApiProvider->ExitBrowser( EFalse ); // Exit the browser.
       
   123     }
       
   124 
       
   125 // End of file