mpxmusicplayer/activeidle/aiplayerplugin/inc/aiplayerplugin.h
branchRCL_3
changeset 11 13afc0e517bd
parent 5 2a40e88564c8
child 13 a914e47e7a01
child 14 943ff5625028
equal deleted inserted replaced
5:2a40e88564c8 11:13afc0e517bd
     1 /*
       
     2 * Copyright (c) 2006-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:  AI ecom plugin class. Main interface to XML AI framework.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AIPLAYERPLUGIN_H
       
    20 #define C_AIPLAYERPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aicontentpublisher.h>
       
    24 #include <aicontentobserver.h>
       
    25 #include <aipropertyextension.h>
       
    26 #include <aieventhandlerextension.h>
       
    27 
       
    28 #include "aiplayerpluginengine.h"
       
    29 #include "aiplayerpluginengineobserver.h"
       
    30 
       
    31 class MAiPluginSettings;
       
    32 class MAiContentObserver;
       
    33 class MAiContentItemIterator;
       
    34 class CCoeEnv;
       
    35 
       
    36 
       
    37 /**
       
    38  *  Music Player Player Plugin.
       
    39  *  This class implements AI ecom plugin. This is the main interface to
       
    40  *  the XML AI framework.
       
    41  *
       
    42  *  @lib aiplayerplugin2.lib
       
    43  *  @since S60 5.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CAiPlayerPlugin ) : public CAiContentPublisher,
       
    46                                        public MAiPropertyExtension,
       
    47                                        public MAiEventHandlerExtension,
       
    48                                        public MAiPlayerPluginEngineObserver
       
    49     {
       
    50 public: // Constructors and destructor
       
    51 
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      */
       
    55     static CAiPlayerPlugin* NewL();
       
    56 
       
    57     /**
       
    58      * Destructor.
       
    59      */
       
    60     virtual ~CAiPlayerPlugin();
       
    61 
       
    62 public:
       
    63 
       
    64     /**
       
    65      * From CAiContentPublisher
       
    66      * See aicontentpublisher.h for detailed description.
       
    67      * @since S60 5.0
       
    68      */
       
    69     void Resume( TAiTransitionReason aReason );
       
    70     void Suspend( TAiTransitionReason aReason );
       
    71     void Stop( TAiTransitionReason aReason );
       
    72     void SubscribeL( MAiContentObserver& aObserver );
       
    73     void ConfigureL( RAiSettingsItemArray& aSettings );
       
    74     TAny* Extension( TUid aUid );
       
    75 
       
    76     /**
       
    77      * From MAiPropertyExtension
       
    78      * See aipropertyextension.h for detailed description.
       
    79      * @since S60 5.0
       
    80      */
       
    81     TAny* GetPropertyL( TInt aProperty );
       
    82     void SetPropertyL( TInt aProperty, TAny* aValue );
       
    83 
       
    84     /**
       
    85      * From MAiEventHandlerExtension
       
    86      * See aieventhandlerextension.h for detailed description.
       
    87      * @since S60 5.0
       
    88      */
       
    89     void HandleEvent( TInt aEvent, const TDesC& aParam );
       
    90 
       
    91     /**
       
    92      * From MAiPlayerPluginEngineObserver
       
    93      * See aiplayerpluginengine.h for detailed description.
       
    94      * @since S60 5.0
       
    95      */
       
    96     void PlayerStateChanged( TMPlayerState aState );
       
    97     void TrackInfoChanged( const TDesC& aTitle, const TDesC& aArtist );
       
    98     void PlaybackPositionChanged( TInt aPosition );
       
    99     void VolumeChanged( TInt aVolume );
       
   100 
       
   101 private:
       
   102 
       
   103     CAiPlayerPlugin();
       
   104     void ConstructL();
       
   105 
       
   106     /**
       
   107      * Helper class for HandleEvent received from MAiEventHandlerExtension
       
   108      */
       
   109     void DoHandleEventL( TInt aEvent, const TDesC& aParam );
       
   110 
       
   111     /**
       
   112      * Callback function invoked through iCleanTimer upon timeout.
       
   113      */
       
   114 	static TInt ClearL( TAny* aPtr );
       
   115 
       
   116 private:     // Data
       
   117 
       
   118     RPointerArray<MAiContentObserver>   iObservers;
       
   119     TAiPublisherInfo                    iInfo;
       
   120     MAiContentItemIterator*             iContent;
       
   121     MAiContentItemIterator*             iResources;
       
   122     MAiContentItemIterator*             iEvents;
       
   123 
       
   124     CAiPlayerPluginEngine*              iEngine;
       
   125     TMPlayerState          				iState;
       
   126 
       
   127     TBuf<128>                           iDuration;
       
   128     TBuf<128>                           iElapsedTime;
       
   129     HBufC*                              iLongFormatString;
       
   130     HBufC*                              iShortFormatString;
       
   131     HBufC*                              iUnknownArtistText;
       
   132     TInt                                iResourceOffset;
       
   133 
       
   134     CCoeEnv*                            iCoeEnv;                // Not owned
       
   135     TBool 								iPlayStarted;
       
   136     CPeriodic*  						iCleanTimer;
       
   137     TInt                                iLastSetVolume;
       
   138     };
       
   139 
       
   140 #endif  // C_AIPLAYERPLUGIN_H
       
   141 
       
   142