mmsharing/mmshindicator/tsrc/IndicatorTestApp/src/IndicatorTestAppAppui.cpp
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     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 
       
    83             MultimediaSharingSettings::SetPopupNotificationSettingL( EPopupNotificationOn );
       
    84             break;
       
    85             }
       
    86         case EIndicatorTestAppSharingNotAvailable:
       
    87             {
       
    88             MultimediaSharingSettings::SetPopupNotificationSettingL( EPopupNotificationOff );
       
    89             break;
       
    90             }
       
    91         default:
       
    92             //Panic(EIndicatorTestAppBasicUi);
       
    93             break;
       
    94         }
       
    95 
       
    96 
       
    97     iIndicator->IndicateAvailabilityL();
       
    98     }
       
    99 
       
   100 
       
   101 void CIndicatorTestAppAppUi::StartLiveSharingL() 
       
   102     {
       
   103     // 
       
   104     TInt a;
       
   105     a = 0;
       
   106    // CRepository
       
   107     }
       
   108 
       
   109 void CIndicatorTestAppAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
       
   110     {
       
   111     if( aResourceId == R_INDICATORTESTAPP_MENU ) 
       
   112         {
       
   113         if( MultimediaSharingSettings::PopupNotificationSettingL() == EPopupNotificationOn )
       
   114             {
       
   115             aMenuPane->DeleteMenuItem( EIndicatorTestAppNoPopUpNotification );
       
   116             }
       
   117         else
       
   118             {
       
   119             aMenuPane->DeleteMenuItem( EIndicatorTestAppPopUpNotification );
       
   120             }
       
   121         if( MultimediaSharingSettings::AuditoryNotificationSettingL() == EAuditoryNotificationOn )
       
   122             {
       
   123             aMenuPane->DeleteMenuItem( EIndicatorTestAppNoAudiotoryNotification );
       
   124             }
       
   125         else
       
   126             {
       
   127             aMenuPane->DeleteMenuItem( EIndicatorTestAppAudiotoryNotification );
       
   128             }
       
   129         if( MultimediaSharingSettings::OperatorVariantSettingL() == EOperatorSpecific )
       
   130             {
       
   131             aMenuPane->DeleteMenuItem( EIndicatorTestAppDisableOperator );
       
   132             }
       
   133         else
       
   134             {
       
   135             aMenuPane->DeleteMenuItem( EIndicatorTestAppEnableOperator );
       
   136             }
       
   137 
       
   138         // Write some key for MainUI app
       
   139         aMenuPane->DeleteMenuItem( EIndicatorTestAppIconNotification );
       
   140         aMenuPane->DeleteMenuItem( EIndicatorTestAppNoIconNotification );
       
   141             
       
   142         }
       
   143     }