mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <avkon.hrh>
       
    19 #include <aknnotewrappers.h> 
       
    20 
       
    21 #include "IndicatorTestApp.pan"
       
    22 #include "IndicatorTestAppAppUi.h"
       
    23 #include "IndicatorTestAppAppView.h"
       
    24 #include "IndicatorTestApp.hrh"
       
    25 #include "indicatortestapp.rsg"
       
    26 
       
    27 #include "musindicatorapi.h"
       
    28 #include "mussettings.h"
       
    29 
       
    30 using namespace MusSettingsKeys;
       
    31 
       
    32 // ConstructL is called by the application framework
       
    33 void CIndicatorTestAppAppUi::ConstructL()
       
    34     {
       
    35     BaseConstructL();
       
    36 
       
    37     iAppView = CIndicatorTestAppAppView::NewL(ClientRect());    
       
    38 
       
    39     AddToStackL(iAppView);
       
    40     
       
    41     iIndicator = CMusIndicatorApi::NewL( *this );
       
    42     
       
    43     }
       
    44 
       
    45 CIndicatorTestAppAppUi::CIndicatorTestAppAppUi()                              
       
    46     {
       
    47 	// no implementation required
       
    48     }
       
    49 
       
    50 CIndicatorTestAppAppUi::~CIndicatorTestAppAppUi()
       
    51     {
       
    52     if (iAppView)
       
    53         {
       
    54         RemoveFromStack(iAppView);
       
    55         delete iAppView;
       
    56         iAppView = NULL;
       
    57         }
       
    58         
       
    59     delete iIndicator;        
       
    60     }
       
    61 
       
    62 // handle any menu commands
       
    63 void CIndicatorTestAppAppUi::HandleCommandL(TInt aCommand)
       
    64     {
       
    65     switch(aCommand)
       
    66         {
       
    67         case EEikCmdExit:
       
    68         case EAknSoftkeyExit:
       
    69             Exit();
       
    70             break;
       
    71 
       
    72         case EIndicatorTestAppEnableOperator:
       
    73             {
       
    74             _LIT(message,"Hello!");
       
    75             CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
       
    76             informationNote->ExecuteLD(message);
       
    77             }
       
    78             break;
       
    79             
       
    80         case EIndicatorTestAppSharingAvailable:
       
    81             {
       
    82             break;
       
    83             }
       
    84         case EIndicatorTestAppSharingNotAvailable:
       
    85             {
       
    86             break;
       
    87             }
       
    88         default:
       
    89             //Panic(EIndicatorTestAppBasicUi);
       
    90             break;
       
    91         }
       
    92 
       
    93 
       
    94     iIndicator->IndicateAvailabilityL();
       
    95     }
       
    96 
       
    97 
       
    98 void CIndicatorTestAppAppUi::StartLiveSharingL() 
       
    99     {
       
   100     // 
       
   101     TInt a;
       
   102     a = 0;
       
   103    // CRepository
       
   104     }
       
   105 
       
   106 void CIndicatorTestAppAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
       
   107     {
       
   108     if( aResourceId == R_INDICATORTESTAPP_MENU ) 
       
   109         {        
       
   110         if( MultimediaSharingSettings::AuditoryNotificationSettingL() == EAuditoryNotificationOn )
       
   111             {
       
   112             aMenuPane->DeleteMenuItem( EIndicatorTestAppNoAudiotoryNotification );
       
   113             }
       
   114         else
       
   115             {
       
   116             aMenuPane->DeleteMenuItem( EIndicatorTestAppAudiotoryNotification );
       
   117             }
       
   118         if( MultimediaSharingSettings::OperatorVariantSettingL() == EOperatorSpecific )
       
   119             {
       
   120             aMenuPane->DeleteMenuItem( EIndicatorTestAppDisableOperator );
       
   121             }
       
   122         else
       
   123             {
       
   124             aMenuPane->DeleteMenuItem( EIndicatorTestAppEnableOperator );
       
   125             }
       
   126 
       
   127         // Write some key for MainUI app
       
   128         aMenuPane->DeleteMenuItem( EIndicatorTestAppIconNotification );
       
   129         aMenuPane->DeleteMenuItem( EIndicatorTestAppNoIconNotification );
       
   130             
       
   131         }
       
   132     }