mpxplugins/viewplugins/views/upnpplaybackdialog/inc/mpxupnpplaybackdialogcustomcontrol.h
changeset 0 ff3acec5bc43
child 1 8118492f1bdf
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Music Player upnp playback dialog declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CMPXUPNPPLAYBACKDIALOGCUSTOMCONTROL_H
       
    20 #define C_CMPXUPNPPLAYBACKDIALOGCUSTOMCONTROL_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <coecntrl.h>
       
    25 #include "mpxcommonplaybackviewcontainer.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMPXUPnPPlaybackDialog;
       
    29 class CAknsBasicBackgroundControlContext;
       
    30 class MMPXLayoutSwitchObserver;
       
    31 class MMPXPlaybackViewLayout;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * The custom control for UPnP playback Dialog.
       
    37  */
       
    38 NONSHARABLE_CLASS( CMPXUPnPPlaybackDialogCustomControl ) : public CMPXCommonPlaybackViewContainer
       
    39     {
       
    40 public:           
       
    41 
       
    42 public:  // Constructors and destructor
       
    43 
       
    44     /**
       
    45      * Two-phased constructor. Leaves on failure. Places the instance on the
       
    46      * cleanup stack.
       
    47      * @param aParent Parent control.
       
    48      * @param aRect The control's extent.
       
    49      * @param aCommandObserver  Observer for commands.
       
    50      * @param aLayoutObserver   Observer to send layout switch events to.
       
    51      * @param aLayout           Pointer to playback view layout.
       
    52      * @return The constructed item.
       
    53      */
       
    54     static CMPXUPnPPlaybackDialogCustomControl* NewLC( const CCoeControl& aParent, 
       
    55                                                        const TRect& aRect,
       
    56                                                        MEikCommandObserver* aCommandObserver,
       
    57                                                        MMPXLayoutSwitchObserver* aLayoutObserver,
       
    58                                                        MMPXPlaybackViewLayout* aLayout,
       
    59                                                        TMPXPlaybackPlayerType aCurrentPlayerType );
       
    60 
       
    61     /**
       
    62      * Two-phased constructor. Leaves on failure.
       
    63      * @param aParent Parent control.
       
    64      * @param aRect The control's extent.
       
    65      * @param aCommandObserver  Observer for commands.
       
    66      * @param aLayoutObserver   Observer to send layout switch events to.
       
    67      * @param aLayout           Pointer to playback view layout.
       
    68      * @return The constructed item.
       
    69      */
       
    70     static CMPXUPnPPlaybackDialogCustomControl* NewL( const CCoeControl& aParent, 
       
    71                                                       const TRect& aRect,
       
    72                                                       MEikCommandObserver* aCommandObserver,
       
    73                                                       MMPXLayoutSwitchObserver* aLayoutObserver,
       
    74                                                       MMPXPlaybackViewLayout* aLayout,
       
    75                                                       TMPXPlaybackPlayerType aCurrentPlayerType );
       
    76     
       
    77     /**
       
    78      * Destructor.
       
    79      */
       
    80     virtual ~CMPXUPnPPlaybackDialogCustomControl();       
       
    81     
       
    82 
       
    83 public: // New functions
       
    84 
       
    85 
       
    86     /**
       
    87      * Set layout for all elements and set sizes for icons.
       
    88      *
       
    89      * @since S60 3.0
       
    90      */
       
    91     void UpdateLayout();
       
    92     
       
    93 // from base class CoeControl
       
    94 
       
    95     /**
       
    96      * From CoeControl.
       
    97      * Handles key events.
       
    98      *
       
    99      * @param aKeyEvent The key event.
       
   100      * @param aType The type of key event.
       
   101      */
       
   102     TKeyResponse OfferKeyEventL(
       
   103         const TKeyEvent& aKeyEvent,
       
   104         TEventCode aType );
       
   105 
       
   106     
       
   107 private:    // new methods
       
   108 
       
   109     /**
       
   110      * Creates icons.
       
   111      */
       
   112     void CreateIconsL();
       
   113 
       
   114     /**
       
   115      * Redraw part of the screen to the bitmap context.
       
   116      *
       
   117      * @param aRect Area to be redrawn.
       
   118      * @param aGc Graphics context to draw to.
       
   119      */
       
   120     void RedrawRect(
       
   121         const TRect& aRect,
       
   122         CBitmapContext& aGc) const;
       
   123 
       
   124 private:
       
   125 
       
   126     /**
       
   127      * C++ default constructor.
       
   128      */
       
   129     CMPXUPnPPlaybackDialogCustomControl(
       
   130                     MEikCommandObserver* aCommandObserver,
       
   131                     MMPXLayoutSwitchObserver* aLayoutObserver,
       
   132                     MMPXPlaybackViewLayout* aLayout );
       
   133 
       
   134     /**
       
   135      * By default Symbian 2nd phase constructor is private.
       
   136      * @param aParent Parent control.
       
   137      * @param aRect The control's extent.
       
   138      */
       
   139     void ConstructL( const CCoeControl& aParent, 
       
   140                      const TRect &aRect,
       
   141                      TMPXPlaybackPlayerType aCurrentPlayerType );
       
   142     
       
   143 private:    // data
       
   144    
       
   145     CAknsBasicBackgroundControlContext* iBackground;
       
   146         
       
   147     CGulIcon* iRemotePlayerIcon;    // owned
       
   148     TRect iRemotePlayerIconRect;
       
   149     TBool iRemotePlayerUsed;
       
   150     };
       
   151 
       
   152 #endif      // C_CMPXUPNPPLAYBACKDIALOGCUSTOMCONTROL_H 
       
   153 
       
   154 // End of File