contacts_plat/cca_launch_api/inc/mccaparameter.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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         EContactDataModel   //Internal flag for Phonebook2
       
    80         };
       
    81 
       
    82     /**
       
    83      * Destroy this parameter entity and all its data.
       
    84      * @since S60 5.0
       
    85      */
       
    86     virtual void Close() = 0;
       
    87 
       
    88     /**
       
    89      * Getter for the flags of connection.
       
    90      * @since S60 5.0
       
    91      * @return the flags.
       
    92      */
       
    93     virtual TConnectionFlags ConnectionFlag() = 0;
       
    94 
       
    95     /**
       
    96      * Getter for the contact data flags.
       
    97      * @since S60 5.0
       
    98      * @return the flags.
       
    99      */
       
   100     virtual TContactDataFlags ContactDataFlag() = 0;
       
   101 
       
   102     /**
       
   103      * Getter for the contact data.
       
   104      * @leave KErrArgument if data not set.
       
   105      * @since S60 5.0
       
   106      * @return the reference of contact data.
       
   107      */
       
   108     virtual HBufC& ContactDataL() = 0;
       
   109 
       
   110     /**
       
   111      * Getter for the view uid.
       
   112      * @since S60 5.0
       
   113      * @return the Uid.
       
   114      */
       
   115     virtual TUid LaunchedViewUid() = 0;
       
   116 
       
   117     /**
       
   118      * Getter for the version.
       
   119      * @since S60 5.0
       
   120      * @return the version.
       
   121      */
       
   122     virtual TInt32 Version() = 0;
       
   123 
       
   124     /**
       
   125      * Setter for the flag of connection.
       
   126      *
       
   127      * @see TConnectionFlags     
       
   128      * @since S60 5.0
       
   129      * @param aFlags: flags of connection
       
   130      */
       
   131     virtual void
       
   132             SetConnectionFlag(const TConnectionFlags aConnectionFlags) = 0;
       
   133 
       
   134     /**
       
   135      * Setter for the contact data flag.
       
   136      *
       
   137      * @see TContactDataFlags     
       
   138      * @since S60 5.0
       
   139      * @param aFlags: flags of connection
       
   140      */
       
   141     virtual void
       
   142             SetContactDataFlag(const TContactDataFlags aContactDataFlags) = 0;
       
   143 
       
   144     /**
       
   145      * Setter for the contact data.
       
   146      * If you are using TContactDataFlags::EContactLink, the MVPbkContactLink
       
   147      * should be streamed with PackLC before given for this method.
       
   148      * Ownership is NOT transferred. 
       
   149      * @see MVPbkContactLink from Virtual phonebook. 
       
   150      * @leave KErrNotFound if contact data flag is not 
       
   151      *        set before calling this method.
       
   152      * @see MCCAParameter::SetContactDataFlags
       
   153      * @since S60 5.0
       
   154      * @param aContactData: given contact data.
       
   155      */
       
   156     virtual void SetContactDataL(const TDesC& aContactData) = 0;
       
   157 
       
   158     /**
       
   159      * Setter for the launched view uid. Use this when there
       
   160      * is need to get a particular view opened first on launch of CCA. 
       
   161      * If view uid is not set, CCA uses the default view. 
       
   162      * @since S60 5.0
       
   163      * @param aContactData: given contact data.
       
   164      */
       
   165     virtual void SetLaunchedViewUid(const TUid aUid) = 0;
       
   166 
       
   167     /**
       
   168      * Returns an extension point for this interface or NULL.
       
   169      * @param aExtensionUid Uid of extension
       
   170      * @return Extension point or NULL
       
   171      */
       
   172     virtual TAny* CcaParameterExtension( 
       
   173             TUid /*aExtensionUid*/ ) { return NULL; }
       
   174 
       
   175     };
       
   176 
       
   177 #endif // M_MCCAPARAMETER_H
       
   178 // End of File