fmradio/fmradio/inc/fmradioappui.h
branchRCL_3
changeset 20 93c594350b9a
equal deleted inserted replaced
19:cce62ebc198e 20:93c594350b9a
       
     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:  Definition of class FMRadioAppUi. Provides command
       
    15 *                      and callback interfaces to control the engine and the
       
    16 *                     application views.
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef FMRADIOAPPUI_H
       
    21 #define FMRADIOAPPUI_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <eikapp.h>
       
    25 #include <eikdoc.h>
       
    26 #include <e32std.h>
       
    27 #include <coeccntx.h>
       
    28 #include <aknViewAppUi.h>
       
    29 #include <coecntrl.h>
       
    30 #include <aknnotedialog.h>
       
    31 #include <aknnotewrappers.h>
       
    32 #include <iaupdateobserver.h>
       
    33 
       
    34 #include "fmradioenginestatechangecallback.h"
       
    35 #include "fmradioengine.h"
       
    36 #include "fmradiodefines.h"
       
    37 #include "fmradiosvkevents.h"
       
    38 #include "fmradioglobalconfirmationquery.h"
       
    39 #include "mchannellisthandler.h"
       
    40 
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CAknQueryDialog;
       
    44 class CFMRadioBackSteppingServiceWrapper;
       
    45 class CFMRadioDocument;
       
    46 class CFMRadioMainContainer;
       
    47 class CFMRadioScanLocalStationsView;
       
    48 class CFMRadioChannelListView;
       
    49 class CFMRadioMainView;
       
    50 class CEikMenuPane;
       
    51 class MFMRadioLayoutChangeObserver;
       
    52 class CAlfEnv;
       
    53 class CAknVolumePopup;
       
    54 class CAknInformationNote;
       
    55 class CAknGlobalNote;
       
    56 class CIAUpdate;
       
    57 class CIAUpdateParameters;
       
    58 class CFMRadioControlEventObserverImpl;
       
    59 class CRepository;
       
    60 // CLASS DECLARATION
       
    61 
       
    62 /**
       
    63 * Interface to tell when dialog was terminated
       
    64 *
       
    65 *    @since 2.6
       
    66 */
       
    67 class MInformationNoteInterface
       
    68     {
       
    69     public:
       
    70         /**
       
    71         * tells when dialog was terminated
       
    72         */
       
    73         virtual void DialogTerminated() = 0;
       
    74     };
       
    75 
       
    76 /**
       
    77 * Information note for headset key events. Enabling functionality to disable new dialog creation 
       
    78 * when dialog is active
       
    79 *
       
    80 *    @since 2.6
       
    81 */
       
    82 class CFMInformationNote: public CAknInformationNote
       
    83     {
       
    84     public:
       
    85     
       
    86         /**
       
    87         * default constructor.
       
    88         */
       
    89         CFMInformationNote( MInformationNoteInterface& aObserver);
       
    90         
       
    91         /**
       
    92         * Destructor.
       
    93         */
       
    94         virtual ~CFMInformationNote();
       
    95         
       
    96     private:
       
    97         
       
    98         // Dialog event observer
       
    99         MInformationNoteInterface& iDialogObserver;
       
   100     
       
   101     };
       
   102 
       
   103 /**
       
   104 * Instantiates the application views. It also acts as the default command handler for the
       
   105 *  application. Part of the standard application framework.
       
   106 *
       
   107 *    @since 2.6
       
   108 */
       
   109 
       
   110 class CFMRadioAppUi : public CAknViewAppUi,
       
   111                       public MFMRadioSvkEventsObserver,
       
   112                       public MCoeControlObserver,
       
   113                       private MRadioEngineStateChangeCallback,
       
   114                       private MFMRadioGlobalConfirmationQueryObserver,
       
   115                       private MInformationNoteInterface,
       
   116                       public MChannelListHandler,
       
   117                       public MIAUpdateObserver
       
   118                       
       
   119     {
       
   120     public:
       
   121         // Volume, seek, tune and channel changing directions
       
   122         enum TFMRadioDirections
       
   123             {
       
   124             EDirectionUp,
       
   125             EDirectionNone,
       
   126             EDirectionDown
       
   127             };
       
   128         
       
   129         enum TRadioState
       
   130             {
       
   131             EFMRadioStateOff = 0,            // Radio off
       
   132             EFMRadioStateOffForPhoneCall,    // Radio off because a phone call
       
   133             EFMRadioStateOffBeforePhoneCall, // Radio was off + phone call going on -> no resume
       
   134             EFMRadioStateOn,
       
   135             EFMRadioStateRecording,
       
   136             EFMRadioStateBusyRadioOn,
       
   137             EFMRadioStateBusyRadioOff,
       
   138             EFMRadioStateBusySeek,
       
   139             EFMRadioStateBusyMute,
       
   140             EFMRadioStateBusyVolume,
       
   141             EFMRadioStateBusyManualTune,
       
   142             EFMRadioStateBusyScanLocalStations,
       
   143             EFMRadioStateExiting
       
   144             };
       
   145 
       
   146     public: // Constructors and destructor
       
   147         /**
       
   148         * EPOC default constructor.
       
   149         */
       
   150         void ConstructL();
       
   151         
       
   152         /**
       
   153          * C++ default constructor.
       
   154          */
       
   155         CFMRadioAppUi();
       
   156         
       
   157         /**
       
   158         * Destructor.
       
   159         */
       
   160         virtual ~CFMRadioAppUi();
       
   161 
       
   162         /**
       
   163          * Utility method to select the right layout resource according to 
       
   164          * mirroring and orientation
       
   165          *
       
   166          * @param aNormalPortraitRes Normal portrait resource id
       
   167          * @param aMirroredPortraitRes Mirrored portrait resource id
       
   168          * @param aNormalLandscapeRes Normal landscape resource id
       
   169          * @param aMirroredLandscapeRes Mirrored landscape resource id
       
   170          * @return one of the resource id's passed to this method
       
   171          */
       
   172         TInt ChooseLayoutResource( const TInt aNormalPortraitRes, 
       
   173                 const TInt aMirroredPortraitRes,
       
   174                 const TInt aNormalLandscapeRes, 
       
   175                 const TInt aMirroredLandscapeRes ) const;
       
   176     public: // Functions from base classes
       
   177         
       
   178         /**
       
   179         * From CEikAppUi, takes care of command handling.
       
   180         * @since 2.6
       
   181         * @param aCommand command to be handled
       
   182         */
       
   183         void HandleCommandL( TInt aCommand );
       
   184 
       
   185         /**
       
   186         * Notification interface from RadioEngine. Used to inform
       
   187         * us when requests have completed.
       
   188         * @since 2.6
       
   189         * @param aEventCode code corresponding to the event being propogated
       
   190         * @param aErrorCode error code of the event being propogated
       
   191         */
       
   192         void HandleRadioEngineCallBack( MRadioEngineStateChangeCallback::TFMRadioNotifyEvent aEventCode, TInt aErrorCode );
       
   193     public: // new functions 
       
   194         /**
       
   195         * Returns a pointer to the radio engine
       
   196         *
       
   197         * @return Radio engine
       
   198         */
       
   199         CRadioEngine* RadioEngine();
       
   200 
       
   201         /**
       
   202          * Returns a reference to Back Stepping wrapper
       
   203          * 
       
   204          * @return Reference to Back Stepping wrapper
       
   205          */
       
   206         CFMRadioBackSteppingServiceWrapper& BackSteppingWrapper() const;
       
   207 
       
   208         /**
       
   209          * Returns a pointer to FMRadio's document, cannot be null.
       
   210          *
       
   211          * @return A pointer to a CFMRadioDocument object.
       
   212          */
       
   213         CFMRadioDocument* Document() const;
       
   214         /**
       
   215         * Checks if current screen orientation is landscape
       
   216         *
       
   217         * @return ETrue if orientation is landscape, otherwise EFalse
       
   218         */
       
   219         TBool IsLandscapeOrientation() const;
       
   220 
       
   221         /**
       
   222         * Handles offline mode at startup.
       
   223         */
       
   224         void HandleOfflineModeAtStartUpL();
       
   225 
       
   226         /**
       
   227         * Handles start up foreground event.
       
   228         */		
       
   229         void HandleStartupForegroundEventL();
       
   230         /**
       
   231         * Nunber of channels stored in presets.
       
   232         * @return number of channels in presets
       
   233         */ 
       
   234         TInt NumberOfChannelsStored() const;
       
   235         /**
       
   236         * Returns the UID of the currently active local view. KNullUid if none 
       
   237         * active (construction/destruction).
       
   238         * @return UID of the currently active local view, KNullUid if none 
       
   239         * active.
       
   240         */
       
   241         TUid ActiveView() const;
       
   242         /**
       
   243         * Return startup scanning wizard status.
       
   244         * @return running status
       
   245         */
       
   246         TBool IsStartupWizardRunning() const;
       
   247         /**
       
   248         * Set startup scanning wizard status.
       
   249         * @param aRunningState running state
       
   250         */
       
   251         void SetStartupWizardRunning( const TBool aRunningState );
       
   252         /**
       
   253         * Tune to the specified frequency
       
   254         * @since 2.6
       
   255         * @param aFrequency the frequency to be tuned
       
   256         */
       
   257         void TuneL(TInt aFrequency);
       
   258         /**        
       
   259         * @return mirrored layout state
       
   260         */
       
   261         TBool IsLayoutMirrored() const;
       
   262         /**
       
   263         * Show currently active volume popup control
       
   264         */
       
   265         void ShowVolumePopupL();
       
   266 
       
   267         /**
       
   268          * From MChannelListHandler 
       
   269          * Updates channels array in appui 
       
   270          * @param aOperation tells which operation is made to array
       
   271          * @param aIndex tells affecting index
       
   272          * @param aMovedToNewIndex optional during move operation
       
   273          */
       
   274         void UpdateChannelsL( TMoveoperations aOperation, 
       
   275                 TInt aIndex, 
       
   276                 TInt aMovedToNewIndex  );
       
   277 
       
   278         /**
       
   279          * From MChannelListHandler
       
   280          * Add a new channel to list of channels
       
   281          * @param aChannelName Name of the channel to be saved
       
   282          * @param aChannelFreq Channel frequency
       
   283          */
       
   284         void AddChannelToListL( const TDesC& aChannelName, TInt aChannelFreq );
       
   285 
       
   286         /**
       
   287          * From MChannelListHandler
       
   288          * Accessory method to channels array
       
   289          */
       
   290          RPointerArray<CFMRadioPreset>& Channels();
       
   291 
       
   292         void AutoTuneInMainView ( TBool aTune );
       
   293         /**
       
   294          * status of the startup wizard state
       
   295          * @return wizard status
       
   296          */
       
   297         TBool IsStartupWizardHandled() const;
       
   298         /**
       
   299         * Return the index of the first channel that matches the 
       
   300         * frequency specified.
       
   301         * @since 2.6
       
   302         * @param aFrequency The frequency to match against
       
   303         * @return the index of the channel whose frequency matched.
       
   304         *         -1 if no frequency matched.
       
   305         */
       
   306         TInt MatchingChannelL( TInt aFrequency );
       
   307         
       
   308         /**
       
   309         * Erase a channel
       
   310         * @param aIndex index to delete
       
   311         * @return ETrue if user accepted delete, otherwise EFalse
       
   312         */
       
   313         TBool EraseChannelL( TInt aIndex );
       
   314 
       
   315         /*
       
   316          * Returns a pointer to the currently active volume popup control
       
   317          * @return active volume popup
       
   318          */
       
   319         CAknVolumePopup* ActiveVolumePopup() const;
       
   320         
       
   321         /*
       
   322          * Get current radio state.
       
   323 		 * @return TRadioState state of the radio
       
   324          */
       
   325         CFMRadioAppUi::TRadioState CFMRadioAppUi::RadioState() const;
       
   326 
       
   327     protected:
       
   328         /**
       
   329         * From CEikAppUi HandleWsEventL
       
   330         */
       
   331         void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
       
   332 
       
   333         /**
       
   334         * From base class CCoeAppUi    
       
   335         */
       
   336         void HandleForegroundEventL( TBool aForeground );
       
   337 
       
   338     private: // Functions from base classes
       
   339         /**
       
   340         * Handles a change to the application's resources
       
   341         * @param aType The type of changed resource
       
   342         */
       
   343         void HandleResourceChangeL( TInt aType );
       
   344         /**
       
   345         * Updates the landscape data. This is done separately 
       
   346         * and not in IsLandscapeOrientation method as
       
   347         * IsLandscapeOrientation MUST NOT do a window server flush
       
   348         */
       
   349         void UpdateLandscapeInformation();
       
   350      private: // new functions
       
   351 
       
   352         /**
       
   353         * All leaving function calls are made here, so that nothing is left on the stack if the ConstructL leaves
       
   354         * The reason for this behaviour is that the UI framework doesn't handle leaves from the AppUi correctly.
       
   355         */
       
   356         void SecondaryConstructL();
       
   357         /**
       
   358         * Perform object cleanup. This would normally be performed in the destructor, but since it can also be
       
   359         * called from SecondaryConstructL it was moved into a seperate function.
       
   360         */
       
   361         void Cleanup();
       
   362         /**
       
   363         * Handles callback from engine
       
   364         * @since 3.0
       
   365         */
       
   366         void HandleInitializedCallbackL();
       
   367         /**
       
   368         * Updates radio volume level by one step at time.
       
   369         * @since 2.6
       
   370         * @param aDirection Parameter is interpreted as
       
   371         *        following: 1 = increase volume, 0 = no change,
       
   372         *        -1 = decrease volume.
       
   373         */
       
   374         void UpdateVolume( CFMRadioAppUi::TFMRadioDirections aDirection );
       
   375         /**
       
   376         * Perform automatic tuning to the next available audible frequency
       
   377         * @since 2.6
       
   378         */
       
   379         void ScanUpL();
       
   380         /**
       
   381         * Perform automatic tuning to the last available audible frequency
       
   382         * @since 2.6
       
   383         */
       
   384         void ScanDownL();
       
   385         /**
       
   386         * Save currently tuned frequency to the currently selected channel
       
   387         * @since 2.6
       
   388         * @param aIndex the index of the slot to save the channel to.
       
   389         */
       
   390         void SaveChannelL( TInt aIndex );
       
   391         /**
       
   392         * Tune the radio hardware to the frequency saved at the specified channel
       
   393         * @since 2.6
       
   394         * @param aIndex index of channel to tune to
       
   395         */
       
   396         void PlayChannel( TInt aIndex );
       
   397         /**
       
   398         * Set the audio output of the radio, and update the UI
       
   399         * @since 2.6
       
   400         * @param aAudioOutput the audio output (headset or IHF)
       
   401         */
       
   402         void SetAudioOutput( CRadioEngine::TFMRadioAudioOutput aAudioOutput );
       
   403         /**
       
   404         * Cancel outstanding seek request
       
   405         * @since 2.6
       
   406         */
       
   407         void CancelSeek();
       
   408         /**
       
   409         * Shutdown the application.
       
   410         * @since 2.6
       
   411         */
       
   412         void ExitApplication();
       
   413         /**
       
   414         * Rename the currently selected channel
       
   415         * @since 2.6
       
   416         */
       
   417         void RenameCurrentChannelL();
       
   418         /**
       
   419         * Display confirmation dialog for channel deletion
       
   420         * @param aIndex the index of the channel to delete
       
   421         */
       
   422         TBool ConfirmChannelListDeleteL( TInt aIndex );
       
   423         /**
       
   424         * Saves channel to be last item in channels list
       
   425         * @since 2.6
       
   426         */
       
   427         void SaveChannelToLastIntoListL();
       
   428         /**
       
   429         * Displays an error note with the text contained in the passed in reference
       
   430         * @since 2.6
       
   431         * @param aErrorNote id of the text to display in the error note
       
   432         */
       
   433         void DisplayErrorNoteL( TInt aErrorNote );
       
   434 
       
   435         /**
       
   436         * Displays an information note with the text contained in the passed in reference
       
   437         * @since 2.6
       
   438         * @param aInfoNote id of the text to display in the error note
       
   439         */
       
   440         void DisplayInformationNoteL( TInt aInfoNote );
       
   441 
       
   442         /**
       
   443         * Return the numeric key value corresponding to the key code
       
   444         * @since 2.6
       
   445         * @param aCode the Symbian key code
       
   446         * @return the numeric key value
       
   447         */
       
   448         TInt NumericKeyValue( TUint aCode );
       
   449         /**
       
   450         * Turn the fm radio hardware on
       
   451         * @since 2.6
       
   452         */
       
   453         void TurnRadioOn();
       
   454         /**
       
   455         * Processes "seek operation completed" callback
       
   456         * @since 2.6
       
   457         */
       
   458         void HandleStopSeekCallback();
       
   459         /**
       
   460         * Processes "set mute state" callback
       
   461         * @since 2.6
       
   462         */
       
   463         void HandleSetMuteStateCallback();
       
   464         /**
       
   465         * Processes "volume changed" callback
       
   466         * @since 2.6
       
   467         */
       
   468         void HandleVolumeChangedCallback();
       
   469         /**
       
   470         * Processes "set audio output completed" callback
       
   471         * @since 2.6
       
   472         */
       
   473         void HandleAudioOutputSetCallback();
       
   474         /**
       
   475         * Processes "headset reconnected" callback
       
   476         * @since 2.6
       
   477         */
       
   478         void HandleHeadsetReconnectedCallback();
       
   479         /**
       
   480         * Processes "headset disconnected" callback
       
   481         * @since 2.6
       
   482         */
       
   483         void HandleHeadsetDisconnectedCallback();
       
   484         /**
       
   485         * Processes "flightmode disabled" callback
       
   486         * @since 2.6
       
   487         */
       
   488         void HandleFlightmodeDisabledCallback();
       
   489         /**
       
   490         * Processes "volume update failed" callback
       
   491         * @since 2.6
       
   492         */
       
   493         void HandleVolumeUpdateFailedCallback();
       
   494         /**
       
   495         * Handles mute keypress from main view
       
   496         * 
       
   497         */
       
   498         void HandleMuteCommand();
       
   499         /**
       
   500         * Processes "manual tune failed" callback
       
   501         * @since 2.6
       
   502         */
       
   503         void HandleManualTuneFailedCallback();
       
   504         /**
       
   505         * Processes audio resource not available
       
   506         * @since 3.0
       
   507         */
       
   508         void HandleAudioResourceNotAvailableL(TInt aErrorCode);
       
   509 
       
   510         /**
       
   511         * Processes audio resource available
       
   512         * @since 3.0
       
   513         */
       
   514         void HandleAudioResourceAvailableL();
       
   515 
       
   516         /**
       
   517         * Processes FM Transmitter on.
       
   518         * @since 3.2
       
   519         */
       
   520         void HandleFMTransmitterOnCallbackL();
       
   521 
       
   522         /**
       
   523         * Processes Frequency range changed.
       
   524         * @since 3.2
       
   525         */
       
   526         void HandleFreqRangeChangedCallback();
       
   527 
       
   528         /**
       
   529         * Processes Frequency range changed.
       
   530         * @since 3.2
       
   531         */
       
   532         void HandleFlightModeEnabledCallbackL();
       
   533 
       
   534         /**
       
   535         * Handle flight mode disabled.
       
   536         * @since 3.2
       
   537         */
       
   538         void HandleFlightModeDisabledCallback();
       
   539 
       
   540         /**
       
   541         * Processes Frequency range changed.
       
   542         * @since 3.2
       
   543         */
       
   544         void HandleTunerReadyCallback();
       
   545 
       
   546         /**
       
   547  		* Get region automatically from network or manually by user choice if network
       
   548         * is not available
       
   549         */
       
   550         TFMRadioRegionSetting HandleRegionsAtStartUpL();
       
   551         
       
   552         /**
       
   553         * Is offline profile activated when radio audio was disabled.
       
   554         * @return ETrue, if offline profile activated when radio 
       
   555         * audio was disabled. EFalse otherwise.
       
   556         */
       
   557         TBool IsOfflineProfileActivatedWhenRadioAudioDisabled() const;
       
   558 
       
   559         /**
       
   560         * Sets the toolbar visibility.
       
   561         * @param aVisible 
       
   562         */ 
       
   563         void ShowToolbar( TBool aVisible );
       
   564 
       
   565         /**
       
   566         * Determine if scan all local stations view should be started
       
   567         * in wizard mode
       
   568         */
       
   569         void HandleStartupWizardL();
       
   570 
       
   571         /**
       
   572         * Start local stations scan
       
   573         */        
       
   574         void StartLocalStationsSeekL();
       
   575 
       
   576         /**
       
   577         * Tries to start radio again if the situation allows it
       
   578         */        
       
   579         void TryToResumeAudioL();
       
   580         /**
       
   581         * Fade and show exit on all views
       
   582         */        
       
   583         void FadeViewsAndShowExit( TBool aState );
       
   584 
       
   585         /*
       
   586         * Show connect headset query with only exit softkey
       
   587         */
       
   588         void ShowConnectHeadsetDialogL();
       
   589 
       
   590         /*
       
   591          * Get help context based on active view
       
   592          * @return array containing help context for active view
       
   593         */
       
   594         CArrayFix<TCoeHelpContext>* GetCurrentHelpContextL() const;
       
   595 
       
   596         /**
       
   597         * A call back function for processing start up foreground event. 
       
   598         *
       
   599         * @param aSelfPtr  Pointer to self.
       
   600         * @return Always 0.
       
   601         */
       
   602         static TInt StaticStartupForegroundCallback( TAny* aSelfPtr );
       
   603     private:
       
   604         /**
       
   605         * Called when volume level should be changed.
       
   606         * Set volume control visible.
       
   607         * @param aVolumeChange: +1 change volume up
       
   608         *                       -1 change volume down
       
   609         */
       
   610         void FMRadioSvkChangeVolumeL( TInt aVolumeChange );
       
   611         /**
       
   612         * Called when volume was changed last time 2 seconds ago or
       
   613         * timer was started 2 seconds ago. The remove control timer
       
   614         * is started when ChangeVolumeL() is called
       
   615         * or when started through CMmsSvkEvents::StartRemoveTimerL()
       
   616         */
       
   617         void FMRadioSvkRemoveVolumeL( );
       
   618         void FMRadioHeadsetEvent(TAccessoryEvent aEvent);
       
   619         /**
       
   620          * From MFMRadioGlobalConfirmationQueryObserver
       
   621          * 
       
   622          * @see MFMRadioGlobalConfirmationQueryObserver::GlobalConfirmationQueryDismissedL(TInt aSoftKey)
       
   623          */
       
   624         void GlobalConfirmationQueryDismissedL( TInt aSoftKey );
       
   625         /**
       
   626         *From MCoeControlObserver. To handle the volume events.
       
   627         */
       
   628         void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
       
   629         /**
       
   630         * From MInformationNoteInterface. To handle dialog terminated events.
       
   631         */
       
   632         void DialogTerminated();
       
   633         /**
       
   634         * Gets the Channels array
       
   635         */
       
   636         void GetChannelsArrayL();
       
   637         /**
       
   638         * Check available IAD updates
       
   639         */
       
   640         void HandleIADUpdateCheckL();
       
   641         // from base class MIAUpdateObserver
       
   642         void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
   643         void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   644         void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow );
       
   645 
       
   646         /**
       
   647          * Processes the tail of the command
       
   648          * @param aTail The tail to be processed
       
   649          */
       
   650         void ProcessCommandTailL( const TDesC8& aTail );
       
   651 
       
   652         // from base class CEikAppUi	
       
   653         MCoeMessageObserver::TMessageResponse HandleMessageL(
       
   654             TUint32 aClientHandleOfTargetWindowGroup, 
       
   655             TUid aMessageUid, 
       
   656             const TDesC8& aMessageParameters );
       
   657 
       
   658         TBool ProcessCommandParametersL( TApaCommand aCommand, 
       
   659                                          TFileName& aDocumentName, 
       
   660                                          const TDesC8& aTail );
       
   661 
       
   662         /**
       
   663         * Check if Active Idle app is on foreground.
       
   664         *
       
   665         * @return ETrue if idle app is in the foreground, EFalse otherwise.
       
   666         */
       
   667         TBool IsIdleAppForeground();
       
   668 
       
   669         /**
       
   670         * Check if Active Idle is enabled.
       
   671         *
       
   672         * @return ETrue if active idle is in the enabled, EFalse otherwise.
       
   673         */
       
   674         TBool IsActiveIdleEnabled();
       
   675 
       
   676         /**
       
   677          * Handles the possibly pending view activation 
       
   678          */
       
   679         void HandlePendingViewActivationL();
       
   680 
       
   681     private:
       
   682             
       
   683         /**
       
   684          * State to indicate the mute status
       
   685          */
       
   686         enum TFMMuteStatus
       
   687             {
       
   688             EFMUninitialized = 0,       // Uninitialized value
       
   689             EFMUnmuted,                 // Unmute state
       
   690             EFMMuted                    // Mute state
       
   691             };
       
   692 
       
   693         // System's volume indicator
       
   694         CAknVolumePopup* iIhfVolumePopupControl;
       
   695         CAknVolumePopup* iHeadsetVolumePopupControl;
       
   696         CAknVolumePopup* iActiveVolumePopupControl;
       
   697                         
       
   698         CRadioEngine*   iRadioEngine;
       
   699         TRadioState iCurrentRadioState;
       
   700         CFMRadioScanLocalStationsView* iScanLocalStationsView;
       
   701         CFMRadioChannelListView* iChannelListView;
       
   702         CFMRadioMainView* iMainView;
       
   703         //all the possible radio UI states
       
   704         TInt iFMRadioVariationFlags;
       
   705         CFMRadioSvkEvents*   iSvkEvents;
       
   706         TBool iAlreadyClean;
       
   707         MFMRadioLayoutChangeObserver* iLayoutChangeObserver;
       
   708         CFMRadioControlEventObserverImpl* iControlEventObserver;
       
   709         /**
       
   710         * Is audio resources available
       
   711         */
       
   712         TBool iAudioResourceAvailable;
       
   713         
       
   714         /**
       
   715         * Was audio lost "permanently" due to another music playing application?
       
   716         */
       
   717         TBool iAudioLost;
       
   718         
       
   719         /**
       
   720         * Global offline query. Owned
       
   721         */
       
   722         CFMRadioGlobalConfirmationQuery* iGlobalOfflineQuery;
       
   723         
       
   724         /**
       
   725         * Local activate offline query. Owned
       
   726         */  
       
   727         CAknQueryDialog* iLocalActivateOfflineQuery;
       
   728         
       
   729         /**
       
   730         * Local continue offline query. Owned
       
   731         */
       
   732         CAknQueryDialog* iLocalContinueOfflineQuery;
       
   733         
       
   734         /**
       
   735         * Is offline profile activated when radio audio was disabled.
       
   736         */
       
   737         TBool iOfflineProfileActivatedWhenRadioAudioDisabled;
       
   738         
       
   739         /**
       
   740         * Is the local "continue in offline" query visible.
       
   741         */
       
   742         TBool iShowingLocalOfflineContinueQuery;
       
   743         
       
   744         /**
       
   745         * Is the local or global offline query activated.
       
   746         */
       
   747         TBool iOfflineQueryDialogActivated;
       
   748         
       
   749         /** 
       
   750          * Is the start up of application ongoing.
       
   751          */
       
   752         TBool iStartUp;
       
   753         
       
   754         /**
       
   755         * Is the screen orientation landscape
       
   756         */
       
   757         TBool iLandscape;
       
   758         CAlfEnv* iAlfEnv; // Owned
       
   759         // flag to indicate wizard handling
       
   760         TBool iStartupWizardHandled;
       
   761         // flag for startup wizard status
       
   762         TBool iStartupWizardRunning;
       
   763         // connect headset query
       
   764         CAknQueryDialog* iConnectHeadsetQuery;
       
   765         // flag to indicate if automatic tune is activated from startup wizard
       
   766         TBool iTuneFromWizardActivated;
       
   767         // akn information note ptr to check that dialog has dismissed from display
       
   768         TBool iInfoNoteOn;
       
   769         // global note for headset status when radio is background
       
   770         CAknGlobalNote* iConnectHeadsetGlobalNote;
       
   771         // flag for previous mute status 
       
   772         TFMMuteStatus iMuteStatusBeforeRadioInit;
       
   773         // Channels list
       
   774         RPointerArray<CFMRadioPreset> iChannels;
       
   775         // IAD client object. Owned.
       
   776         CIAUpdate* iUpdate;
       
   777         // Parameters for IAD update. Owned.
       
   778         CIAUpdateParameters* iParameters;
       
   779         // The backstepping wrapper. Owned.
       
   780         CFMRadioBackSteppingServiceWrapper* iBsWrapper;
       
   781         // Is feature manager initialized, used for uninitializing feature manager
       
   782         TBool iFeatureManagerInitialized;
       
   783         // own, for active idle setting
       
   784         CRepository* iSettingsRepository;
       
   785         // Callback for processing start up foreground event. 
       
   786         CAsyncCallBack* iStartupForegroundCallback;
       
   787         // The view id of the view that is to be activated when possible
       
   788         TUid iPendingViewId;
       
   789         // Boolean for region change, force rescanning
       
   790         TBool iRegionChanged;
       
   791     };
       
   792 
       
   793 #endif
       
   794 
       
   795 // End of File