srsf/vcexecutorapp/src/vcexecutorappui.cpp
branchRCL_3
changeset 19 e36f3802f733
parent 0 bf1d17376201
equal deleted inserted replaced
18:cad71a31b7fc 19:e36f3802f733
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  vcexecutorapp application UI class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <aknenv.h>
       
    21 #include <akntitle.h>
       
    22 #include <f32file.h>
       
    23 #include <apgwgnam.h>
       
    24 #include <AknSgcc.h>
       
    25 #include <data_caging_path_literals.hrh>
       
    26 
       
    27 #include <vcexecutorapp.rsg>
       
    28 
       
    29 #include "vcexecutorappui.h"
       
    30 #include "appcontroller.h"
       
    31 #include "rubydebug.h"
       
    32 
       
    33 
       
    34 // ============================ MEMBER FUNCTIONS ===============================
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CVCExecutorAppUi::ConstructL
       
    38 // Symbian 2nd phase constructor can leave.
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 void CVCExecutorAppUi::ConstructL()
       
    42     {
       
    43     RUBY_DEBUG_BLOCKL( "CVCExecutorAppUi::ConstructL" );
       
    44     
       
    45     // Remember the idle status pane resource id
       
    46     iInitialStatuspaneResourceId = CAknSgcClient::CurrentStatuspaneResource();
       
    47 
       
    48    
       
    49     // Cannot set ENoScreenFurniture here since after that StatusPane() function
       
    50     // returns NULL. "Voice mailbox" command requires status pane to be available
       
    51     // when executing.
       
    52     // ENoAppResourceFile seems to have no effect -> not setting that either
       
    53     BaseConstructL( EAknEnableSkin | EAknEnableMSK /*ENoScreenFurniture*/ );
       
    54 
       
    55     // Set the title pane text to empty so that the default "vcexecutorapp" text
       
    56     // won't be shown when activating applications.
       
    57     CAknTitlePane* title =
       
    58         static_cast<CAknTitlePane*>( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
    59         
       
    60     TResourceReader rReader;
       
    61     iCoeEnv->CreateResourceReaderLC( rReader, R_EMPTY_TITLE_PANE );
       
    62     title->SetFromResourceL( rReader );
       
    63     CleanupStack::PopAndDestroy(); // rReader
       
    64 
       
    65     // Set this as system application    
       
    66     iEikonEnv->SetSystem( ETrue );
       
    67     
       
    68     UpdateStatusPaneL();
       
    69     }
       
    70     
       
    71 // -----------------------------------------------------------------------------
       
    72 // CVCExecutorAppUi::~CVCExecutorAppUi
       
    73 // Destructor
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 CVCExecutorAppUi::~CVCExecutorAppUi()
       
    77     {  
       
    78     }
       
    79     
       
    80 // -----------------------------------------------------------------------------
       
    81 // CVCExecutorAppUi::EikonEnv
       
    82 // Returns the CEikonEnv
       
    83 // -----------------------------------------------------------------------------
       
    84 //    
       
    85 CEikonEnv* CVCExecutorAppUi::EikonEnv() const
       
    86     {
       
    87     return iEikonEnv;
       
    88     }    
       
    89     
       
    90 // -----------------------------------------------------------------------------
       
    91 // CVCExecutorAppUi::UpdateStatusPaneL
       
    92 // Switch to initial status pane
       
    93 // -----------------------------------------------------------------------------
       
    94 //     
       
    95 void CVCExecutorAppUi::UpdateStatusPaneL()
       
    96     {
       
    97     RUBY_DEBUG_BLOCKL( "CVCExecutorAppUi::UpdateStatusPaneL" );
       
    98     
       
    99     // Use same status pane as idle has
       
   100     StatusPane()->SwitchLayoutL( iInitialStatuspaneResourceId );
       
   101     
       
   102     // Title pane is set as empty
       
   103     CAknTitlePane* title = static_cast<CAknTitlePane*> ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
       
   104     title->SetTextL( KNullDesC );
       
   105     
       
   106     StatusPane()->MakeVisible( EFalse ); 
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CVCExecutorAppUi::HandleScreenDeviceChangedL
       
   111 // Empty implementation to prevent crash when changing screen resolution
       
   112 // -----------------------------------------------------------------------------
       
   113 //     
       
   114 void CVCExecutorAppUi::HandleScreenDeviceChangedL()
       
   115     {
       
   116     CAknAppUi::HandleScreenDeviceChangedL();
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CVCExecutorAppUi::HandleCommandL
       
   121 // Handle events from app framework
       
   122 // -----------------------------------------------------------------------------
       
   123 //      
       
   124 void CVCExecutorAppUi::HandleCommandL( TInt aCommand )
       
   125     {
       
   126     switch ( aCommand )
       
   127         {
       
   128         case EAknSoftkeyExit:
       
   129         case EAknSoftkeyBack:
       
   130         case EEikCmdExit:
       
   131             {
       
   132             Exit();
       
   133             break;
       
   134             }
       
   135 
       
   136         default:
       
   137             break;
       
   138         }
       
   139     }
       
   140     
       
   141 // -----------------------------------------------------------------------------
       
   142 // CVCExecutorAppUi::ProcessCommandParametersL
       
   143 //
       
   144 // -----------------------------------------------------------------------------
       
   145 //         
       
   146 TBool CVCExecutorAppUi::ProcessCommandParametersL( CApaCommandLine& aCommandLine )
       
   147     {
       
   148     RUBY_DEBUG_BLOCKL( "CVCExecutorAppUi::ProcessCommandParametersL" );
       
   149     
       
   150     TPtrC8 argumentPtr( aCommandLine.TailEnd() );
       
   151     
       
   152     // Convert argument to TInt
       
   153     TLex8 lex( argumentPtr );
       
   154     TInt commandId;
       
   155     User::LeaveIfError( lex.Val( commandId ) );
       
   156     
       
   157     // Execute command with CVCApplicationController
       
   158     CVCApplicationControllerImpl* appController = CVCApplicationControllerImpl::NewL();
       
   159     CleanupStack::PushL( appController );
       
   160     appController->ExecuteCommandL( commandId, KNullDesC );
       
   161     
       
   162     CleanupStack::PopAndDestroy( appController );
       
   163     
       
   164     // Exit application
       
   165     Exit();
       
   166     
       
   167     return EFalse;
       
   168     }
       
   169     
       
   170 //  End of File