mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhglistboxarray.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 collection view.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CMPXCOLLECTIONVIEWHGLISTBOXARRAY_H
       
    20 #define C_CMPXCOLLECTIONVIEWHGLISTBOXARRAY_H
       
    21 
       
    22 #include "mpxcommonlistboxarraybase.h"
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class TAknsItemID;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  *  Listbox array for collection view container.
       
    31  *  Creates item text descriptors according to the list model.
       
    32  *
       
    33  *  @lib mpxcollectionview.lib
       
    34  *  @since S60 v3.1
       
    35  */
       
    36 NONSHARABLE_CLASS( CMPXCollectionViewListBoxArray ): public CMPXCommonListBoxArrayBase
       
    37     {
       
    38 public:  // Constructors and destructor
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      *
       
    43      * @since 3.1
       
    44      * @return Pointer to newly created object.
       
    45      */
       
    46     static CMPXCollectionViewListBoxArray* NewL();
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     virtual ~CMPXCollectionViewListBoxArray();
       
    52 
       
    53     /**
       
    54      * Sets playback status with item id
       
    55      *
       
    56      * @since 3.1
       
    57      * @param aId item id of the song
       
    58      * @param aStatus status of the song
       
    59      * @return The index of previous playing song
       
    60      */
       
    61     TInt SetPlaybackStatusByIdL( TMPXItemId aId, TMPXPlaybackState aStatus, TInt aIndex );
       
    62 
       
    63     /**
       
    64      * Activates reorder mode
       
    65      *
       
    66      * @since 3.1
       
    67      * @param aEnable ETrue to enable reorder mode, EFalse to disable
       
    68      */
       
    69     void ActivateReorderMode( TBool aEnable );
       
    70 
       
    71     /**
       
    72      * Set reorder mode
       
    73      *
       
    74      * @since 3.1
       
    75      * @param aEnable ETrue to enable reorder mode, EFalse to disable reorder mode
       
    76      * @param aIndex current selected index
       
    77      */
       
    78     void SetReorderGrabbedMode( TBool aEnable, TInt aIndex = 0 );
       
    79 
       
    80     /**
       
    81      * Move current reorder index
       
    82      *
       
    83      * @since 3.1
       
    84      * @param aDirection +1 to move down, -1 to move up
       
    85      */
       
    86     void MoveReorderIndex( TInt aDirection );
       
    87 
       
    88     /**
       
    89      * Set current reorder index
       
    90      *
       
    91      * @since 3.1
       
    92      * @param aIndex current reorder index
       
    93      */
       
    94     void SetReorderIndex( TInt aIndex );
       
    95 
       
    96     /**
       
    97      * Confirm reorder
       
    98      *
       
    99      * @since 3.1
       
   100      */
       
   101     void ConfirmReorderL();
       
   102 
       
   103     /**
       
   104      * Cancel reorder
       
   105      *
       
   106      * @since 3.1
       
   107      */
       
   108     void CancelReorder();
       
   109 
       
   110     /**
       
   111      * Gets original index of currently selected item in reorder mode
       
   112      *
       
   113      * @since 3.1
       
   114      * @return The original index of the current item in reorder mode
       
   115      */
       
   116     TInt GetOriginalIndex() const;
       
   117 
       
   118     /**
       
   119      * Gets the index for the song that's currently playing
       
   120      *
       
   121      * @return The index for the song that's currently playing
       
   122      */
       
   123     TInt GetPlaybackIndex() const;
       
   124 
       
   125     /**
       
   126      * Indicates if Unknown entry exists in this view
       
   127      *
       
   128      * @since 3.1
       
   129      * @return ETrue if "unknown" category exists, EFalse otherwise
       
   130      */
       
   131     TBool IsCategoryUnknownExist() const ;
       
   132 
       
   133     /**
       
   134      * Checks if the item is a broken link, ETrue if broken
       
   135      *
       
   136      * @since 3.1
       
   137      * @param aIndex index of the item
       
   138      * @return ETrue if the item is a broken link, EFalse otherwise
       
   139      */
       
   140     TBool IsItemBrokenLinkL( TInt aIndex ) const ;
       
   141 
       
   142     /**
       
   143      * Checks if the item is corrupted, ETrue if corrupted
       
   144      *
       
   145      * @since 3.1
       
   146      * @param aIndex index of the item
       
   147      * @return ETrue if the item is corrupted link, EFalse otherwise
       
   148      */
       
   149     TBool IsItemCorruptedL( TInt aIndex ) const;
       
   150 
       
   151     /**
       
   152      * Get array of indicator icon indices at the specified index
       
   153      */
       
   154     RArray<TInt> IndicatorIconIndicesL( TInt aIndex);
       
   155 
       
   156 public: // Functions from base classes
       
   157 
       
   158     /**
       
   159      * From MDesCArray, indexes into a descriptor array.
       
   160      *
       
   161      * @param aIndex The position of the descriptor element within a descriptor array.
       
   162      * @return Descriptor element located at position aIndex within a descriptor array
       
   163      */
       
   164     TPtrC MdcaPoint( TInt aIndex ) const;
       
   165 
       
   166     /**
       
   167      * From CMPXCommonListBoxArrayBase
       
   168      * Creates icon array
       
   169      *
       
   170      * @return Pointer to the created icon array
       
   171      */
       
   172     CAknIconArray* CreateIconArrayL();
       
   173 
       
   174     /**
       
   175      * From CMPXCommonListBoxArrayBase
       
   176      * Appends media array to the current array
       
   177      *
       
   178      * @param aMedia media array to append
       
   179      */
       
   180     void AppendMediaL( const CMPXMedia& aMedia );
       
   181 
       
   182 private: // constructors
       
   183 
       
   184     /**
       
   185      * C++ constructor.
       
   186      */
       
   187     CMPXCollectionViewListBoxArray();
       
   188 
       
   189     /**
       
   190      * By default Symbian 2nd phase constructor is private.
       
   191      */
       
   192     void ConstructL();
       
   193 
       
   194 private: // new functions
       
   195 
       
   196     /**
       
   197      * Load an icon and append it to an icon array.
       
   198      *
       
   199      * @param aArray    pointer to the icon array
       
   200      * @param aID       skin id of the icon
       
   201      * @param aMbmFile  path to the mbm/mif file containing the icon
       
   202      * @param aBitmapId mbm id of the bitmap
       
   203      * @param aMaskId   mbm id of the mask
       
   204      */
       
   205     void AppendIconToArrayL(
       
   206         CAknIconArray* aArray,
       
   207         const TAknsItemID& aID,
       
   208         const TDesC& aMbmFile,
       
   209         TInt aBitmapId,
       
   210         TInt aMaskId );
       
   211 
       
   212     /**
       
   213      * Load an icon and append it to an icon array.
       
   214      *
       
   215      * @param aArray    pointer to the icon array
       
   216      * @param aID       skin id of the icon
       
   217      * @param aColorId  Item ID of the color table.
       
   218      * @param aColorIndex Index in the color table.
       
   219      * @param aMbmFile  path to the mbm/mif file containing the icon
       
   220      * @param aBitmapId mbm id of the bitmap
       
   221      * @param aMaskId   mbm id of the mask
       
   222      */
       
   223     void AppendColorIconToArrayL(
       
   224         CAknIconArray* aArray,
       
   225         const TAknsItemID& aID,
       
   226         const TAknsItemID& aColorId,
       
   227         TInt aColorIndex,
       
   228         const TDesC& aMbmFile,
       
   229         TInt aBitmapId,
       
   230         TInt aMaskId );
       
   231 
       
   232     /**
       
   233      * Maps list box index to array index in reorder mode
       
   234      *
       
   235      * @aIndex listbox index
       
   236      * @return The mapped index
       
   237      */
       
   238     TInt GetArrayIndexForListBoxIndex( TInt aIndex ) const;
       
   239 
       
   240     /**
       
   241      * Get reorder icon
       
   242      *
       
   243      * @return The index of the reorder icon
       
   244      */
       
   245     TInt GetReorderIcon() const;
       
   246 
       
   247     /**
       
   248      * Retrieve indexes into a descriptor array.
       
   249      *
       
   250      * @param aIndex The position of the descriptor element within a descriptor array.
       
   251      * @return Descriptor element located at position aIndex within a descriptor array
       
   252      */
       
   253     TPtrC GetMdcaPointL( TInt aIndex ) const;
       
   254 
       
   255     /**
       
   256      * Sets playback status
       
   257      *
       
   258      * @param aIndex index of the song to set
       
   259      * @param aStatus status of the song
       
   260      * @return The index of previous playing song
       
   261      */
       
   262     TInt SetPlaybackStatusByIndex( TInt aIndex, TMPXPlaybackState aStatus );
       
   263 
       
   264 private: // data
       
   265     CMPXMediaArray*         iMediaOwned;
       
   266 
       
   267     TBool                   iReorderActivated;
       
   268     TBool                   iReorder;
       
   269     TInt                    iOriginalIndex;
       
   270     TInt                    iMovedIndex;
       
   271     TBool                   iMoveNowPlaying;
       
   272 
       
   273     TBool                   iIsUnknownExist;
       
   274     HBufC*                  iUnknown;
       
   275     TInt                    iMMCDrive;
       
   276     };
       
   277 
       
   278 #endif  // C_CMPXCOLLECTIONVIEWHGLISTBOXARRAY_H
       
   279 
       
   280 // End of File