messagingfw/senduiservices/launcher/src/senduilauncherappui.cpp
branchRCL_3
changeset 23 d51193d814ea
parent 0 8e480a14352b
equal deleted inserted replaced
22:d2c4c66342f3 23:d51193d814ea
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Server application for launching SendUi with low 
       
    15 *                capability requirements.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include <avkon.hrh>
       
    22 #include <akntitle.h>                   // CAknTitlePane
       
    23 #include <aknnotewrappers.h> 
       
    24 #include <sendui.h>
       
    25 
       
    26 #include "senduilauncherappui.h"
       
    27 #include "senduilauncher.hrh"
       
    28 #include "senduiserviceslog.h"
       
    29 
       
    30 // ======== LOCAL FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // Destructor
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CSendUiLauncherAppUi::~CSendUiLauncherAppUi()
       
    37     {
       
    38     delete iIdle;
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // Use SendUiImpl class to launch SendUi. Called from CSendUiService.
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 void CSendUiLauncherAppUi::CreateAndSendMessageL( 
       
    46         TUid aServiceUid, 
       
    47         CMessageData* aMessageData, 
       
    48         TBool aLaunchEmbedded )
       
    49     {
       
    50     LOGTEXT(_L("LauncherAppUi::CreateAndSendMessageL >>"));
       
    51     
       
    52     CSendUi* sendUi = CSendUi::NewL();
       
    53     CleanupStack::PushL( sendUi );
       
    54     sendUi->CreateAndSendMessageL(
       
    55         aServiceUid,
       
    56         aMessageData,
       
    57         KNullUid,
       
    58         aLaunchEmbedded );
       
    59      CleanupStack::PopAndDestroy( sendUi );
       
    60      LOGTEXT(_L("LauncherAppUi::CreateAndSendMessageL <<"));
       
    61      }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // Delayed exit is used for server app to exit automatically and properly.
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CSendUiLauncherAppUi::DoDelayedExitL( TInt aDelayTime )
       
    68     {
       
    69     LOGTEXT(_L("LauncherAppUi::DoDelayedExit >>"));
       
    70     delete iIdle;
       
    71     iIdle = 0;
       
    72     // Priority must be lower than the priority of iWrappedWaitDialog
       
    73     iIdle = CPeriodic::NewL( EPriorityNormal - 1);
       
    74     iIdle->Start(   aDelayTime,
       
    75                     aDelayTime, 
       
    76                     TCallBack( DelayedExit, this ));
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // Delayed exit is used for server app to exit properly.
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 TInt CSendUiLauncherAppUi::DelayedExit( TAny* aThis )
       
    84     {
       
    85     LOGTEXT(_L("CSendUiLauncherAppUi: DelayedExit >>"));
       
    86                 
       
    87     CSendUiLauncherAppUi* editor = static_cast<CSendUiLauncherAppUi*>( aThis );
       
    88     editor->Exit( );
       
    89     LOGTEXT(_L("LauncherAppUi::DelayedExit <<"));
       
    90     
       
    91     return KErrNone;
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // HandleCommandL
       
    96 // ---------------------------------------------------------------------------
       
    97 //   
       
    98 void CSendUiLauncherAppUi::HandleCommandL(TInt aCommand)
       
    99     {
       
   100     switch(aCommand)
       
   101        {
       
   102         case EEikCmdExit:  // fall through
       
   103         case EAknSoftkeyExit:
       
   104             Exit();
       
   105             break;
       
   106 
       
   107         default:
       
   108             break;
       
   109         }
       
   110     } 
       
   111 
       
   112 // ---------------------------------------------------------------------------
       
   113 // ConstructL
       
   114 // ---------------------------------------------------------------------------
       
   115 //
       
   116 void CSendUiLauncherAppUi::ConstructL()
       
   117     {
       
   118     LOGTEXT(_L("LauncherAppUi::ConstructL >>"));
       
   119                 
       
   120     BaseConstructL(ENoAppResourceFile);
       
   121     HideApplicationFromFSW( ETrue ); 
       
   122     
       
   123     // application name is shown, if not set otherwise
       
   124     _LIT( KEmptyText, "" );
       
   125     CAknTitlePane* title = static_cast<CAknTitlePane*>
       
   126     (StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle )));
       
   127     title->SetTextL( KEmptyText );
       
   128 
       
   129     LOGTEXT(_L("LauncherAppUi::ConstructL <<"));
       
   130     }
       
   131 
       
   132 
       
   133 // ---------------------------------------------------------------------------
       
   134 // Empty constructor
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 CSendUiLauncherAppUi::CSendUiLauncherAppUi()
       
   138     {
       
   139     }