mpxplugins/viewplugins/inc/mpxupnpbrowsedialog.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Implementation of UPnP players browse Dialog
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CMPXUPNPBROWSEDIALOG_H__
       
    20 #define C_CMPXUPNPBROWSEDIALOG_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <badesca.h>
       
    25 #include <AknDialog.h>
       
    26 #include <mpxplaybackobserver.h>
       
    27 #include <AknsItemID.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MMPXPlaybackUtility;
       
    31 class CAknPopupList;
       
    32 class CAknSinglePopupMenuStyleListBox;
       
    33 class CMPXPlayerManagerStub;
       
    34 class CAknIconArray;
       
    35 class MAknsSkinInstance;
       
    36 class CMPXMedia;
       
    37 class MMPXViewUtility;
       
    38 
       
    39 /**
       
    40 * Device selection dialog class of Common UI library
       
    41 */
       
    42 class CMPXUPnPBrowseDialog: public CAknDialog, public MMPXPlaybackCallback,
       
    43                             public MMPXPlaybackObserver
       
    44     {
       
    45 
       
    46     public:  // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         IMPORT_C static CMPXUPnPBrowseDialog* NewL(TInt aPlayerUid);
       
    52         
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CMPXUPnPBrowseDialog();
       
    57 
       
    58     public: // Methods from MMPXPlaybackCallback
       
    59 
       
    60         /**
       
    61         *  Handle playback property
       
    62         *
       
    63         *  @param aProperty the property
       
    64         *  @param aValue the value of the property
       
    65         *  @param aError error code
       
    66         */
       
    67         void HandlePropertyL(TMPXPlaybackProperty aProperty,
       
    68                                      TInt aValue, 
       
    69                                      TInt aError);
       
    70         
       
    71         /**
       
    72         *  Method is called continously until aComplete=ETrue, signifying that 
       
    73         *  it is done and there will be no more callbacks
       
    74         *  Only new items are passed each time
       
    75         *
       
    76         *  @param aPlayer UID of the subplayer
       
    77         *  @param aSubPlayers a list of sub players
       
    78         *  @param aComplete ETrue no more sub players. EFalse more subplayer
       
    79         *                   expected
       
    80         *  @param aError error code
       
    81         */
       
    82         void HandleSubPlayerNamesL(TUid aPlayer, 
       
    83                                            const MDesCArray* aSubPlayers,
       
    84                                            TBool aComplete,
       
    85                                            TInt aError);
       
    86         
       
    87         /**
       
    88         *  Call back of media request
       
    89         *  Notes: The client is responsible for delete the object of aProperties
       
    90         *
       
    91         *  @param aMedia media 
       
    92         *  @param aError error code    
       
    93         */
       
    94         void HandleMediaL( const CMPXMedia& aProperties,
       
    95                                                TInt aError);   
       
    96                                                
       
    97         /**
       
    98          * From MMPXPlaybackObserver
       
    99          * Handle playback message
       
   100          * 
       
   101          * @param aMessage playback message
       
   102          * @param aErr system error code.
       
   103          */
       
   104         void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
       
   105 
       
   106     public: // New functions
       
   107 
       
   108         /**
       
   109          * Displays selection pop up
       
   110          *
       
   111          * @since Series 60 3.1
       
   112          * @param aPlayerUid, selected player Uid
       
   113          */
       
   114         IMPORT_C TInt ExecuteLD(TInt aPlayerUid);
       
   115 
       
   116     private:
       
   117 
       
   118         /**
       
   119         * C++ default constructor.
       
   120         */
       
   121         CMPXUPnPBrowseDialog(TInt aPlayerUid);
       
   122 
       
   123         /**
       
   124         * By default Symbian 2nd phase constructor is private.
       
   125         */
       
   126         void ConstructL();
       
   127 
       
   128 
       
   129     private:    // New Functions
       
   130 
       
   131         /**
       
   132         * Loads a possibly skinned icon and adds it to icon array
       
   133         * @since Series 60 3.0
       
   134         * @param CAknIconArray, array of icons
       
   135         * @param MAknsSkinInstance, skin instance
       
   136         * @param TDesC, reference to icon file
       
   137         * @param TAknsItemID, skinned icon id
       
   138         * @param TInt, bitmap id
       
   139         * @param TInt, bitmap mask id
       
   140         */
       
   141         void AppendIconToArrayL(CAknIconArray* aArray,
       
   142                                 MAknsSkinInstance* aSkin,
       
   143                                 const TDesC& aMbmFile,
       
   144                                 const TAknsItemID& aID,
       
   145                                 TInt aBitmapId,
       
   146                                 TInt aMaskId);
       
   147 
       
   148         /**
       
   149         * Loads listbox items
       
   150         * @since Series 60 3.0
       
   151         */
       
   152         void LoadListItemsL(void);
       
   153         
       
   154         /**
       
   155         * Loads listbox items
       
   156         * @since Series 60 3.0
       
   157         */
       
   158         void DisplaySubPlayersNamesL( const MDesCArray* aSubPlayers,
       
   159                                       const TBool aComplete );
       
   160 
       
   161         /**
       
   162         * From CAknDialog, handles layout initialization
       
   163         * @param const TDesC&, dialog title
       
   164         */
       
   165         void PreLayoutDynInitL();
       
   166 
       
   167         /**
       
   168          * Starts selection popup
       
   169          *
       
   170          * @since Series 60 3.1
       
   171          * @param CUPnPDevice, selected device
       
   172          */
       
   173         TInt StartPopupL();
       
   174 
       
   175         /**
       
   176          * Creates a selection popup.
       
   177          *
       
   178          * @since Series 60 3.1
       
   179          * @param const TDesC&, popup title
       
   180          * @return None
       
   181          */
       
   182         void CreatePopupL();
       
   183 
       
   184         /**
       
   185          * Retrieves the name and other info of the currently
       
   186          * used subplayer
       
   187          */
       
   188         void RetrieveCurrentlySelectSubplayerNameL();    
       
   189 
       
   190         /**
       
   191          * Display an error note after the selected player was not valid
       
   192          * @param aResourceId ID of the text to be displayed on the error note
       
   193          */
       
   194         void DisplayErrorNoteL( TInt aResourceId );     
       
   195         
       
   196         /**
       
   197          * Displays the waiting text during retrieval of subplayer names
       
   198          */
       
   199         void DisplayWaitingTextL();
       
   200         
       
   201         /**
       
   202          *  Handle playback message
       
   203          *
       
   204          *  @param aMessage playback message
       
   205          */
       
   206         void DoHandlePlaybackMessageL( 
       
   207             const CMPXMessage& aMessage );
       
   208 
       
   209     private:
       
   210 
       
   211         CAknPopupList*                   iPopup;
       
   212         CAknSinglePopupMenuStyleListBox* iListBox;
       
   213         TInt                             iPlayerUid;
       
   214         MMPXPlaybackUtility* iPlaybackUtility;  // not owned
       
   215         TInt                 iResourceOffset;
       
   216         TInt                 iErrorResourceOffset;
       
   217         CMPXPlayerManagerStub* iPlayerManagerStub;
       
   218         HBufC* iCurrentlySelectedSubPlayerName;
       
   219         TUid iCurrentlyUsedPlayer;
       
   220         
       
   221         CDesCArrayFlat* iSubPlayersCachedArray;
       
   222         
       
   223         // View utility.
       
   224         MMPXViewUtility* iViewUtility;
       
   225         
       
   226         // ETrue if PlayerUnavailable event was received
       
   227         TBool iPlayerUnavailableError;
       
   228     };
       
   229 
       
   230 #endif // C_CMPXUPNPBROWSEDIALOG_H__
       
   231 
       
   232 // End of file