musicplayer_plat/music_content_publisher_plugin_api/inc/mcppluginobserver.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:  Manages MCP plugins, and content publishing.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_MCPPLUGINOBSERVER_H
       
    20 #define M_MCPPLUGINOBSERVER_H
       
    21 
       
    22 class CLiwDefaultMap;
       
    23 class CMCPPlugin;
       
    24 class TAknsItemID;
       
    25 
       
    26 
       
    27 /**
       
    28  * Music Widget and Music Suite Image Destinations.
       
    29  * 
       
    30  * 9.1 Music Widget has two panels, The left panel contains an image:
       
    31  * TMCPImageDestination:EMusicWidgetImage1.
       
    32  * If we publish an empty image here the default icon will be displayed.
       
    33  * The right panel contains a toolbar with 3 buttons:
       
    34  * TMCPImageDestination:EMusicWidgetToolbarB1, 
       
    35  * TMCPImageDestination:EMusicWidgetToolbarB2,
       
    36  * TMCPImageDestination:EMusicWidgetToolbarB3.
       
    37  * 
       
    38  * 9.1 Music Suite has a top row that displays information about the current
       
    39  * playing and last played. This row contains an image:
       
    40  * TMCPImageDestination:EMusicMenuMusicInfoImage1
       
    41  */
       
    42 enum TMCPImageDestination
       
    43     {
       
    44      EMusicWidgetImage1 = 1000
       
    45      ,EMusicWidgetToolbarB1
       
    46      ,EMusicWidgetToolbarB2
       
    47      ,EMusicWidgetToolbarB3
       
    48      
       
    49      ,EMusicMenuMusicInfoImage1 = 1100
       
    50     };
       
    51 
       
    52 /**
       
    53  * Music Widget and Music Suite Text Destinations.
       
    54  * 
       
    55  * 9.1 Music Widget has two panels, The right panel contains two text items:
       
    56  * TMCPTextDestination:EMusicWidgetText1, 
       
    57  * TMCPTextDestination:EMusicWidgetDefaultText.
       
    58  * If we publish a EMusicWidgetDefaultText the toolbar will not be displayed.
       
    59  * To show the toolbar and the text information row : EMusicWidgetText1 we 
       
    60  * should publish empty text to the EMusicWidgetDefaultText
       
    61  * 
       
    62  * 9.1 Music Suite has a top row that displays information about the current
       
    63  * playing and last played. This row contains two lines:
       
    64  * TMCPTextDestination:EMusicMenuMusicInfoLine1
       
    65  * TMCPTextDestination:EMusicMenuMusicInfoLine2
       
    66  */
       
    67 enum TMCPTextDestination
       
    68     {
       
    69      EMusicWidgetText1 = 2000
       
    70      ,EMusicWidgetDefaultText
       
    71      
       
    72      ,EMusicMenuMusicInfoLine1 = 2100
       
    73      ,EMusicMenuMusicInfoLine2
       
    74     };
       
    75 
       
    76 
       
    77 /**
       
    78  * Music Widget and Music Suite Trigger Destinations.
       
    79  * 
       
    80  * 9.1 Music Widget has two panels, The left panel contains an image where we
       
    81  * can install an action: 
       
    82  * TMCPTriggerDestination:EMusicWidgetTrigger1
       
    83  * When the toolbar is hiden because there is a default text the panel
       
    84  * functions as a button where we can install:
       
    85  * TMCPTriggerDestination:EMusicWidgetTrigger2
       
    86  * When there is no default text on the right panel it contains a toolbar with
       
    87  * 3 buttons where we can install the following actions:
       
    88  * TMCPTriggerDestination:EMusicWidgetTB1Trigger, 
       
    89  * TMCPTriggerDestination:EMusicWidgetTB2Trigger,
       
    90  * TMCPTriggerDestination:EMusicWidgetTB3Trigger.
       
    91  * 
       
    92  * 9.1 Music Suite has a top row that displays information about the current
       
    93  * playing and last played, when this item is selected the following action
       
    94  * will be triggered:
       
    95  * TMCPTriggerDestination:EMusicMenuMusicInfoTrigger
       
    96  */
       
    97 enum TMCPTriggerDestination
       
    98     {
       
    99      EMusicWidgetTrigger1 = 3000
       
   100      ,EMusicWidgetTrigger2
       
   101      ,EMusicWidgetTB1Trigger
       
   102      ,EMusicWidgetTB2Trigger
       
   103      ,EMusicWidgetTB3Trigger
       
   104      
       
   105      ,EMusicMenuMusicInfoTrigger =3100
       
   106     };
       
   107 
       
   108 /**
       
   109  *  Observer interface, to be implemented by the Music Content Publisher.
       
   110  *  This interface is to be used to inform the music content publisher of
       
   111  *  changes on the plugin that need to be propagated to the Music Widget UI
       
   112  *  or the Music suite UI. 
       
   113  *  @since S60 5.0
       
   114  */
       
   115 class MMCPPluginObserver
       
   116     {
       
   117 public:
       
   118     
       
   119     /**
       
   120      * Called when an image needs to be updated.
       
   121      *
       
   122      * @since S60 5.0
       
   123      * @param aPlugin Where the mesage is coming from.
       
   124      * @param aDestination Where the image is to be placed.
       
   125      * @param aImagePath Source path of the Image.
       
   126      */
       
   127     virtual void PublishImageL(CMCPPlugin* aPlugin,
       
   128             TMCPImageDestination aDestination, 
       
   129             const TDesC& aImagePath) = 0;
       
   130 
       
   131     /**
       
   132      * Called when an image needs to be updated.
       
   133      *
       
   134      * @since S60 5.0
       
   135      * @param aPlugin Where the mesage is coming from.
       
   136      * @param aDestination Where the image is to be placed.
       
   137      * @param aBitmapHandle Bitmap handle to the image.
       
   138      *        the bitmaps should be preseverd by the plugins.
       
   139      * @param aMaskBitmapHandle Mask Bitmap handle for the image.
       
   140      */
       
   141     virtual void PublishImageL(CMCPPlugin* aPlugin, 
       
   142             TMCPImageDestination aDestination,
       
   143             TInt aBitmapHandle,
       
   144             TInt aMaskBitmapHandle = NULL) = 0;
       
   145     
       
   146     /**
       
   147      * Called when an image needs to be updated.
       
   148      *
       
   149      * @since S60 5.0
       
   150      * @param aPlugin Where the mesage is coming from.
       
   151      * @param aDestination Where the image is to be placed.
       
   152      * @param aID major and minor Skin ID info.
       
   153      * @param aFilename fallback mif/mbm file.
       
   154      * @param aFileBitmapId bitmap id within the fallback file.
       
   155      * @param aFileMaskId mask id within the fallback file.
       
   156      * NOTE:This keeps a cache of the skined incons, sizes are 
       
   157      *      calculated on the observer based on the widget version.
       
   158      */
       
   159     virtual void PublishImageL(CMCPPlugin* aPlugin, 
       
   160             TMCPImageDestination aDestination,
       
   161             const TAknsItemID& aID,
       
   162             const TDesC& aFilename,
       
   163             const TInt aFileBitmapId,
       
   164             const TInt aFileMaskId ) = 0;
       
   165 
       
   166     /**
       
   167      * Called when a text needs to be updated.
       
   168      *
       
   169      * @since S60 5.0
       
   170      * @param aPlugin Where the mesage is coming from.
       
   171      * @param aDestination Where the text is to be placed.
       
   172      * @param aText Descriptor containing the text.
       
   173      */
       
   174     virtual void PublishTextL( CMCPPlugin* aPlugin, 
       
   175             TMCPTextDestination aDestination, 
       
   176             const TDesC& aText ) = 0;
       
   177 
       
   178     /**
       
   179      * Called when an action needs to be updated.
       
   180      *
       
   181      * @since S60 5.0
       
   182      * @param aPlugin Where the mesage is coming from.
       
   183      * @param aDestination Destination trigger that should launch the action.
       
   184      * @param aTrigerMap LIW Map containint the action that can be interpreted
       
   185      * by the specified action handler plugin.
       
   186      */
       
   187     virtual void PublishActionL( CMCPPlugin* aPlugin, 
       
   188             TMCPTriggerDestination aDestination, 
       
   189             CLiwDefaultMap* aTrigerMap ) = 0;
       
   190     
       
   191     /**
       
   192      * Called when a plugin becomes active.
       
   193      *
       
   194      * @since S60 5.0
       
   195      * @param aPlugin Where the mesage is coming from.
       
   196      */
       
   197     virtual void BecameActiveL( CMCPPlugin* aPlugin ) = 0;
       
   198     
       
   199     /**
       
   200      * Called when a plugin becomes active.
       
   201      *
       
   202      * @since S60 5.0
       
   203      * @param aDst The image destination.
       
   204      * @return The size of the image destination.
       
   205      * NOTE: this should be used to query the size of the image destination.
       
   206      *       Resizing is responsibility of the plugin in the case of 
       
   207      *       bitmap handle publishing.
       
   208      */
       
   209     virtual TSize GetImageDestinationSize(TMCPImageDestination aDst) = 0;
       
   210 
       
   211     };
       
   212 
       
   213 #endif /*MCPPLUGINOBSERVER_H*/