|
1 /** |
|
2 * Copyright (c) 2005-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 @released |
|
24 */ |
|
25 |
|
26 |
|
27 #ifndef ITERATORPROXY_H |
|
28 #define ITERATORPROXY_H |
|
29 |
|
30 #include "persistencelayer.h" |
|
31 |
|
32 |
|
33 /** |
|
34 The CViewIteratorProxyManager class is a proxy for the MLplViewIteratorManager |
|
35 class. The proxy is used for client-side access to the required view functions |
|
36 in the Persistence Layer on the server. |
|
37 |
|
38 Internally the proxy makes the relevant IPC calls using the Contacts Model |
|
39 session handle from the Contacts database used to create the proxy object. |
|
40 */ |
|
41 NONSHARABLE_CLASS(CViewIteratorProxyManager) : public CBase , public MLplViewIteratorManager |
|
42 { |
|
43 public: |
|
44 static CViewIteratorProxyManager* NewL(const CContactDatabase& aDb); |
|
45 CViewContact* ItemAtL(const TItemAtLParams& aParams, const CContactTextDef& aDef, TUint aSessionId); |
|
46 void ReadContactTextDefL(TContactItemId aContactId, TDes &aResult,const CContactTextDef& aTextDef, TUint aSessionId); |
|
47 TBool SeekContactL(TContactItemId aReqId,TContactItemId& aId,TUid& aContactType, TBool& aDeleted); |
|
48 TBool SeekIdentContactL(TContactItemId aId); |
|
49 void TextFieldL(TInt aCntItemId,TFieldType aFieldType, TDes& aText); |
|
50 |
|
51 ~CViewIteratorProxyManager(); |
|
52 |
|
53 private: |
|
54 void ConstructL(); |
|
55 CViewIteratorProxyManager(const CContactDatabase& aDb); |
|
56 |
|
57 private: |
|
58 const CContactDatabase& iDb; |
|
59 }; |
|
60 |
|
61 |
|
62 /** |
|
63 The CCollectionProxy class is a proxy for the MLplCollection class. The proxy |
|
64 is used for client-side access to the required collection functions in the |
|
65 Persistence Layer on the server. |
|
66 |
|
67 Internally the proxy makes the relevant IPC calls using the Contacts Model |
|
68 session handle from the Contacts database used to create the proxy object. |
|
69 */ |
|
70 NONSHARABLE_CLASS(CCollectionProxy) : public CBase , public MLplCollection |
|
71 { |
|
72 public: |
|
73 CCollectionProxy(const CContactDatabase& aDb); |
|
74 |
|
75 CContactIdArray* CollectionL(TLplViewType aViewType,TTime aTime = 0,const TDesC& aGuid = KNullDesC); |
|
76 |
|
77 TInt ContactCountL(); |
|
78 |
|
79 void Reset(); |
|
80 |
|
81 void FindAsyncInitL(const TDesC& aText,CContactItemFieldDef* aFieldDef); |
|
82 void FindAsyncTextDefInitL(const CDesCArray& aWords,CContactTextDef* aTextDef); |
|
83 CContactIdArray* FindAsyncL(TBool& aMoreToGo, TUint aSessionId); |
|
84 CContactIdArray* FindL(const TDesC& aText, const CContactItemFieldDef* aFieldDef, TUint aSessionId); |
|
85 |
|
86 TBool ContactMatchesHintFieldL (TInt aBitWiseFilter, TContactItemId aContactId); |
|
87 CContactIdArray* MatchPhoneNumberL(const TDesC& aNumber, const TInt aMatchLengthFromRight); |
|
88 |
|
89 CContactIdArray* FilterDatabaseL(CCntFilter& aFilter); |
|
90 |
|
91 TBool UsesIdentityTableOnly(TInt aFindFlags); |
|
92 void ConstructBitwiseFlagsFromTextDef(TInt& aFindFlags,TInt& aIdentityColumnsCount,const CContactTextDef* aTextDef); |
|
93 |
|
94 private: |
|
95 const CContactDatabase& iDb; |
|
96 }; |
|
97 |
|
98 |
|
99 /** |
|
100 The CProxyFactory class is a proxy for the MLplPersistenceLayerFactory class. |
|
101 It provides methods for accessing several interfaces (which at this level are |
|
102 themselves implemented as proxies). |
|
103 */ |
|
104 NONSHARABLE_CLASS(CProxyFactory) : public CBase, public MLplPersistenceLayerFactory |
|
105 { |
|
106 public: |
|
107 static CProxyFactory* NewL(const CContactDatabase& aDb); |
|
108 ~CProxyFactory(); |
|
109 |
|
110 MLplViewIteratorManager& GetViewIteratorManagerL(); |
|
111 MContactSynchroniser& GetContactSynchroniserL(TUint aSessionId); |
|
112 MLplCollection& GetCollectorL(); |
|
113 |
|
114 private: |
|
115 void ConstructL(); |
|
116 CProxyFactory(const CContactDatabase& aDb); |
|
117 |
|
118 private: |
|
119 const CContactDatabase& iDb; |
|
120 CViewIteratorProxyManager* iManager; |
|
121 CContactSynchroniser* iSynchroniser; |
|
122 CCollectionProxy* iCollection; |
|
123 }; |
|
124 |
|
125 |
|
126 #endif // ITERATORPROXY_H |