emailcontacts/contactactionservice/inc/cfsccontactactionservice.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Declaration of class CFscContactActionService.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSCCONTACTACTIONSERVICE_H
       
    20 #define C_FSCCONTACTACTIONSERVICE_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 //<cmail>
       
    25 #include "fsccontactactionservicedefines.h"
       
    26 //</cmail>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CVPbkContactManager;
       
    30 class MFscContactAction;
       
    31 class MFscContactLinkIterator;
       
    32 class MFscContactActionServiceObserver;
       
    33 
       
    34 /**
       
    35  *  Contact Action Service API.
       
    36  *  Defines an ECom interface for the Contact Action Service.
       
    37  *
       
    38  *  @since S60 3.1
       
    39  */
       
    40 class CFscContactActionService : public CBase
       
    41     {
       
    42 
       
    43 public: // Public constructor and destructor
       
    44 
       
    45     /**
       
    46      * Two-phased constructor.
       
    47      *
       
    48      * @return Pointer to new instance of CFscContactActionService   
       
    49      */
       
    50     static inline CFscContactActionService* NewL( 
       
    51             CVPbkContactManager& aContactManager );
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     virtual ~CFscContactActionService();
       
    57     
       
    58 public: // Public methods
       
    59 
       
    60     /**
       
    61      * Method for setting current contact set to the service.
       
    62      * 
       
    63      * @param aIterator iterator to collection of MVPbkContactLink objects.
       
    64      *                  Collection can contain links to contacts and group. 
       
    65      */
       
    66     virtual void SetContactSetL( MFscContactLinkIterator* aIterator ) = 0;
       
    67     
       
    68     /**
       
    69      * Method for setting current contact set to the service.
       
    70      * 
       
    71      * @param aStoreContactList collection of MVPbkStoreContact objects.
       
    72      *                          Collection can contain ONLY contacts 
       
    73      *                          (no groups).
       
    74      */
       
    75     virtual void SetContactSetL( 
       
    76             const RFscStoreContactList& aStoreContactList ) = 0;
       
    77     
       
    78     /**
       
    79      * Method for quering available actions
       
    80      * Method searches actions for pre-set contact/group set. 
       
    81      * Results can be received with QueryResults method.
       
    82      * Asynchronous. Data is ready when observer's QueryActionsComplete 
       
    83      * method is invoked.
       
    84      *
       
    85      * @param aObsever operation observer.
       
    86      * @param aStopWhenOneActionFound stops query when at least one 
       
    87      *                                action found.
       
    88      * @param aActionTypeFlags Action type flags which are used to filter
       
    89      *                         actions.
       
    90      * @param aMinPriority Minimum allowed priority for returned actions.
       
    91      */
       
    92     virtual void QueryActionsL(
       
    93         MFscContactActionServiceObserver* aObserver,
       
    94         TBool aStopWhenOneActionFound = EFalse,
       
    95         TUint64 aActionTypeFlags = KFscAtDefault, 
       
    96         TInt aMinPriority = 0 ) = 0;
       
    97     
       
    98     /**
       
    99      * Cancels async method QueryActionsL.
       
   100      */
       
   101     virtual void CancelQueryActions() = 0; 
       
   102 
       
   103     /**
       
   104      * Return action query results.
       
   105      * Empty list is returned if no queries has been done
       
   106      *
       
   107      * @return action query result list
       
   108      */
       
   109     virtual const CFscContactActionList& QueryResults() const = 0; 
       
   110 
       
   111     /**
       
   112      * Execute action.
       
   113      * Asynchronous. Data is ready when observer's ExecuteComplete 
       
   114      * mthod is invoked.
       
   115      *
       
   116      * @param aActionUid uid of action to be executed
       
   117      */
       
   118     virtual void ExecuteL( 
       
   119         TUid aActionUid, 
       
   120         MFscContactActionServiceObserver* aObserver ) = 0;
       
   121     
       
   122     /**
       
   123      * Cancels async method ExecuteL.
       
   124      */
       
   125     virtual void CancelExecute() = 0;
       
   126                                          
       
   127 private: // data
       
   128 
       
   129     /** iDtor_ID_Key Instance identifier key. When instance of an
       
   130      *               implementation is created by ECOM framework, the
       
   131      *               framework will assign UID for it. The UID is used in
       
   132      *               destructor to notify framework that this instance is
       
   133      *               being destroyed and resources can be released.
       
   134      */
       
   135     TUid iDtor_ID_Key;
       
   136 
       
   137     };
       
   138 
       
   139 /**
       
   140  *  Construction parameters for Action Menu
       
   141  *
       
   142  *  @since S60 3.1
       
   143  */
       
   144 class TFscContactActionServiceConstructParameters
       
   145     {
       
   146 
       
   147 public: // Public methods
       
   148 
       
   149     /**
       
   150      * Constructor
       
   151      *
       
   152      * @param aService Pointer to Contact Action Service
       
   153      * @param aMode Menu mode
       
   154      */
       
   155     TFscContactActionServiceConstructParameters( 
       
   156         CVPbkContactManager& aVPbkContactManager ) 
       
   157         : iVPbkContactManager( aVPbkContactManager ) {}
       
   158    
       
   159 public: // Public members
       
   160 
       
   161     /**
       
   162      * Reference to virtual phonebook contact manager.
       
   163      */
       
   164     CVPbkContactManager& iVPbkContactManager;
       
   165 
       
   166     };
       
   167 
       
   168 #include "cfsccontactactionservice.inl"
       
   169 
       
   170 #endif // C_FSCCONTACTACTIONSERVICE_H