phonebookui/Phonebook2/inc/CPbk2MemoryEntryDefaultsAssignDlg.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 memory entry defaults assign dialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2MEMORYENTRYDEFAULTSASSIGNDLG_H
       
    20 #define CPBK2MEMORYENTRYDEFAULTSASSIGNDLG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "MPbk2ClipListBoxText.h"
       
    25 #include <VPbkFieldTypeSelectorFactory.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CAknPopupList;
       
    29 class CPbk2IconArray;
       
    30 class CVPbkContactManager;
       
    31 class CEikFormattedCellListBox;
       
    32 class CPbk2PresentationContactFieldCollection;
       
    33 class MPbk2FieldPropertyArray;
       
    34 class CPbk2ApplicationServices;
       
    35 class CPbk2FieldListBoxModel;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Phonebook 2 memory entry defaults assign dialog.
       
    41  * Responsible for presenting memory entry defaults assign dialog.
       
    42  */
       
    43 NONSHARABLE_CLASS(CPbk2MemoryEntryDefaultsAssignDlg) :
       
    44         public CBase,
       
    45         public MPbk2ClipListBoxText
       
    46     {
       
    47     public: // Construction and destruction
       
    48 
       
    49         /**
       
    50          * Creates a new instance of this class.
       
    51          *
       
    52          * @return  A new instance of this class.
       
    53          */
       
    54         IMPORT_C static CPbk2MemoryEntryDefaultsAssignDlg* NewL();
       
    55 
       
    56         /**
       
    57          * Destructor.
       
    58          */
       
    59         ~CPbk2MemoryEntryDefaultsAssignDlg();
       
    60 
       
    61     public: // Interface
       
    62 
       
    63         /**
       
    64          * Executes the defaults assign dialog.
       
    65          * @param aFields  Collection of presentation fields from
       
    66          *                 where to select the default.
       
    67          * @param aManager Contact manager.
       
    68          * @param aFieldProperties Field properties
       
    69          * @return         Field index selected as default.
       
    70          *                 KErrCancel, if user pressed Cancel.
       
    71          *                 If the returned index is bigger than
       
    72          *                 than the field count indicates, it means
       
    73          *                 that the user decided to remove the default
       
    74          *                 (last choice of the dialog is 'no default').
       
    75          */
       
    76         IMPORT_C TInt ExecuteLD(
       
    77                 const CPbk2PresentationContactFieldCollection& aFields,
       
    78                 const CVPbkContactManager& aManager,
       
    79                 const MPbk2FieldPropertyArray& aFieldProperties,
       
    80                 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID = VPbkFieldTypeSelectorFactory::EEmptySelector );
       
    81 
       
    82 
       
    83     private: // From MPbkClipListBoxText
       
    84         TBool ClipFromBeginning(
       
    85                 TDes& aBuffer,
       
    86                 TInt aItemIndex,
       
    87                 TInt aSubCellNumber );
       
    88 
       
    89     private: // Implementation
       
    90         void ConstructL();
       
    91         CPbk2MemoryEntryDefaultsAssignDlg();
       
    92         void PreparePopupL(
       
    93                 const CPbk2PresentationContactFieldCollection& aFields,
       
    94                 const CVPbkContactManager& aManager,
       
    95                 const MPbk2FieldPropertyArray& aFieldProperties );
       
    96         void CreateModelL(
       
    97                 const CPbk2PresentationContactFieldCollection& aFields,
       
    98                 const CVPbkContactManager& aManager,
       
    99                 const MPbk2FieldPropertyArray& aFieldProperties,
       
   100                 const CPbk2IconArray& aIconArray );
       
   101 
       
   102     private: // Data
       
   103         /// Own: Field selection listbox
       
   104         CEikFormattedCellListBox* iListBox;
       
   105         /// Own: Popup list for the listbox
       
   106         CAknPopupList* iPopupList;
       
   107         /// Ref: Referred TBool is set ETrue in destructor
       
   108         TBool* iDestroyedPtr;
       
   109         /// Own: Application Services
       
   110         CPbk2ApplicationServices* iAppServices;
       
   111         /// Own: Listbox model
       
   112         CPbk2FieldListBoxModel* iModel;
       
   113         // Selector Id
       
   114         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector iSelectorId;
       
   115     };
       
   116 
       
   117 #endif // CPBK2MEMORYENTRYDEFAULTSASSIGNDLG_H
       
   118 
       
   119 // End of File