sipplugins/sippsipsettingsui/src/gssipappshutter.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Exits the application when activated
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include    <aknview.h>
       
    22 #include 	<gsplugininterface.h>
       
    23 #include    "gssipappshutter.h"
       
    24 #include    "gssipsettingsplugin.hrh"
       
    25 #include    "gssippluginlogger.h"
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CGSSIPAppShutter::CGSSIPAppShutter
       
    31 // C++ default constructor can NOT contain any code, that
       
    32 // might leave.
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 CGSSIPAppShutter::CGSSIPAppShutter( 
       
    36     CGSPluginInterface* aAppUi ) : 
       
    37     CActive( EPriorityStandard ),
       
    38     iAppUi( aAppUi )
       
    39     {
       
    40     __GSLOGSTRING("CGSSIPAppShutter::CGSSIPAppShutter" )
       
    41     }
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CGSSIPAppShutter::ConstructL
       
    45 // Symbian 2nd phase constructor can leave.
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 void CGSSIPAppShutter::ConstructL()
       
    49     {
       
    50     __GSLOGSTRING("CGSSIPAppShutter::ConstructL" )
       
    51     CActiveScheduler::Add( this );
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CGSSIPAppShutter::NewL
       
    56 // Two-phased constructor.
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CGSSIPAppShutter* CGSSIPAppShutter::NewL( 
       
    60     CGSPluginInterface* aAppUi )
       
    61     {
       
    62     __GSLOGSTRING("CGSSIPAppShutter::NewL" )
       
    63     CGSSIPAppShutter* self = new ( ELeave ) CGSSIPAppShutter( aAppUi );
       
    64     
       
    65     CleanupStack::PushL( self );
       
    66     self->ConstructL();
       
    67     CleanupStack::Pop( self );
       
    68 
       
    69     return self;
       
    70     }
       
    71     
       
    72 // Destructor
       
    73 CGSSIPAppShutter::~CGSSIPAppShutter()
       
    74     {
       
    75     __GSLOGSTRING("CGSSIPAppShutter::~CGSSIPAppShutter" )
       
    76     Cancel();
       
    77     }
       
    78  
       
    79 // -----------------------------------------------------------------------------
       
    80 // CGSSIPAppShutter::RequestAppShutdown
       
    81 // Activates this active object
       
    82 // -----------------------------------------------------------------------------
       
    83 //        
       
    84 void CGSSIPAppShutter::RequestAppShutdown()
       
    85     {
       
    86     __GSLOGSTRING("CGSSIPAppShutter::RequestAppShutdown Start" )
       
    87     SetActive();
       
    88     TRequestStatus* status = &iStatus;
       
    89     User::RequestComplete( status, KErrNone );
       
    90     __GSLOGSTRING("CGSSIPAppShutter::RequestAppShutdown End" )
       
    91     }
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // CGSSIPAppShutter::DoCancel
       
    95 // Called when this active object is cancelled, does nothing
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 void CGSSIPAppShutter::DoCancel()    
       
    99     {    
       
   100     }
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // CGSSIPAppShutter::RunL()
       
   104 // Called when this active object request completion event occurs
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 void CGSSIPAppShutter::RunL()
       
   108     {
       
   109     __GSLOGSTRING("CGSSIPAppShutter::RunL" )
       
   110     iAppUi->HandleCommandL( EGSCmdAppShutterExit );    
       
   111     }
       
   112 
       
   113 //  End of File