mpxplugins/viewplugins/views/inc/mpxcommonlistboxarraybase.h
changeset 0 ff3acec5bc43
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:  Listbox array for common container.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMPXCOMMONLISTBOXARRAY_H
       
    20 #define CMPXCOMMONLISTBOXARRAY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>
       
    24 #include <mpxcommonframeworkdefs.h>
       
    25 #include <mpxplaybackframeworkdefs.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MMPXCommonListBoxArrayObserver;
       
    29 class CAknIconArray;
       
    30 class CMPXMediaArray;
       
    31 class CMPXMedia;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  Listbox array for common container.
       
    37  *  Creates item text descriptors according to the list model.
       
    38  *
       
    39  *  Dervied classes should implement MdcaPoint from MDesCArray
       
    40  *
       
    41  *  @lib mpxcommoncontainer.lib
       
    42  *  @since S60 v3.1
       
    43  */
       
    44 class CMPXCommonListBoxArrayBase : public CBase, 
       
    45                                    public MDesCArray
       
    46     {
       
    47 public:  // Constructors and destructor
       
    48     
       
    49     /**
       
    50      * C++ constructor.
       
    51      */
       
    52     IMPORT_C CMPXCommonListBoxArrayBase();
       
    53         
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     virtual ~CMPXCommonListBoxArrayBase(); 
       
    58     
       
    59     /**
       
    60      * Construct the array
       
    61      */
       
    62     IMPORT_C void ConstructListBoxArrayL();   
       
    63 
       
    64 public: // new functions
       
    65 
       
    66     /**
       
    67      * Appends media array contained in the media object
       
    68      * to the current array
       
    69      *
       
    70      * @since 3.1
       
    71      * @param aMedia Media object containing the media array to be append
       
    72      */ 
       
    73     IMPORT_C virtual void AppendMediaL( const CMPXMedia& aMedia );
       
    74 
       
    75     /**
       
    76      * Resets media array
       
    77      *
       
    78      * @since 3.1
       
    79      */
       
    80     IMPORT_C void ResetMediaArrayL();
       
    81     
       
    82     /**
       
    83      * Get media array
       
    84      *
       
    85      * @since 3.1
       
    86      * @return Media array used by the listbox
       
    87      */
       
    88     IMPORT_C const CMPXMediaArray& MediaArray();
       
    89     
       
    90     /**
       
    91      * Get media at an index
       
    92      *
       
    93      * @since 3.1
       
    94      * @param aIndex index for get media
       
    95      * @return Media object at the given index
       
    96      */
       
    97     IMPORT_C const CMPXMedia& MediaL( TInt aIndex );
       
    98     
       
    99     /**
       
   100      * Get the media object for the container of current level
       
   101      * It does NOT contain the media array
       
   102      *
       
   103      * @since 3.1
       
   104      * @return Media object for the parent container for the current level
       
   105      */
       
   106     IMPORT_C const CMPXMedia& ContainerMedia();
       
   107     
       
   108     /**
       
   109      * Set observer
       
   110      *
       
   111      * @since 3.1
       
   112      * @param aObserver array event observer
       
   113      */
       
   114     IMPORT_C void SetObserver( MMPXCommonListBoxArrayObserver* aObserver);
       
   115     
       
   116     /**
       
   117      * Remove obsever
       
   118      *
       
   119      * @since 3.1
       
   120      */
       
   121     IMPORT_C void RemoveObserver();
       
   122     
       
   123     /**
       
   124      * Creates icon array
       
   125      *
       
   126      * @since 3.1
       
   127      * @return Pointer to the newly created icon array
       
   128      */   
       
   129     IMPORT_C virtual CAknIconArray* CreateIconArrayL();        
       
   130 
       
   131 protected: // Functions from base classes
       
   132 
       
   133     /**
       
   134      * From MDesCArray, returns the number of descriptor elements
       
   135      * in a descriptor
       
   136      *
       
   137      * @since 3.1
       
   138      * @return The number of descriptor elements in a descriptor array.
       
   139      */
       
   140     IMPORT_C TInt MdcaCount() const;
       
   141     
       
   142 protected:    // Data
       
   143 
       
   144     MMPXCommonListBoxArrayObserver*  iObserver;         // not owned
       
   145     CMPXMediaArray*                  iMedia;            // not owned
       
   146     CMPXMedia*                       iContainerMedia;   // owned
       
   147     HBufC*                           iItem;             // owned
       
   148 
       
   149     TMPXPlaybackState                iPbState;
       
   150     TInt                             iIndex;            // Now playing item index
       
   151     };
       
   152 
       
   153 #endif  // CMPXCOMMONLISTBOXARRAY_H
       
   154             
       
   155 // End of File