homesync/contentmanager/mediaservant/inc/msfillcontainer.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2008 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:  Definition for MediaServant fill list container class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_MSFILLCONTAINER_H
       
    20 #define C_MSFILLCONTAINER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknlists.h>
       
    24 #include "msbasecontainer.h"
       
    25 #include "mediaservant.hrh"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CAknColumnListBox;
       
    29 class CAknIconArray;
       
    30 class CMSAppUi;
       
    31 class CCmFillRule;
       
    32 class CMSFillRuleController;
       
    33 class CMSFillView;
       
    34 class CMSFillList;
       
    35 
       
    36 /**
       
    37  * CMSFillContainer class
       
    38  *
       
    39  * @since S60 5.1
       
    40  */
       
    41 NONSHARABLE_CLASS( CMSFillContainer ): public CMSBaseContainer
       
    42     {
       
    43     private:
       
    44 
       
    45         // icon enumerations
       
    46         enum TMSListBoxIcons
       
    47             {
       
    48             EMSSelectedFits = 0,
       
    49             EMSUnselectedFits,
       
    50             EMSSelectedPartiallyFits,
       
    51             EMSUnselectedPartiallyFits,
       
    52             EMSSelectedDoesntFit,
       
    53             EMSUnSelectedDoesntFit,
       
    54             EVideoType,
       
    55             EImageType,
       
    56             EAudioType,
       
    57             EMark,
       
    58             EIconCount
       
    59             };
       
    60 
       
    61     public:
       
    62     
       
    63         /**
       
    64          * Constructor.
       
    65          */
       
    66         CMSFillContainer( CMSAppUi& aAppUi, CMSFillView& aView );
       
    67 
       
    68         /**
       
    69          * Symbian default constructor.
       
    70          */
       
    71         void ConstructL( TRect aRect );
       
    72 
       
    73         /**
       
    74          * Destructor.
       
    75          */
       
    76         virtual ~CMSFillContainer();
       
    77 
       
    78         /**
       
    79          * Updates listbox data
       
    80          * @since S60 5.1
       
    81          */
       
    82         void UpdateListBoxDataL();
       
    83 
       
    84         /**
       
    85          * sets fill rule activity
       
    86          * @since S60 5.1
       
    87          */
       
    88         void SetFillRules();
       
    89 
       
    90         /**
       
    91          * Highlighted item index
       
    92          * @since S60 5.1
       
    93          * @return TInt, highlighted item index
       
    94          */
       
    95         TInt SelectedItemIndex();
       
    96 
       
    97         /**
       
    98          * Count of list items
       
    99          * @since S60 5.1
       
   100          * @return TInt, item count
       
   101          */
       
   102         TInt ListItemCount();
       
   103 
       
   104         /**
       
   105          * Sets reorder mode states
       
   106          * @since S60 5.1
       
   107          * @param aState, reordering state
       
   108          */
       
   109         void SetReorderStateL( TMSReorderState aState );
       
   110 
       
   111         /**
       
   112          * Deletes current rule
       
   113          * @since S60 5.1
       
   114          */
       
   115         void DeleteRuleL();
       
   116 
       
   117         /**
       
   118          * Checks if the list already have rule with this name
       
   119          * @since S60 5.1
       
   120          * @param aName, rule name
       
   121          * @TInt number of dublicates
       
   122          */
       
   123         TInt CheckIfDublicateNames( const TDesC& aName );
       
   124 
       
   125         /**
       
   126          * Toggles list item
       
   127          * @since S60 5.1
       
   128          */
       
   129         void ChangeListActivityL();
       
   130 
       
   131         /**
       
   132          * Checks if item is selected
       
   133          * @since S60 5.1
       
   134          * @return TBool, ETrue if activated
       
   135          */
       
   136         TBool IsCurrentListItemActive();
       
   137 
       
   138         /**
       
   139          * Checks if user has changed list selections
       
   140          * @since S60 5.1
       
   141          * @return TBool, ETrue if changed
       
   142          */
       
   143         TBool HasListSelectionsChanged();
       
   144 
       
   145         /**
       
   146          * Updates fill list size on navi pane
       
   147          * @since S60 5.1
       
   148          */
       
   149         void UpdateNaviTextL();
       
   150 
       
   151         /**
       
   152          * Checks if list(s) have been deleted
       
   153          * @since S60 5.1
       
   154          * @return TBool, ETrue if deleted, EFalse otherwise
       
   155          */
       
   156         TBool IsListDeleted();
       
   157 
       
   158         /**
       
   159          * Handles pointer event on touchscreen
       
   160          * @param aPointerEvent, touchscreen key event 
       
   161          */
       
   162     	void HandlePointerEventL ( const TPointerEvent& aPointerEvent );
       
   163 
       
   164     protected:
       
   165 
       
   166 // From base class CCoeControl
       
   167         
       
   168         /**
       
   169          * From CoeControl
       
   170          * See base class definition
       
   171          */
       
   172         void GetHelpContext(TCoeHelpContext& aContext) const;
       
   173 
       
   174         /**
       
   175          * From CoeControl
       
   176          * See base class definition
       
   177          */
       
   178         CCoeControl* ComponentControl(TInt aIndex) const;
       
   179 
       
   180         /**
       
   181          * From CoeControl
       
   182          * See base class definition
       
   183          */
       
   184         TInt CountComponentControls() const;
       
   185 
       
   186         /**
       
   187          * From CoeControl
       
   188          * See base class definition
       
   189          */
       
   190         void SizeChanged();
       
   191 
       
   192         /**
       
   193          * From CoeControl
       
   194          * See base class definition
       
   195          */
       
   196         void HandleResourceChange(TInt aType);
       
   197 
       
   198         /**
       
   199          * From CoeControl
       
   200          * See base class definition
       
   201          */
       
   202         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   203                                  TEventCode aType );
       
   204 
       
   205         /**
       
   206          * From CoeControl
       
   207          * See base class definition
       
   208          */
       
   209 		void HandleDragAndDropEventsL( const TPointerEvent& aPointerEvent );
       
   210 
       
   211     private:
       
   212 
       
   213 
       
   214         /**
       
   215          * Handles up/down keys during reordering
       
   216          * @since S60 5.1
       
   217          * @param aKeyEvent Key event.
       
   218          * @param aType Type of key event( EEventKey, EEventKeyUp or
       
   219          * EEventKeyDown ).
       
   220          */
       
   221         TKeyResponse HandleReorderKeyEventL(const TKeyEvent& aKeyEvent,
       
   222                                             TEventCode aType );
       
   223 
       
   224         /**
       
   225          * Moves item on the list
       
   226          * @since S60 5.1
       
   227          * @param aDirection, moving direction
       
   228          */
       
   229         void MoveItem( TInt aDirection );
       
   230 
       
   231         /**
       
   232          * Sets rule activity according to checkbox states on the list
       
   233          * @since S60 5.1
       
   234          */
       
   235         void StoreSelectionStatus();
       
   236 
       
   237         /**
       
   238          * Gets icon for the list
       
   239          * @since S60 5.1
       
   240          * @param aListName, name of the list
       
   241          * @param aIndex, item index
       
   242          * @param aListSize, list size in bytes
       
   243          */
       
   244         TInt ListItemIconIndex( TInt aIndex,
       
   245                                 TInt64 aListSize,
       
   246                                 TInt64& aFreeSpace );
       
   247 
       
   248         /**
       
   249          * Calculates fill quota based on selected drives
       
   250          * @since S60 5.1
       
   251          */
       
   252         void CalculateFillQuotaL();
       
   253 
       
   254     private:
       
   255 
       
   256         /**
       
   257          * Listbox control
       
   258          */
       
   259         CAknColumnListBox* iListBox;
       
   260         /**
       
   261          * Pointer to application ui
       
   262          */
       
   263         CMSAppUi&                           iMSAppUi;           // not owned
       
   264         /**
       
   265          * Reorder state
       
   266          */
       
   267         TMSReorderState                     iReorderState;
       
   268         /**
       
   269          * Pointer array to rules
       
   270          */
       
   271         RPointerArray<CMSFillList>*         iFillListArray;     // not owned
       
   272         /**
       
   273          * Fill rule controller
       
   274          */
       
   275         CMSFillRuleController*              iFillRuleController;// not owned
       
   276         /**
       
   277          * Parent view
       
   278          */
       
   279         CMSFillView&                        iView;
       
   280         /**
       
   281          * Size of selected lists
       
   282          */
       
   283         TInt64                              iSizeOfSelectedLists;
       
   284         /**
       
   285          * Selected items on view activation
       
   286          */
       
   287         RArray<TInt>                        iSelectedLists;
       
   288         /**
       
   289          * Context pane icon
       
   290          */
       
   291         CFbsBitmap*                         iIcon;              // not owned
       
   292         /**
       
   293          * Context pane icon mask
       
   294          */
       
   295         CFbsBitmap*                         iIconMask;          // not owned
       
   296         /**
       
   297          * Selection indexes
       
   298          */
       
   299         const CListBoxView::CSelectionIndexArray*
       
   300                                             iSelectedIndexes;   // not owned
       
   301         /**
       
   302          * MMC free space ( for navi pane text )
       
   303          */
       
   304         TInt64                              iFreeMemory;
       
   305         /**
       
   306          * MMC quota ( set by user )
       
   307          */
       
   308         TInt64                              iQuota;
       
   309         /**
       
   310          * List delete flag
       
   311          */
       
   312         TBool                               iListDeleted;
       
   313         /**
       
   314          * Previous listbox selection
       
   315          */
       
   316         TInt                                iPreviousItemIndex;
       
   317         /**
       
   318          * Index of an item that is dragged
       
   319          */
       
   320         TInt 								iDragItemIndex;
       
   321     };
       
   322 
       
   323 #endif // C_MSMAINCONTAINER_H