fmradio/fmradiomcpplugin/inc/fmradiomcpplugin.h
changeset 0 f3d95d9c00ab
child 20 97dcae98e602
equal deleted inserted replaced
-1:000000000000 0:f3d95d9c00ab
       
     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:  Declaration for the class CFMRadioMCPPlugin.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef FMRADIOMCPPLUGIN_H
       
    19 #define FMRADIOMCPPLUGIN_H
       
    20 
       
    21 #include <fmradiointernalpskeys.h>
       
    22 #include <mcpplugin.h>
       
    23 #include <mcppluginobserver.h>
       
    24 
       
    25 #include "fmradioactiveidleenginenotifyhandler.h"
       
    26 
       
    27 class CFMRadioActiveIdleEngine;
       
    28 class MFMRadioActiveIdleEngineNotifyHandler;
       
    29 
       
    30 /**
       
    31 * Music content publisher plugin for FM Radio.
       
    32 *
       
    33 * Implements MCP plugin which publishes FM Radio state to affected parties.
       
    34 * 
       
    35 * @lib fmradiomcpplugin100.lib
       
    36 * 
       
    37 */
       
    38 NONSHARABLE_CLASS( CFMRadioMCPPlugin ) : public CMCPPlugin,
       
    39                                          public MFMRadioActiveIdleEngineNotifyHandler
       
    40     {
       
    41 public:
       
    42     
       
    43     static CFMRadioMCPPlugin* NewL( MMCPPluginObserver* aObserver );
       
    44     ~CFMRadioMCPPlugin();
       
    45 
       
    46 // from base class CMCPPlugin
       
    47     void Deactivate();
       
    48 
       
    49 // from base class MFMRadioActiveIdleEngineNotifyHandler
       
    50     void HandleRadioVolumeChangeL( TInt aVolume );
       
    51     void HandleTuningStateChangeL( TFMRadioPSTuningState aTuningState );
       
    52     void HandleFrequencyChangeL( TInt aFrequency );
       
    53     void HandleChannelChangeL( TInt aId );
       
    54     void HandleChannelModifyL( TInt aId );
       
    55     void HandleMuteStateChangeL( TFMRadioPSRadioMuteState aMuteState );
       
    56     void HandleApplicationRunningStateChangeL( TFMRadioPSApplicationRunningState aRunningState );
       
    57     void HandleFrequencyDecimalCountChangeL( TFMRadioPSFrequencyDecimalCount aDecimalCount );
       
    58     void HandleAntennaStatusChangeL( TFMRadioPSHeadsetStatus aAntennaStatus );
       
    59     void HandlePowerStateChangeL( TFMRadioPSRadioPowerState aPowerState );
       
    60     void HandleRDSProgramServiceChangeL( const TDesC& aProgramService );
       
    61     void HandleRDSRadioTextChangeL( const TDesC& aRdsText );
       
    62     void HandleChannelNameChangeL( const TDesC& aName );
       
    63     void HandlePresetListCountChangeL( TInt aPresetCount );    
       
    64     void HandlePresetListFocusChangeL( TInt aPresetFocus );  
       
    65     
       
    66 private:
       
    67     void InstallFMRadioCommandActionL( const TDesC& aCommand, TMCPTriggerDestination aDestination );
       
    68     void ActivateL();
       
    69     void InstallEmptyActionL( TMCPTriggerDestination aDestination );
       
    70     void DimmNextAndPrevious();
       
    71     void PublishApplicationIconL( TMCPImageDestination aDestination );
       
    72     void PublishFrequencyL( TInt aFrequency, TMCPTextDestination aDestination );
       
    73     void UpdatePublishedToolBarL(TUint aToolBarState);
       
    74     void UpdateToolBarL( TBool aForceApplicationClosing = EFalse );    
       
    75     void UpdateMusicWidgetTextL( TBool aForceApplicationClosing = EFalse );
       
    76     
       
    77     /**
       
    78      * Transfers the given frequency number as a descriptor
       
    79      * @param aFrequency The frequency to be formatted
       
    80      * @return The frequency descriptor. Pushed to Cleanup Stack. Ownership is transfered.
       
    81      */
       
    82     HBufC* FrequencyStringLC( TInt aFrequency );
       
    83     
       
    84 private:
       
    85     CFMRadioMCPPlugin( MMCPPluginObserver* aObserver );
       
    86     void ConstructL();
       
    87     void InitializeResourceLoadingL();
       
    88 
       
    89 private:
       
    90     MMCPPluginObserver* iObserver;
       
    91 
       
    92     CFMRadioActiveIdleEngine* iEngine;
       
    93     TBool iActive;
       
    94     TInt iResourceOffset;
       
    95     RBuf iAntennaNotConnectedText;
       
    96     RBuf iTuningText;
       
    97     RBuf iSavedStationFormat;
       
    98     RBuf iSavedStationFormatNoName;
       
    99     RBuf iFrequencyFormat;
       
   100     
       
   101     RBuf iSavedStationFormatMenu;
       
   102     RBuf iSavedStationFormatNoNameMenu;
       
   103     RBuf iFrequencyFormatMenu;
       
   104     RBuf iNowPlayingText;
       
   105     RBuf iLastPlayedText;
       
   106     
       
   107     TUint iTbPreviousState;
       
   108     TUint iTbMuteUnmuteState;
       
   109     TUint iTbNextState;
       
   110     TInt iPresetCount;
       
   111 
       
   112     /**
       
   113      * Name of the mif-file that provides the published icons.
       
   114      * Owned.
       
   115      */
       
   116     RBuf iMifFileName;
       
   117     };
       
   118 
       
   119 #endif /* FMRADIOMCPPLUGIN_H */