mpxplugins/viewplugins/views/podcastview/inc/mpxpodcastcollectionviewcontainer.h
changeset 0 ff3acec5bc43
child 40 cb96c29156b2
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:  MPX PodcastCollection view container implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CMPXPODCASTCOLLECTIONVIEWCONTAINER_H
       
    21 #define C_CMPXPODCASTCOLLECTIONVIEWCONTAINER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <mpxcommonframeworkdefs.h> // TMPXItemId
       
    26 #include <mpxpodcastdefs.h> // Podcast specific
       
    27 #include "mpxviewcontainer.h"
       
    28 #include "mpxcommoncontainer.h"
       
    29 
       
    30 // FORWARD DECLARATION
       
    31 class TAknsItemID;
       
    32 class CAknContextPane;
       
    33 class CMPXCommonContainerFactory;
       
    34 class MMPXCommonContainer;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  *  MPX Podcast Collection view container.
       
    40  *
       
    41  *  @lib mpxpodcastcollectionview.lib
       
    42  *  @since S60 v3.0
       
    43  */
       
    44 NONSHARABLE_CLASS( CMPXPodcastCollectionViewContainer )
       
    45     : public CBase
       
    46     , public MMPXViewContainer
       
    47     , public MMPXCommonListBoxArrayObserver
       
    48     {
       
    49 public:
       
    50 
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      *
       
    54      * @since 5.1
       
    55      * @param aView Command observer.
       
    56      * @param aObserver MEikListBoxObserver
       
    57      * @return Pointer to newly created object.
       
    58      */
       
    59     static CMPXPodcastCollectionViewContainer* NewL(
       
    60         MEikCommandObserver* aView,
       
    61         MEikListBoxObserver* aObserver );
       
    62 
       
    63     /**
       
    64      * Destructor.
       
    65      */
       
    66     virtual ~CMPXPodcastCollectionViewContainer();
       
    67 
       
    68     /**
       
    69      * Sets playback status with item id
       
    70      *
       
    71      * @param aId item id of the episode
       
    72      * @param aStatus status of the episode
       
    73      */
       
    74     void SetPlaybackStatusByIdL( TMPXItemId aId, TMPXPlaybackState aStatus );
       
    75 
       
    76     /**
       
    77      * Get current playback index
       
    78      *
       
    79      * @return Current playback index, KErrNotFound if nothing is playing
       
    80      */
       
    81     TInt PlaybackIndex();
       
    82 
       
    83     /**
       
    84      * Called by podcast collection view to set current view
       
    85      * to be used to determine the correct help context
       
    86      *
       
    87      * @param: the current view
       
    88      */
       
    89     void SetCurrentView( const TMPXPodcastView& currentView );
       
    90 
       
    91     /**
       
    92      * Return common container
       
    93      *
       
    94      * @since 3.2
       
    95      */
       
    96     MMPXCommonContainer* Common();
       
    97 
       
    98 // from base class MMPXViewContainer
       
    99 
       
   100     /**
       
   101      * Handles key events.
       
   102      *
       
   103      * @param aKeyEvent The key event.
       
   104      * @param aType The type of key event.
       
   105      */
       
   106     TKeyResponse HandleKeyEventL(
       
   107         const TKeyEvent& aKeyEvent,
       
   108         TEventCode aType );
       
   109 
       
   110     /**
       
   111      * Handles the retrieval of the view container's help context.
       
   112      *
       
   113      * @param aContext The control's help context.
       
   114      */
       
   115     void HandleHelpContext( TCoeHelpContext& aContext ) const;
       
   116 
       
   117     /**
       
   118      * Returns the indicators for the specified item within the view container
       
   119      *
       
   120      * @param aIndex specified array index
       
   121      * @return Indicator icon indices
       
   122      */
       
   123     RArray<TInt> IndicatorsL( TInt aIndex );
       
   124 
       
   125 private:
       
   126 
       
   127     /**
       
   128      * C++ default constructor.
       
   129      */
       
   130     CMPXPodcastCollectionViewContainer(
       
   131         MEikCommandObserver* aView,
       
   132         MEikListBoxObserver* aObserver);
       
   133 
       
   134     /**
       
   135      * Symbian 2nd phase constructor.
       
   136      */
       
   137     void ConstructL();
       
   138 
       
   139     /**
       
   140      * Creates listbox array
       
   141      *
       
   142      */
       
   143     CMPXCommonListBoxArrayBase* CreateListBoxArrayL();
       
   144 
       
   145 // from base class MMPXCommonListBoxArrayObserver
       
   146 
       
   147     /**
       
   148      * From MMPXCommonListBoxArrayObserver.
       
   149      * Handle listbox array events
       
   150      *
       
   151      *  @param aEvent list box event
       
   152      */
       
   153     void HandleListBoxArrayEventL(
       
   154         MMPXCommonListBoxArrayObserver::TMPXCommonListBoxArrayEvents aEvent );
       
   155 
       
   156 private: // data member
       
   157 
       
   158     MMPXCommonContainer*                   iCommonContainer; // Owned
       
   159     MEikCommandObserver*                   iView; // not owned
       
   160     MEikListBoxObserver*                   iListBoxObserver; // not owned
       
   161     CAknContextPane*                       iContextPane; // Not owned
       
   162     CMPXPodcastCollectionViewListBoxArray* iLbxArray; // Not owned
       
   163     CEikImage*                             iNewIcon;  // New context icon, owned
       
   164     CEikImage*                             iOrigIcon; // New context icon, not owned
       
   165     TMPXPodcastView                        iCurrentView; // stores the current view to help with setting
       
   166                                                          // help context
       
   167     };
       
   168 
       
   169 #endif  // C_CMPXPODCASTCOLLECTIONVIEWCONTAINER_H
       
   170 
       
   171 // End of File