phonebookui/Phonebook2/ccapplication/ccacontactorservice/inc/ccacontactorservice.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 starting services
       
    15  *                provided by CCA contactor service
       
    16  *
       
    17 */
       
    18 
       
    19 #ifndef __CCACONTACTORSERVICE_H__
       
    20 #define __CCACONTACTORSERVICE_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <f32file.h>
       
    25 #include <VPbkFieldTypeSelectorFactory.h>
       
    26 
       
    27 //FORWARD DECLARATIONS
       
    28 
       
    29 class CCCAContactorServiceOperator;
       
    30 
       
    31 /**
       
    32  *  CCAContactorService
       
    33  *
       
    34  *  Class for starting services of CCA contactor service.
       
    35  *  @code
       
    36  *      HBufC* fullName = GetFullNameLC();
       
    37  *      CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC();
       
    38  *      linkArray->AppendL(iContactLink);
       
    39  *      HBufC8* streamedArray = linkArray->PackLC();
       
    40  *
       
    41  *      //Set control flags.
       
    42  *      TUint flags;
       
    43  *      flags |= CCAContactorService::TCSParameter::EEnableDefaults;
       
    44  *
       
    45  *      CCAContactorService::TCSParameter params(VPbkFieldTypeSelectorFactory::EVoiceCallSelector, *streamedArray, flags, *fullName);
       
    46  *      CCAContactorService::ExecuteServiceL(params);
       
    47  *
       
    48  *      CleanupStack::PopAndDestroy(3); //linkArray, streamedArray, fullName
       
    49  *
       
    50  *  @endcode
       
    51  *
       
    52  *  @lib CCAContactorService
       
    53  *  @since S60 v5.0
       
    54  */
       
    55 NONSHARABLE_CLASS(CCAContactorService) : CBase
       
    56     {
       
    57 public:
       
    58 
       
    59     /**
       
    60      * Parameter class for the service.
       
    61      *
       
    62      * @since S60 v5.0
       
    63      */
       
    64     class TCSParameter
       
    65         {
       
    66         public:
       
    67 
       
    68         /** Flags for controlling CCA Contactor Service */
       
    69         enum TControlFlags
       
    70             {
       
    71             /**
       
    72              * Enable defaults. If this is set, AIW popup query will automatically search possible
       
    73              * default settings and if found one, it doesn't show selection query at all.
       
    74              */
       
    75             EEnableDefaults  = 0x0001,
       
    76             
       
    77             /**
       
    78              * Clients may offer a particular field to be used in launching a service. Use the 
       
    79              * provided aSelectedField parameter to pass the field  data to be used. If this 
       
    80              * flag is set the AIW query will not be shown, the service will automatically launch 
       
    81              * the service. aSelectedField parameter must be valid.
       
    82              */
       
    83             EUseFieldParam = 0x0002
       
    84             };
       
    85 
       
    86         /*
       
    87          * Constructor
       
    88          */
       
    89         inline TCSParameter(
       
    90                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aCommTypeSelector,
       
    91                 TDesC8& aContactLinkArray, TUint aControlFlag, TDesC& aFullName, TDesC& aSelectedField) :
       
    92                 iCommTypeSelector(aCommTypeSelector),
       
    93                 iContactLinkArray(aContactLinkArray),
       
    94                 iControlFlag(aControlFlag),
       
    95                 iFullName(aFullName),
       
    96                 iSelectedField(&aSelectedField)
       
    97             {
       
    98             };
       
    99         
       
   100         /*
       
   101          * Constructor
       
   102          */
       
   103         inline TCSParameter(
       
   104                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aCommTypeSelector,
       
   105                 TDesC8& aContactLinkArray, TUint aControlFlag, TDesC& aFullName) :
       
   106                 iCommTypeSelector(aCommTypeSelector),
       
   107                 iContactLinkArray(aContactLinkArray),
       
   108                 iControlFlag(aControlFlag),
       
   109                 iFullName(aFullName),
       
   110                 iSelectedField(NULL)
       
   111             {
       
   112             };
       
   113 
       
   114         /* !DEPRICATED!
       
   115          * Constructor
       
   116          */
       
   117         inline TCSParameter(
       
   118                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aCommTypeSelector,
       
   119                 TDesC8& aContactLinkArray, TBool aEnableDefaults, TDesC& aFullName) :
       
   120                 iCommTypeSelector(aCommTypeSelector),
       
   121                 iContactLinkArray(aContactLinkArray),
       
   122                 iEnableDefaults(aEnableDefaults),
       
   123                 iFullName(aFullName),
       
   124                 iSelectedField(NULL)
       
   125             {
       
   126             };
       
   127 
       
   128          /*
       
   129          * Enumeration for inticating which communication method is wanted to use.
       
   130          *
       
   131          * @since S60 v5.0
       
   132          */
       
   133         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector iCommTypeSelector;
       
   134 
       
   135         /*
       
   136          * Streamed contact link array of contact who will be communicated at.
       
   137          *
       
   138          * @since S60 v5.0
       
   139          */
       
   140         TDesC8& iContactLinkArray;
       
   141 
       
   142         /* !DEPRICATED!
       
   143          * Use defaults. If this is enabled, AIW popup query will automatically search possible
       
   144          * default settings and if found one, it doesn't show query at all.
       
   145          *
       
   146          * @since S60 v5.0
       
   147          */
       
   148         TBool iEnableDefaults;
       
   149 
       
   150         /**
       
   151          * Flag for controlling behaviour of service. Currently only set of default supported.
       
   152          */
       
   153         TUint iControlFlag;
       
   154 
       
   155         /*
       
   156          * Some communication methods requires contacts name order to use services.
       
   157          * (for example mms/sms editor)
       
   158          *
       
   159          * @since S60 v5.0
       
   160          */
       
   161         TDesC& iFullName;
       
   162         
       
   163         /*
       
   164          * Clients may offer a particular field to be used in launching a service. This 
       
   165          * member stores the field.
       
   166          */
       
   167         TDesC* iSelectedField;
       
   168         };
       
   169 
       
   170     /**
       
   171      *
       
   172      */
       
   173     IMPORT_C static CCAContactorService* NewL();
       
   174 
       
   175     /**
       
   176      * Destructor.
       
   177      */
       
   178     virtual ~CCAContactorService();
       
   179 
       
   180     /**
       
   181      * Start communication service.
       
   182      *
       
   183      * If the contactlink contains a multiple contact fields for selected communication
       
   184      * method, the executed service will launch Phbk AIW selection popup. User have to select
       
   185      * wanted field to be used for communication.
       
   186      * The communication method is defined by TVPbkCommTypeSelector.
       
   187      * After selection, communication is automatically started by the service.
       
   188      *
       
   189      * @see TVPbkCommTypeSelector from VPbkFieldTypeSelectorFactory.h.
       
   190      * Leaves KErrArgument if given parameter doesn't have valid values.
       
   191      *
       
   192      * @since S60 5.0
       
   193      * @param aParameter: The Launch Parameter.
       
   194      */
       
   195     IMPORT_C void ExecuteServiceL(const TCSParameter& aParameter);
       
   196 
       
   197     /**
       
   198      * Is contactor service busy.
       
   199      */
       
   200     IMPORT_C TBool IsBusy() const;
       
   201     
       
   202    /**
       
   203     * Is call item selected.
       
   204     */
       
   205     IMPORT_C TBool IsSelected() const;
       
   206 
       
   207 private:
       
   208     /**
       
   209      * Constructor.
       
   210      */
       
   211     CCAContactorService();
       
   212 
       
   213     /**
       
   214      *
       
   215      */
       
   216     void ConstructL();
       
   217 
       
   218 private:
       
   219     // data
       
   220 
       
   221     /**
       
   222      *
       
   223      */
       
   224     CCCAContactorServiceOperator* iOperator;
       
   225     
       
   226     /**
       
   227      * ETrue, if command is being handled at the moment
       
   228      */
       
   229     TBool iCommandIsBeingHandled;
       
   230     };
       
   231 
       
   232 #endif      //__CCACONTACTORSERVICE_H__
       
   233 
       
   234 // End of File