inc/CPEngContactListTransaction2.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Presence contact list transactions.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CPENGCONTACTLISTTRANSACTION2_H
       
    19 #define __CPENGCONTACTLISTTRANSACTION2_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include <BamDescA.h>
       
    24 
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MPEngContactList2;
       
    28 class CPEngContactListTransaction2Imp;
       
    29 class CPEngNWSessionSlotID2;
       
    30 class MPEngContactListTransactionObserver2;
       
    31 
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Transaction API for presence contact lists.
       
    38  *
       
    39  * With this API clients can publish contact
       
    40  * lists to network.
       
    41  *
       
    42  * Contact list publish operations are asynchronous network operations,
       
    43  * and their end results are signalled to given operation observer.
       
    44  *
       
    45  * @lib PEngManager2.lib
       
    46  * @since 3.0
       
    47  */
       
    48 class CPEngContactListTransaction2 : public CBase
       
    49     {
       
    50 
       
    51         //-----------------------------------------------------------------------
       
    52     public: /* Construction */
       
    53 
       
    54         /**
       
    55          * Instantiates CPEngContactListTransaction2 object.
       
    56          *
       
    57          * Instantiates CPEngContactListTransaction2 object and connects
       
    58          * it to identified Presence Engine NWSessionSlot. NWSessionSlot
       
    59          * must be a valid, existing slot.
       
    60          *
       
    61          * Errors:
       
    62          *  - Requested NWSessionSlot not found: KErrNotFound
       
    63          *  - Given NWSessionSlotID malformed: KErrArgument
       
    64          *
       
    65          * @param aNWSessionSlotID The session slot ID to identify the
       
    66          * session slot.
       
    67          * @param aPriority The priority for CPEngContactListTransaction2
       
    68          * client side active objects. These active objects are used when
       
    69          * asynchronously delivering events to observers.
       
    70          *
       
    71          * @return New CPEngContactListTransaction2 instance.
       
    72          */
       
    73         IMPORT_C static CPEngContactListTransaction2* NewL(
       
    74             const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    75             TInt aPriority = CActive::EPriorityStandard );
       
    76 
       
    77         IMPORT_C static CPEngContactListTransaction2* NewLC(
       
    78             const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    79             TInt aPriority = CActive::EPriorityStandard );
       
    80 
       
    81 
       
    82         /**
       
    83          * Destructor.
       
    84          * Virtual by CBase.
       
    85          */
       
    86         ~CPEngContactListTransaction2();
       
    87 
       
    88 
       
    89 
       
    90     private:
       
    91 
       
    92         CPEngContactListTransaction2();
       
    93 
       
    94 
       
    95 
       
    96         //-----------------------------------------------------------------------
       
    97     public: /* Contact lists base synchronization */
       
    98 
       
    99 
       
   100         /**
       
   101          * Tests is the contact list base synchronize already active.
       
   102          *
       
   103          * @since 3.0
       
   104          * @return ETrue if operation is active. Else EFalse.
       
   105          */
       
   106         IMPORT_C TBool IsBaseSynchronizeContactListsActive() const;
       
   107 
       
   108 
       
   109 
       
   110         /**
       
   111          * Base synchronizes list of contact lists with network server.
       
   112          *
       
   113          * There can be just one active base synchronization
       
   114          * operation at a time per one CPEngContactListTransaction2 instance.
       
   115          *
       
   116          * @since 3.0
       
   117          * @param aObserver The observer to notify from contact list
       
   118          * 					base synchronization events.
       
   119          * 		  aNeedToSubscribe ETrue if the lists need to be unsubscribed
       
   120          * 					during base synchronization.
       
   121          * @return Result from initiating contact base synchronization:
       
   122          *  - KErrNone if contact list base synchronization succesfully initiated.
       
   123          *  - KErrInUse if base synchronization already on going.
       
   124          *  - Else one of system wide error codes.
       
   125          */
       
   126         IMPORT_C TInt BaseSynchronizeContactLists(
       
   127             MPEngContactListTransactionObserver2& aObserver );
       
   128 
       
   129         IMPORT_C TInt BaseSynchronizeContactLists(
       
   130             MPEngContactListTransactionObserver2& aObserver,
       
   131             TBool aNeedToUnsubscribe );
       
   132 
       
   133         /**
       
   134          * Cancels the contact list base synchronize.
       
   135          *
       
   136          * @since 3.0
       
   137          */
       
   138         IMPORT_C void CancelBaseSynchronizeContactLists();
       
   139 
       
   140 
       
   141 
       
   142 
       
   143 
       
   144         //-----------------------------------------------------------------------
       
   145     public: /* Contact list publish & synchronization */
       
   146 
       
   147 
       
   148         /**
       
   149          * Tests is the contact list publish or
       
   150          * synchronize already active.
       
   151          *
       
   152          * @since 3.0
       
   153          * @return ETrue if operation is active. Else EFalse.
       
   154          */
       
   155         IMPORT_C TBool IsContactListPubSyncActive() const;
       
   156 
       
   157 
       
   158 
       
   159         /**
       
   160          * Synchronizes the contact list with the network server.
       
   161          *
       
   162          * There can be just one active contact list publish or
       
   163          * synchronization  operation at a time per one
       
   164          * CPEngContactListTransaction2 instance.
       
   165          *
       
   166          * @since 3.0
       
   167          * @param aContactListName The contact list(s) to synchronize.
       
   168          * @param aObserver The observer to notify from contact list
       
   169          * synchronize events.
       
   170          * @return Result from initiating contact list synchronize:
       
   171          *  - KErrNone if contact list synchronize succesfully initiated.
       
   172          *  - KErrNotfound if requested contact list not found.
       
   173          *  - KErrInUse if contact synchronize already on going from object.
       
   174          *  - Else one of system wide error codes.
       
   175          */
       
   176         IMPORT_C TInt SynchronizeContactList(
       
   177             const TDesC& aContactListName,
       
   178             MPEngContactListTransactionObserver2& aObserver );
       
   179 
       
   180         IMPORT_C TInt SynchronizeContactLists(
       
   181             const MDesCArray& aContactListNames,
       
   182             MPEngContactListTransactionObserver2& aObserver );
       
   183 
       
   184 
       
   185         /**
       
   186          * Publishes the contact list to the network server.
       
   187          *
       
   188          * There can be just one active contact list publish or
       
   189          * synchronization  operation at a time per one
       
   190          * CPEngContactListTransaction2 instance.
       
   191          *
       
   192          * @since 3.0
       
   193          * @param aContactListName The contact list(s) to publish.
       
   194          * @param aObserver The observer to notify from contact list
       
   195          * publish events.
       
   196          * @return Result from initiating contact list publish:
       
   197          *  - KErrNone if contact list publish succesfully initiated.
       
   198          *  - KErrNotfound if requested contact list not found.
       
   199          *  - KErrInUse if contact publish already on going from object.
       
   200          *  - Else one of system wide error codes.
       
   201          */
       
   202         IMPORT_C TInt PublishContactList(
       
   203             const TDesC& aContactListName,
       
   204             MPEngContactListTransactionObserver2& aObserver );
       
   205 
       
   206         IMPORT_C TInt PublishContactLists(
       
   207             const MDesCArray& aContactListNames,
       
   208             MPEngContactListTransactionObserver2& aObserver );
       
   209 
       
   210 
       
   211 
       
   212         /**
       
   213          * Cancels the current contact list publish or synchronize
       
   214          * operation.
       
   215          *
       
   216          * @since 3.0
       
   217          */
       
   218         IMPORT_C void CancelContactListPubSync();
       
   219 
       
   220 
       
   221 
       
   222 
       
   223         //-----------------------------------------------------------------------
       
   224     private: /* Data */
       
   225 
       
   226 
       
   227         //OWN: Implementation
       
   228         CPEngContactListTransaction2Imp*     iImp;
       
   229 
       
   230     };
       
   231 
       
   232 
       
   233 
       
   234 #endif  //__CPENGCONTACTLISTTRANSACTION2_H
       
   235 
       
   236 //End of file
       
   237 
       
   238