phonebookui/Phonebook2/inc/CPbk2AddItemToContactDlg.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 add new contact field to a contact dialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2ADDITEMTOCONTACTDLG_H
       
    20 #define CPBK2ADDITEMTOCONTACTDLG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <TPbk2AddItemDialogParams.h>
       
    25 #include <MPbk2DialogEliminator.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CEikFormattedCellListBox;
       
    29 class TPbk2AddItemWrapper;
       
    30 class CAknPopupList;
       
    31 class MPbk2ApplicationServices;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Phonebook 2 add new contact field to a contact dialog.
       
    37  */
       
    38 class CPbk2AddItemToContactDlg : public CBase,
       
    39                                  public MPbk2DialogEliminator
       
    40     {
       
    41     public: // Constructors and destructor
       
    42 
       
    43 		/**
       
    44 		 * Creates a new instance of this class.
       
    45 		 *
       
    46 		 * @return  A new instance of this class.
       
    47 		 */
       
    48 		IMPORT_C static CPbk2AddItemToContactDlg* NewL();
       
    49 	
       
    50         /**
       
    51          * Creates a new instance of this class.
       
    52          *
       
    53          * @return  A new instance of this class.
       
    54          */
       
    55         IMPORT_C static CPbk2AddItemToContactDlg* NewL( MPbk2ApplicationServices* aAppServices );
       
    56 
       
    57         /**
       
    58          * Destructor.
       
    59          */
       
    60         ~CPbk2AddItemToContactDlg();
       
    61 
       
    62     public: // Interface
       
    63 
       
    64         /**
       
    65          * Executes the dialog.
       
    66          *
       
    67          * @param aAddItems     An array of items to show in the dialog.
       
    68          * @param aParams       Add item dialog parameters.
       
    69          * @return  Index of selected TPbk2AddItemWrapper in
       
    70          *          aAddItems array or KErrCancel if the dialog
       
    71          *          was canceled.
       
    72          */
       
    73         IMPORT_C TInt ExecuteLD(
       
    74                 RArray<TPbk2AddItemWrapper>& aAddItems,
       
    75                 const TPbk2AddItemDialogParams* aParams = NULL );
       
    76 
       
    77     public: // From MPbk2DialogEliminator
       
    78         void RequestExitL(
       
    79                 TInt aCommandId );
       
    80         void ForceExit();
       
    81         void ResetWhenDestroyed(
       
    82                 MPbk2DialogEliminator** aSelfPtr );
       
    83 
       
    84     private: // Implementation
       
    85         CPbk2AddItemToContactDlg( MPbk2ApplicationServices* aAppServices = NULL );
       
    86         void PreparePopupL(
       
    87                 RArray<TPbk2AddItemWrapper>& aAddItems,
       
    88                 const TPbk2AddItemDialogParams* aParams );
       
    89         TInt ExecutePopupL(
       
    90                 const TPbk2AddItemDialogParams* aParams );
       
    91 
       
    92     private: // Data
       
    93         /// Own: To check is this destroyed
       
    94         TBool* iDestroyedPtr;
       
    95         /// Own: List box
       
    96         CEikFormattedCellListBox* iListBox;
       
    97         /// Own: Popup list
       
    98         CAknPopupList* iPopup;
       
    99         /// Ref: Set to NULL when this dialog is destroyed
       
   100         MPbk2DialogEliminator** iSelfPtr;
       
   101         // Ref: Pbk2 application services
       
   102         MPbk2ApplicationServices* iAppServices;
       
   103     };
       
   104 
       
   105 #endif // CPBK2ADDITEMTOCONTACTDLG_H
       
   106 
       
   107 // End of File