phoneengine/PhoneCntFinder/ContactService/inc/cphcntcontactdataselection.h
changeset 0 5f000ab63145
child 9 8871b09be73b
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 CPHCNTCONTACTDATASELECTION_H
       
    20 #define CPHCNTCONTACTDATASELECTION_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "MPhCntMatch.h"
       
    24 
       
    25 NONSHARABLE_CLASS( CPhCntSelectedData ) : public CBase
       
    26     {
       
    27 public:
       
    28 
       
    29     /**
       
    30      * Number selected by user.
       
    31      */
       
    32     virtual const TDesC& Data() const = 0;
       
    33     
       
    34     /**
       
    35      * Phonebook's link, which points to the selected
       
    36      * data.
       
    37      */
       
    38     virtual const TDesC8& FieldLink() const = 0;
       
    39     
       
    40     /**
       
    41      * Number type
       
    42      */
       
    43     virtual MPhCntMatch::TNumberType NumberType() const = 0;
       
    44    
       
    45     };
       
    46 
       
    47 /**
       
    48  * Observer for contact selection.
       
    49  *
       
    50  * @lib PhoneCntFinder.lib
       
    51  * @since S60  v3.2
       
    52  */
       
    53 class MPhCntSelectionObserver 
       
    54     {
       
    55 public:
       
    56     
       
    57     /**
       
    58      * Callback to indicate that selection is done. 
       
    59      *
       
    60      * @param aContactData Selected data. May be NULL if error occured. Ownership is not transferred.
       
    61      * @param aErrorCode Possible system wide error code if error occured.
       
    62      */
       
    63     virtual void SelectionDone( CPhCntSelectedData* aContactData, TInt aErrorCode ) = 0;
       
    64     };
       
    65 
       
    66 /**
       
    67  *  Interface for showing dialogs for selectiong contact data.
       
    68  *
       
    69  *  @lib PhoneCntFinder
       
    70  *  @since S60 v3.2
       
    71  */
       
    72 NONSHARABLE_CLASS( CPhCntContactDataSelection ) : public CBase
       
    73     {
       
    74 
       
    75 public:
       
    76 
       
    77     /**
       
    78 	 * Phone number filtering
       
    79 	 * 
       
    80 	 * ECallPhoneNumber		- CS
       
    81      * ECallVoip,          	- PS
       
    82      * ECallVideoNumber,    - Video 
       
    83 	 */
       
    84 	enum TCallType
       
    85         {
       
    86         ECallPhoneNumber, 
       
    87         ECallVoip, 
       
    88         ECallVideoNumber 
       
    89         };
       
    90 
       
    91     /**
       
    92      * Determines if request is active.
       
    93      *
       
    94      * @since S60 v3.2
       
    95      * @return ETrue - Request is pending
       
    96      *         EFalse - No requests active.
       
    97      */
       
    98     virtual TBool IsActive() const = 0;
       
    99     
       
   100     /**
       
   101      * Cancels any outstanding request.
       
   102      * 
       
   103      * @post IsActive() == EFalse
       
   104      *
       
   105      * @since S60 v3.2
       
   106      */
       
   107     virtual void Cancel() = 0;
       
   108 
       
   109     /**
       
   110      * Shows a dialog for user to select a phonenumber from specified contact. 
       
   111      * The contact is specified by the contact link. Observer is notified
       
   112      * when the user has made the selection or canceled the dialog.
       
   113      *
       
   114      * @pre IsActive() == EFalse, leaves with error code KErrInUse.
       
   115      * Otherwise may leave with system wide errorcode.
       
   116      *
       
   117      * @since S60 v3.2
       
   118      * @param aContactLink Link to the contact, which number is to be selected.
       
   119      * @param aCallType Type of number, which will be shown to be selected.
       
   120      * @param aObserver Observer, which is notified when selection is done.
       
   121      */
       
   122      virtual void SelectPhoneNumberForCallL(
       
   123         const TDesC8& aContactLink,
       
   124         const TCallType& aCallType,
       
   125         MPhCntSelectionObserver& aObserver ) = 0;
       
   126 
       
   127     };
       
   128 
       
   129 #endif // CPHCNTCONTACTDATASELECTION_H