phoneengine/PhoneCntFinder/inc/CPhoneCntSaveAddToName.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Add number to existing name and save the number.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHONECNTSAVEADDTONAME_H
       
    20 #define CPHONECNTSAVEADDTONAME_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // DATA TYPES
       
    26 enum TCntNumberType
       
    27     {
       
    28     /**
       
    29     * If saved type is normal number.
       
    30     */
       
    31     ECntNormalNumber = 0,
       
    32     /**
       
    33     * If saved type is normal number it could be used in SIP Uri.
       
    34     */
       
    35     ECntVoiceInternetNumber,
       
    36     /**
       
    37     * If saved type is internet number.
       
    38     */
       
    39     ECntOnlyInternetNumber,
       
    40     /**
       
    41     * If saved type is internet number and could be used like
       
    42     * email address.
       
    43     */
       
    44     ECntInternetEmailField    
       
    45     };    
       
    46 
       
    47 // KCntPhoneNumberMaxLength must be same as MPhEngCallHandling::TPhEngPhoneNumber  
       
    48 const TInt KCntPhoneNumberMaxLength = 100;     
       
    49 typedef TBuf<KCntPhoneNumberMaxLength> TCntPhoneNumber;
       
    50 
       
    51 // FORWARD DECLARATIONS
       
    52 class CPbkDataSaveAppUi;
       
    53 class CPbkViewResourceLoader;
       
    54 class MPhoneCntPbkOwner;
       
    55 class MPhCntPhonebookServices;
       
    56 
       
    57 // CLASS DECLARATION
       
    58 
       
    59 /**
       
    60 *  MPhoneCntSaveAddToName
       
    61 *
       
    62 *  Abstact class for saving new entry and adding data to old phonebook entry.
       
    63 *
       
    64 *  @lib PhoneCntFinder
       
    65 *  @since 1.0
       
    66 */
       
    67 NONSHARABLE_CLASS( MPhoneCntSaveAddToName )
       
    68     {
       
    69     public: // New functions   
       
    70     
       
    71         virtual ~MPhoneCntSaveAddToName()  {};
       
    72         
       
    73         /**
       
    74         * Handles phonebook operation
       
    75         * @param aTelNumber Telephone number to save
       
    76         * @param aCommand Given command (new, update existing)
       
    77         */
       
    78         virtual void HandlePbkOperationL( 
       
    79             const TCntPhoneNumber& aTelNumber,                                            
       
    80             TInt aCommand ) = 0;
       
    81             
       
    82         /**
       
    83         * Handles phonebook operation.
       
    84         * @since Series60 3.0
       
    85         * @param aTelNumber Telephone number to save
       
    86         * @param aCommand Given command (new, update existing)
       
    87         * @param aNumberType Type of saved telnumber (E.g If not numeric
       
    88         *                    could not save to the Phone number field)
       
    89         */       
       
    90         virtual void HandlePbkOperationL(
       
    91             const TCntPhoneNumber& aTelNumber,
       
    92             TInt aCommand,
       
    93             TCntNumberType aNumberType ) = 0;    
       
    94        };
       
    95 
       
    96 
       
    97 
       
    98 /**
       
    99 *  This class is used to add number to existing name and to save the number.
       
   100 *
       
   101 *  @lib PhoneCntFinder
       
   102 *  @since 1.0
       
   103 */
       
   104 class CPhoneCntSaveAddToName
       
   105     : public CBase, 
       
   106       public MPhoneCntSaveAddToName
       
   107     {
       
   108     public: // New functions       
       
   109         /**
       
   110         * Two-phased constructor.
       
   111         * @param aPbkOwner Phonebook owner.
       
   112         * @return new instance of the class.
       
   113         */
       
   114         static CPhoneCntSaveAddToName* NewL( MPhCntPhonebookServices& aServices );
       
   115 
       
   116         /**
       
   117         * Destructor.
       
   118         */
       
   119         IMPORT_C ~CPhoneCntSaveAddToName();
       
   120 
       
   121     public : // Functions from base classes
       
   122 
       
   123         /**
       
   124         * From MPhoneCntSaveAddToName
       
   125         */
       
   126         IMPORT_C void HandlePbkOperationL(
       
   127             const TCntPhoneNumber& aTelNumber,
       
   128             TInt aCommand );
       
   129         
       
   130         /**
       
   131         * From MPhoneCntSaveAddToName
       
   132         * @since 3.0
       
   133         */
       
   134         IMPORT_C void HandlePbkOperationL(
       
   135             const TCntPhoneNumber& aTelNumber,
       
   136             TInt aCommand,
       
   137             TCntNumberType aNumberType );    
       
   138     private:
       
   139         
       
   140         /**
       
   141         * C++ constructor.
       
   142         */
       
   143         CPhoneCntSaveAddToName( MPhCntPhonebookServices& aServices  );
       
   144         
       
   145     private://data
       
   146     
       
   147         /**
       
   148          * Service for creating and updating contacts.
       
   149          * Not own.
       
   150          */
       
   151         MPhCntPhonebookServices& iServices;
       
   152 
       
   153     };
       
   154 
       
   155 #endif      // CPHONECNTSAVEADDTONAME_H
       
   156             
       
   157 // End of File