upnpsettings/multiselectionui/inc/upnpmultiselectionutility.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     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:      CUpnpMultiselectionUtility class definition
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef UPNPMULTISELECTIONUTILITY_H
       
    24 #define UPNPMULTISELECTIONUTILITY_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <AknDialog.h>
       
    28 #include <aknselectionlist.h>
       
    29 #include <aknsfld.h>
       
    30 #include <aknnavide.h>
       
    31 #include <akntitle.h> //for status pane
       
    32 #include <AknIconArray.h>
       
    33 #include <aknlists.h> //cakncolumnlistbox
       
    34 #include <AknWaitNoteWrapper.h>
       
    35 #include <eiklbx.h>
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 // NONE
       
    39 
       
    40 // CLASS DECLARATION
       
    41 enum TShareSelectionState 
       
    42     {
       
    43     EUndefined = 0, 
       
    44     EItemsSelected,
       
    45     EShareNoneSelected, 
       
    46     EShareAllSelected, 
       
    47     EShareNoneAndShareAllSelected,
       
    48     ENoShareNoneOrShareAllSelected
       
    49     };
       
    50 /**
       
    51  * CUpnpMultiselectionUtility utility class
       
    52  * @since S60 3.1
       
    53  */
       
    54 NONSHARABLE_CLASS( CUpnpMultiselectionUtility ): public CBase
       
    55     {
       
    56 public: // Constructors and destructor
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     virtual ~CUpnpMultiselectionUtility();
       
    62 
       
    63     /**
       
    64      * C++ default constructor.
       
    65      */
       
    66     CUpnpMultiselectionUtility();
       
    67 
       
    68     /**
       
    69      * Collect selected items to a listbox
       
    70      * @since S60 3.1
       
    71      */
       
    72     void CollectSelectedItemsL( CEikListBox* aListBox, 
       
    73                                 TBool aFirstRun = EFalse );
       
    74 
       
    75     /**
       
    76      * Do internal decisions based on user's selections on the UI
       
    77      */
       
    78     void DoSelectionLogicL( CEikListBox* aListBox,
       
    79         TBool aFirstRun,
       
    80         const CArrayFix<TInt>* aIndexes,
       
    81         CAknListBoxFilterItems* aFilter,
       
    82         TShareSelectionState aSelectionState );
       
    83 
       
    84     /**
       
    85      * Loads a possibly skinned icon and adds it to icon array
       
    86      * @since S60 3.1
       
    87      * @param CAknIconArray, array of icons
       
    88      * @param MAknsSkinInstance, skin instance
       
    89      * @param TDesC, reference to icon file
       
    90      * @param TAknsItemID, skinned icon id
       
    91      * @param TInt, bitmap id
       
    92      * @param TInt, bitmap mask id
       
    93      */
       
    94     void AppendIconToArrayL( CAknIconArray* aArray,
       
    95                              MAknsSkinInstance* aSkin,
       
    96                              const TDesC& aMbmFile,
       
    97                              const TAknsItemID& aID,
       
    98                              TInt aBitmapId,
       
    99                              TInt aMaskId ) const;
       
   100 
       
   101     /**
       
   102      * Appends first item ("share all files") to the listbox
       
   103      * @since S60 3.1
       
   104      * @param CDesCArray, listbox array
       
   105      */
       
   106     void AppendShareAllSelectionL( CDesCArray* aListBoxArray ) const;
       
   107 
       
   108     /** 
       
   109      * Convert selections from UI to engine as "old style" selections
       
   110      * Effect only in case Share All is selected
       
   111      * @since S60 3.1
       
   112      * @param CArrayFix<TInt>& The selection indexes to modify
       
   113      */
       
   114     void ConvertSelectionsForEngineL( CArrayFix<TInt>& aSelections ) const;
       
   115 
       
   116     /** 
       
   117      * Sets iShareNoneSelected and iShareAllSelected member variables.
       
   118      * @since S60 3.1
       
   119      * @param TShareSelectionState share all and do not share selection state
       
   120      */
       
   121     void SetShareSelectionState( TShareSelectionState aSelectionState );
       
   122 
       
   123     /** 
       
   124      * Returns ShareSelectionState from the array.
       
   125      * @since S60 3.1
       
   126      * @param const CArrayFix<TInt>& array of selection indexes.
       
   127      */
       
   128     TShareSelectionState ShareSelectionStateFromArray( 
       
   129         const CArrayFix<TInt>& aIndexes ) const;
       
   130      
       
   131 private:
       
   132     TBool iShareNoneSelected;
       
   133     TBool iShareAllSelected;
       
   134     };
       
   135 
       
   136 #endif //UPNPMULTISELECTIONUTILITY_H
       
   137 
       
   138 // End of File