landmarksui/uicontrols/inc/TLmkDeletionHelper.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002 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:    LandmarksUi Content File -    This class helps updating the listbox after deleting item(s).
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef TLMKDELETIONHELPER_H
       
    25 #define TLMKDELETIONHELPER_H
       
    26 
       
    27 //  INCLUDES
       
    28 #include <e32std.h>
       
    29 #include <e32base.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CEikListBox;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * This class offers an easy way to handle list update when user is
       
    38 * deleting items. This class does not own heap data.
       
    39 */
       
    40 class TLmkDeletionHelper
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * C++ default constructor.
       
    46         */
       
    47         TLmkDeletionHelper();
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         virtual ~TLmkDeletionHelper();
       
    53 
       
    54     public: // New functions
       
    55 
       
    56         /**
       
    57         * Store list information when use has requested deleting one
       
    58         * or more items.
       
    59         * @param aListBox reference to the listbox
       
    60         * @param aMultipleItems ETrue if user is deleting multiple items
       
    61         */
       
    62         void StoreListInformation( CEikListBox& aListBox,
       
    63                                    TBool aMultipleItems );
       
    64 
       
    65         /**
       
    66         * Updates the list using AknListBoxUtils if delete happened,
       
    67         * i.e. StoreListInformation() has been previously called.
       
    68         * @return ETrue if list was updated, EFalse otherwise
       
    69         */
       
    70         TBool UpdateListIfDeleteHappenedL();
       
    71 
       
    72     private:    // Data
       
    73         /// marked ETrue when starting to delete
       
    74         TBool iUserRequestedDelete;
       
    75 
       
    76         /// required by AknListBoxUtils
       
    77         TInt iCurrentItemIndexBeforeRemoval;
       
    78 
       
    79         /// required by AknListBoxUtils
       
    80         TBool iCurrentItemWasRemoved;
       
    81 
       
    82         ///Ref: required by AknListBoxUtils
       
    83         const CArrayFix<TInt>* iIndexesToRemovedItems;
       
    84 
       
    85         ///Ref: list to be updated
       
    86         CEikListBox* iListBox;
       
    87     };
       
    88 
       
    89 #endif      // TLMKDELETIONHELPER_H
       
    90 
       
    91 // End of File