mpx/tsrc/public/basic/collectiontest/inc/collectionbrowser.h
changeset 62 b276843a15ba
equal deleted inserted replaced
58:c76ea6caa649 62:b276843a15ba
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:  MpxCollectionTest test module.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef COLLECTIONBROWSER_H
       
    19 #define COLLECTIONBROWSER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <mpxcollectionobserver.h>
       
    23 #include "testmenuview.h"
       
    24 
       
    25 // MACROS
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MMPXCollectionUtility;
       
    29 class CMPXCollectionPath;
       
    30 class CStifLogger;
       
    31 class CTestPlaybackUtility;
       
    32 
       
    33 // DATA TYPES
       
    34 _LIT(KTxtCollectionBrowser, "CollectionBrowser");
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 class CCollectionBrowser : public CTestMenuView,
       
    39                          public MMPXCollectionObserver
       
    40     {
       
    41     public:
       
    42         /**
       
    43         * Two-phased constructor
       
    44         * @return object of CConsoleMain
       
    45         */
       
    46 //        static CCollectionBrowser* NewL(CConsoleMain* aConsoleMain,
       
    47  //                                       CTestBaseView* aParent,
       
    48   //                                      const TDesC16& aName,
       
    49    //                                     CStifLogger* aLogger,
       
    50     //                                    CMPXCollectionPath* aPath = NULL);
       
    51                                              
       
    52         /**
       
    53         * Two-phased constructor
       
    54         * @return object of CConsoleMain
       
    55         */
       
    56         static CCollectionBrowser* NewLC(CConsoleMain* aConsoleMain,
       
    57                                          CTestBaseView* aParent,
       
    58                                          const TDesC16& aName,
       
    59                                          CStifLogger* aLogger,
       
    60                                          CMPXCollectionPath* aPath = NULL);
       
    61 
       
    62         /**
       
    63         * Destructor of CConsoleMain
       
    64         */
       
    65         virtual ~CCollectionBrowser();
       
    66         
       
    67     public:     //From base classes
       
    68         /**
       
    69         * From CTestBaseView
       
    70         * Initialize the view before display view
       
    71         */
       
    72         void InitializeViewL();
       
    73         
       
    74         /**
       
    75         * From CTestBaseView
       
    76         * Cleanup the view before deactivate/destroy view
       
    77         */
       
    78         void CleanupViewL();
       
    79         
       
    80         /**
       
    81         * From CTestBaseView
       
    82         * Handle number key press
       
    83         */
       
    84         void HandleNumKeyL();
       
    85         
       
    86         /**
       
    87         * From CTestBaseView
       
    88         * Handle left key press
       
    89         */
       
    90         void HandleLeftKeyL();
       
    91         
       
    92         /**
       
    93         * From CTestBaseView
       
    94         * Handle right/enter key press
       
    95         */
       
    96         void HandleRightKeyL();
       
    97      
       
    98         /**
       
    99         *  From MMPXCollectionObserver
       
   100         *  Handle extended media properties
       
   101         *  @param aMedia media 
       
   102         *  @param aError error code    
       
   103         */
       
   104         void HandleCollectionMediaL(
       
   105                         const CMPXMedia& aMedia, 
       
   106                         TInt aError);
       
   107             
       
   108         /**
       
   109         *  From MMPXCollectionObserver
       
   110         *  Handle collection message
       
   111         *  @param aMessage collection message
       
   112         */
       
   113         void HandleCollectionMessageL(const CMPXMessage& aMsg); //const TMPXCollectionMessage& aMessage);
       
   114 
       
   115         /**
       
   116         *  From MMPXCollectionObserver
       
   117         *  Handles the collection entries being opened. Typically called
       
   118         *  when client has Open()'d a folder
       
   119         *
       
   120         *  @param aEntries collection entries opened
       
   121         *  @param aIndex focused entry
       
   122         *  @param aComplete ETrue no more entries. EFalse more entries
       
   123         *                   expected
       
   124         *  @param aError error code   
       
   125         */
       
   126         void HandleOpenL(const CMPXMedia& aEntries,
       
   127                                  TInt aIndex,TBool aComplete,TInt aError);
       
   128         
       
   129         /**
       
   130         *  From MMPXCollectionObserver
       
   131         *  Handles the item being opened. Typically called
       
   132         *  when client has Open()'d an item. Client typically responds by
       
   133         *  'playing' the item via the playlist
       
   134         *
       
   135         *  @param aPlaylist collection playlist, owner ship is transfered    
       
   136         *  @param aError error code   
       
   137         */                         
       
   138         void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError);            
       
   139     
       
   140     private:
       
   141         /** 
       
   142         * C++ default constructor.
       
   143         */
       
   144         CCollectionBrowser(CConsoleMain* aConsoleMain,
       
   145                            CTestBaseView* aParent,
       
   146                            const TDesC& aName,
       
   147                            CStifLogger* aLogger);
       
   148 
       
   149         /**
       
   150         * the second phase constructor ConstructL to safely construct things 
       
   151         * that can leave 
       
   152         */
       
   153         void ConstructL(CMPXCollectionPath* aPath);
       
   154     
       
   155     private:    //data
       
   156         MMPXCollectionUtility*  iCollectionUtility;  //owns
       
   157         CStifLogger*            iLogger;       //uses
       
   158         CMPXCollectionPath*     iCollectionPath;
       
   159         CTestPlaybackUtility*   iPlaybackUtility;
       
   160         
       
   161     };
       
   162 
       
   163 
       
   164 
       
   165 #endif      //COLLECTIONBROWSER
       
   166