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: Definition of the class CPbkxRemoteContactLookupProtocolAdapter. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBKXREMOTECONTACTLOOKUPADAPTER_H |
|
20 #define CPBKXREMOTECONTACTLOOKUPADAPTER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cntitem.h> |
|
24 #include "cpbkxremotecontactlookupprotocolaccount.h" |
|
25 #include "cpbkxremotecontactlookupprotocolsession.h" |
|
26 #include "mpbkxremotecontactlookupprotocolenv.h" |
|
27 |
|
28 /** |
|
29 * Adaptation interface for different synchronization protocols. |
|
30 * |
|
31 * @since S60 3.1 |
|
32 */ |
|
33 class CPbkxRemoteContactLookupProtocolAdapter : public CBase |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 * |
|
41 * @param aProtocolUid UID of the protocol ECom plugin |
|
42 * @param aProtocolEnv factory for the data objects needed by the adapter |
|
43 */ |
|
44 static CPbkxRemoteContactLookupProtocolAdapter* NewL( |
|
45 TUid aProtocolUid, |
|
46 MPbkxRemoteContactLookupProtocolEnv& aProtocolEnv ); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CPbkxRemoteContactLookupProtocolAdapter(); |
|
52 |
|
53 /** |
|
54 * Factory method for creating protocol accounts. The creation of the account will |
|
55 * be only succesful if protocol account for the given identifier exists. Ownership |
|
56 * of the instance is given to the caller. |
|
57 * |
|
58 * @param aAccountId account identifier |
|
59 * @return protocol account |
|
60 */ |
|
61 virtual CPbkxRemoteContactLookupProtocolAccount* NewProtocolAccountL( |
|
62 const TPbkxRemoteContactLookupProtocolAccountId& aAccountId ) = 0; |
|
63 |
|
64 /** |
|
65 * Appends all the available protocol accounts to the array. Owernship of the |
|
66 * accounts is transfered to the caller. |
|
67 * |
|
68 * Given array MUST NOT be reset. |
|
69 * |
|
70 * @param aAccounts an array containing all the available protocol |
|
71 * accounts. |
|
72 */ |
|
73 virtual void GetAllProtocolAccountsL( |
|
74 RPointerArray<CPbkxRemoteContactLookupProtocolAccount>& aAccounts ) = 0; |
|
75 |
|
76 /** |
|
77 * Factory method for creating protocol sessions that are used to perform remote |
|
78 * lookups. Owernship of the instance is given to the caller. |
|
79 * |
|
80 * @return protocol session |
|
81 */ |
|
82 virtual CPbkxRemoteContactLookupProtocolSession* NewSessionL() = 0; |
|
83 |
|
84 private: // data |
|
85 |
|
86 /** iDtor_ID_Key Instance identifier key. When instance of an |
|
87 * implementation is created by ECOM framework, the |
|
88 * framework will assign UID for it. The UID is used in |
|
89 * destructor to notify framework that this instance is |
|
90 * being destroyed and resources can be released. |
|
91 */ |
|
92 TUid iDtor_ID_Key; |
|
93 }; |
|
94 |
|
95 #include "cpbkxremotecontactlookupprotocoladapter.inl" |
|
96 |
|
97 #endif // CPBKXREMOTECONTACTLOOKUPADAPTER_H |
|