|         |      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:  This is a class for creating data of contact  | 
|         |     15  *                for launching CCA application. | 
|         |     16  * | 
|         |     17 */ | 
|         |     18  | 
|         |     19  | 
|         |     20 #ifndef M_MCCAPARAMETER_H | 
|         |     21 #define M_MCCAPARAMETER_H | 
|         |     22  | 
|         |     23 #include <e32std.h> | 
|         |     24 #include <cntdef.h> | 
|         |     25 #include <MVPbkContactLink.h> | 
|         |     26  | 
|         |     27 //Use this UID to get pointer to access interface MCCAConnectionExt. The MCCAConnectionExt  | 
|         |     28 //is used for special MCCAConnection binary compatiblity purposes only and it does not  | 
|         |     29 //relate to MCCAParameter. Ownership of returned MCCAConnectionExt needs to be taken. | 
|         |     30 //If MCCAConnectionExt cannot be provided because e.g. lack of memory, NULL is returned. | 
|         |     31 const TUid KMCCAConnectionExtUid = { 1 }; | 
|         |     32  | 
|         |     33 /** @file mccaparameter.h | 
|         |     34  *    | 
|         |     35  * 	MCCAParameter class is used to store, control and define how the CCA application is launched  | 
|         |     36  *  with the contact specified data. | 
|         |     37  *   | 
|         |     38  *  Example usage of the API:  | 
|         |     39  *  @code | 
|         |     40  *   MCCAParameter* aParameter = TCCAFactory::NewParameterL() | 
|         |     41  *   aParameter->SetConnectionFlag(ENormal); | 
|         |     42  *   aParameter->SetContactDataFlag(EContactId); | 
|         |     43  *   aParameter->SetContactDataL(aString); | 
|         |     44  *    | 
|         |     45  *   aParameter->SetLaunchedViewUid(aUid); | 
|         |     46  * | 
|         |     47  *  @endcode | 
|         |     48  * | 
|         |     49  *  @lib ccaclient | 
|         |     50  *  @since S60 v5.0 | 
|         |     51  */ | 
|         |     52 class MCCAParameter | 
|         |     53     { | 
|         |     54  | 
|         |     55 public: | 
|         |     56  | 
|         |     57     /** Flags for controlling opening and closing of CCA application */ | 
|         |     58     enum TConnectionFlags | 
|         |     59         { | 
|         |     60         // Default flag | 
|         |     61         ENormal = 0x00000001, | 
|         |     62 		//Upon exit close only CCA | 
|         |     63         ESoftExit = 0x00000002  | 
|         |     64         }; | 
|         |     65  | 
|         |     66     /**  | 
|         |     67      * Flags for indicating type of contact data  | 
|         |     68      * | 
|         |     69      * Notes related to specific search types below: | 
|         |     70      * EContactId | 
|         |     71      * EContactLink | 
|         |     72      */ | 
|         |     73     enum TContactDataFlags | 
|         |     74         { | 
|         |     75         EContactNone = 0, | 
|         |     76         EContactId,         //Depricated; not supported anymore. | 
|         |     77         EContactLink, | 
|         |     78         EContactMSISDN      //Depricated; not supported anymore. | 
|         |     79         }; | 
|         |     80  | 
|         |     81     /** | 
|         |     82      * Destroy this parameter entity and all its data. | 
|         |     83      * @since S60 5.0 | 
|         |     84      */ | 
|         |     85     virtual void Close() = 0; | 
|         |     86  | 
|         |     87     /** | 
|         |     88      * Getter for the flags of connection. | 
|         |     89      * @since S60 5.0 | 
|         |     90      * @return the flags. | 
|         |     91      */ | 
|         |     92     virtual TConnectionFlags ConnectionFlag() = 0; | 
|         |     93  | 
|         |     94     /** | 
|         |     95      * Getter for the contact data flags. | 
|         |     96      * @since S60 5.0 | 
|         |     97      * @return the flags. | 
|         |     98      */ | 
|         |     99     virtual TContactDataFlags ContactDataFlag() = 0; | 
|         |    100  | 
|         |    101     /** | 
|         |    102      * Getter for the contact data. | 
|         |    103      * @leave KErrArgument if data not set. | 
|         |    104      * @since S60 5.0 | 
|         |    105      * @return the reference of contact data. | 
|         |    106      */ | 
|         |    107     virtual HBufC& ContactDataL() = 0; | 
|         |    108  | 
|         |    109     /** | 
|         |    110      * Getter for the view uid. | 
|         |    111      * @since S60 5.0 | 
|         |    112      * @return the Uid. | 
|         |    113      */ | 
|         |    114     virtual TUid LaunchedViewUid() = 0; | 
|         |    115  | 
|         |    116     /** | 
|         |    117      * Getter for the version. | 
|         |    118      * @since S60 5.0 | 
|         |    119      * @return the version. | 
|         |    120      */ | 
|         |    121     virtual TInt32 Version() = 0; | 
|         |    122  | 
|         |    123     /** | 
|         |    124      * Setter for the flag of connection. | 
|         |    125      * | 
|         |    126      * @see TConnectionFlags      | 
|         |    127      * @since S60 5.0 | 
|         |    128      * @param aFlags: flags of connection | 
|         |    129      */ | 
|         |    130     virtual void | 
|         |    131             SetConnectionFlag(const TConnectionFlags aConnectionFlags) = 0; | 
|         |    132  | 
|         |    133     /** | 
|         |    134      * Setter for the contact data flag. | 
|         |    135      * | 
|         |    136      * @see TContactDataFlags      | 
|         |    137      * @since S60 5.0 | 
|         |    138      * @param aFlags: flags of connection | 
|         |    139      */ | 
|         |    140     virtual void | 
|         |    141             SetContactDataFlag(const TContactDataFlags aContactDataFlags) = 0; | 
|         |    142  | 
|         |    143     /** | 
|         |    144      * Setter for the contact data. | 
|         |    145      * If you are using TContactDataFlags::EContactLink, the MVPbkContactLink | 
|         |    146      * should be streamed with PackLC before given for this method. | 
|         |    147      * Ownership is NOT transferred.  | 
|         |    148      * @see MVPbkContactLink from Virtual phonebook.  | 
|         |    149      * @leave KErrNotFound if contact data flag is not  | 
|         |    150      *        set before calling this method. | 
|         |    151      * @see MCCAParameter::SetContactDataFlags | 
|         |    152      * @since S60 5.0 | 
|         |    153      * @param aContactData: given contact data. | 
|         |    154      */ | 
|         |    155     virtual void SetContactDataL(const TDesC& aContactData) = 0; | 
|         |    156  | 
|         |    157     /** | 
|         |    158      * Setter for the launched view uid. Use this when there | 
|         |    159      * is need to get a particular view opened first on launch of CCA.  | 
|         |    160      * If view uid is not set, CCA uses the default view.  | 
|         |    161      * @since S60 5.0 | 
|         |    162      * @param aContactData: given contact data. | 
|         |    163      */ | 
|         |    164     virtual void SetLaunchedViewUid(const TUid aUid) = 0; | 
|         |    165  | 
|         |    166     /** | 
|         |    167      * Returns an extension point for this interface or NULL. | 
|         |    168      * @param aExtensionUid Uid of extension | 
|         |    169      * @return Extension point or NULL | 
|         |    170      */ | 
|         |    171     virtual TAny* CcaParameterExtension(  | 
|         |    172             TUid /*aExtensionUid*/ ) { return NULL; } | 
|         |    173  | 
|         |    174     }; | 
|         |    175  | 
|         |    176 #endif // M_MCCAPARAMETER_H | 
|         |    177 // End of File |