phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselectionimpl.h
changeset 0 5f000ab63145
child 19 544e34b3255a
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 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:  Service to show dialogs for user to select contact data.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTCONTACTDATASELECTIONIMPL_H
       
    20 #define CPHCNTCONTACTDATASELECTIONIMPL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "cphcntcontactdataselection.h"
       
    25 #include "tphcntcontactlinkresult.h"
       
    26 #include "mphcntaiwservice.h"
       
    27 #include "MPhCntContactFetchObserver.h"
       
    28 #include "MPhCntMatch.h"
       
    29 
       
    30 class MPhCntServiceRequestParamFactory;
       
    31 class MPhCntServiceRequestParam;
       
    32 class MPhCntContactStores;
       
    33 
       
    34 /**
       
    35  * User selected data from phonebook services.
       
    36  *
       
    37  * @lib PhoneCntFinder
       
    38  * @since S60 v3.2
       
    39  */
       
    40 NONSHARABLE_CLASS( CPhCntSelectedDataImpl ) : public CPhCntSelectedData
       
    41     {
       
    42 public:
       
    43     
       
    44     /**
       
    45      * Static constructor.
       
    46      *
       
    47      * @param aContact Selected contact. Note that aContact needs to
       
    48      * be valid as long NewL is executed. So CPhCntContact can be 
       
    49      * deleted after call to this NewL
       
    50      */
       
    51     static CPhCntSelectedDataImpl* NewL( CPhCntContact& aContact );
       
    52     
       
    53     ~CPhCntSelectedDataImpl();
       
    54     
       
    55 // from base class CPhCntSelectedData
       
    56 
       
    57     const TDesC& Data() const;
       
    58     
       
    59     /**
       
    60      * Phonebook's link, which points to the selected
       
    61      * data.
       
    62      */
       
    63     const TDesC8& FieldLink() const;
       
    64     
       
    65     /**
       
    66      * Number type
       
    67      */
       
    68     MPhCntMatch::TNumberType NumberType() const;
       
    69    
       
    70     
       
    71 private:
       
    72     CPhCntSelectedDataImpl();
       
    73     
       
    74     void ConstructL( CPhCntContact& aContact );
       
    75     
       
    76 private: // Data
       
    77 
       
    78     /**
       
    79      * Own.
       
    80      */
       
    81     HBufC8* iFieldLink;
       
    82     
       
    83     /**
       
    84      * Own
       
    85      */
       
    86     HBufC* iSelectedData;
       
    87     
       
    88     /**
       
    89      * Specifies number type for selection
       
    90      */
       
    91     MPhCntMatch::TNumberType iNumberType;
       
    92     
       
    93     };
       
    94 
       
    95 /**
       
    96  *  Implements the CPhCntContactDataSelection interface
       
    97  *
       
    98  *  @lib PhoneCntFinder.lib
       
    99  *  @since S60 v3.2
       
   100  */
       
   101 NONSHARABLE_CLASS( CPhCntContactDataSelectionImpl ) : 
       
   102     public CPhCntContactDataSelection,
       
   103     private MPhCntAiwServiceObserver,
       
   104     private MPhCntContactFetchObserver
       
   105     {
       
   106 
       
   107 public:
       
   108 
       
   109     static CPhCntContactDataSelectionImpl* NewL(
       
   110         MPhCntAiwService* aService,
       
   111         MPhCntServiceRequestParamFactory* aParamFactory,
       
   112         MPhCntContactStores* iContactStores );
       
   113     
       
   114     virtual ~CPhCntContactDataSelectionImpl();
       
   115 
       
   116 // from base class CPhCntContactDataSelection
       
   117 
       
   118     /**
       
   119      * From CPhCntContactDataSelection
       
   120      *
       
   121      * @see CPhCntContactDataSelection
       
   122      * @since S60 v3.2
       
   123      */
       
   124     TBool IsActive() const;
       
   125     
       
   126     /**
       
   127      * From CPhCntContactDataSelection
       
   128      * ?description
       
   129      *
       
   130      * @see CPhCntContactDataSelection
       
   131      * @since S60 v3.2
       
   132      */
       
   133     void Cancel();
       
   134 
       
   135     /**
       
   136      * From CPhCntContactDataSelection
       
   137      *
       
   138      * @see CPhCntContactDataSelection
       
   139      * @since S60 v3.2
       
   140      */
       
   141     void SelectPhoneNumberForCallL(
       
   142         const TDesC8& aContactLink,
       
   143         const TCallType& aCallType,
       
   144         MPhCntSelectionObserver& aObserver );
       
   145         
       
   146 private:
       
   147 
       
   148 // from base class MPhCntAiwServiceObserver
       
   149 
       
   150     /**
       
   151      * From MPhCntAiwServiceObserver
       
   152      * Indication that service has completed.
       
   153      *
       
   154      * @since S60 v3.2
       
   155      * @param aError Error code
       
   156      */ 
       
   157     void RequestComplete( TInt aError );
       
   158     
       
   159 // from base class MPhCntContactFetchObserver
       
   160 
       
   161     /**
       
   162      * From MPhCntContactFetchObserver
       
   163      * Indication that contact is fetched.
       
   164      *
       
   165      * @since S60 v3.2
       
   166      * @param aError Error code
       
   167      */ 
       
   168     void ContactReceived( CPhCntContact* aContact, TInt aError );
       
   169    
       
   170 private:
       
   171 
       
   172     CPhCntContactDataSelectionImpl( 
       
   173         MPhCntAiwService* aService,
       
   174         MPhCntServiceRequestParamFactory* aParamFactory,
       
   175         MPhCntContactStores* aContactStores );
       
   176 
       
   177     void ConstructL();
       
   178 
       
   179 private: // data
       
   180 
       
   181         /**
       
   182          * Service interface for accessing phonebook services.
       
   183          * Own.
       
   184          */
       
   185         MPhCntAiwService* iService;
       
   186         
       
   187         /** 
       
   188          * Factory to create service request parameters.
       
   189          * Own.
       
   190          */
       
   191         MPhCntServiceRequestParamFactory* iParamFactory;
       
   192         
       
   193         /**
       
   194          * Parameters used with service.
       
   195          * Own.
       
   196          */
       
   197         MPhCntServiceRequestParam* iServiceParameter;
       
   198         
       
   199         /** 
       
   200          * Result from service.
       
   201          * Own.
       
   202          */
       
   203         TPhCntContactLinkResult iServiceResult;
       
   204         
       
   205         /**
       
   206          * Field link from service.
       
   207          * Own.
       
   208          */
       
   209         HBufC8* iFieldLink;
       
   210         
       
   211         
       
   212         /** 
       
   213          * Observer for the request.
       
   214          * Not own.
       
   215          */
       
   216         MPhCntSelectionObserver* iObserver;
       
   217         
       
   218         /**
       
   219          * Store to fetch contact.
       
   220          * Own.
       
   221          */
       
   222         MPhCntContactStores* iContactStores;
       
   223 
       
   224     };
       
   225 
       
   226 #endif // CPHCNTCONTACTDATASELECTIONIMPL_H