|
1 /* |
|
2 * Copyright (c) 2005 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: DS contacts dataprovider. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __NSMLCONTACTSDATAPROVIDER_H__ |
|
20 #define __NSMLCONTACTSDATAPROVIDER_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <f32file.h> |
|
24 #include <SmlDataProvider.h> |
|
25 #include <NSmlContactsDataStore.h> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 // ------------------------------------------------------------------------------------------------ |
|
30 // CNSmlContactsDataProvider |
|
31 // |
|
32 // @lib nsmlcontactsdataprovider.lib |
|
33 // ------------------------------------------------------------------------------------------------ |
|
34 class CNSmlContactsDataProvider : public CSmlDataProvider |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 */ |
|
40 IMPORT_C static CNSmlContactsDataProvider* NewL(); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 IMPORT_C virtual ~CNSmlContactsDataProvider(); |
|
46 |
|
47 protected: |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 IMPORT_C static CNSmlContactsDataProvider* NewLC(); |
|
52 |
|
53 /** |
|
54 * This method handles framework events. |
|
55 * @param Frameworks event. |
|
56 * @param aParam1 First parameter. |
|
57 * @param aParam2 Second parameter. |
|
58 */ |
|
59 IMPORT_C void DoOnFrameworkEvent(TSmlFrameworkEvent, TInt aParam1, TInt aParam2); |
|
60 |
|
61 /** |
|
62 * Check if operation is supported by dataprovider. |
|
63 * @param aOpId Operations type. |
|
64 * @return ETrue if the operation is supported. |
|
65 */ |
|
66 IMPORT_C TBool DoSupportsOperation(TUid aOpId) const; |
|
67 |
|
68 /** |
|
69 * Gets dataproviders own StoreFormat. |
|
70 */ |
|
71 IMPORT_C const CSmlDataStoreFormat& DoStoreFormatL(); |
|
72 |
|
73 /** |
|
74 * Lists all contacts databases on client. |
|
75 * @return List of contact databases. |
|
76 */ |
|
77 IMPORT_C CDesCArray* DoListStoresLC(); |
|
78 |
|
79 /** |
|
80 * Gets default storename on client. |
|
81 * @return Default storename. |
|
82 */ |
|
83 IMPORT_C const TDesC& DoDefaultStoreL(); |
|
84 |
|
85 /** |
|
86 * Constructs new instance of datastore. |
|
87 * @return Newly created instance. |
|
88 */ |
|
89 IMPORT_C CSmlDataStore* DoNewStoreInstanceLC(); |
|
90 |
|
91 /** |
|
92 This method returns the set of filters that can be used to send to the SyncML server. |
|
93 * @return New filters. |
|
94 */ |
|
95 IMPORT_C const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL(); |
|
96 |
|
97 /** |
|
98 This method checks what filters are supported by server. |
|
99 @param aServerDataStoreFormat The store format of server |
|
100 @param aFilters The array that includes filters |
|
101 @param aChangeInfo The change information about changes that data provider did |
|
102 */ |
|
103 IMPORT_C void DoCheckSupportedServerFiltersL(const CSmlDataStoreFormat& aServerDataStoreFormat, RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo); |
|
104 |
|
105 /** |
|
106 This method updates dynamic filters up-to-date. |
|
107 @param aFilters The array that includes filters |
|
108 @param aChangeInfo The change information about changes that data provider did |
|
109 */ |
|
110 IMPORT_C void DoCheckServerFiltersL(RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo); |
|
111 |
|
112 /** |
|
113 This method generates a record filter query to be sent to the SyncML server for the provided filters. |
|
114 @param aFilters The filters to be used for the query generation |
|
115 @param aMatch The filter match type to be used |
|
116 @param aFilterMimeType The mime type of the returned filter query |
|
117 @param TSyncMLFilterType The filter type of the returned filter query |
|
118 @param aStoreName The name of used store |
|
119 @return The record filter query to be sent to the SyncML server - empty if no record filter involved |
|
120 for this specific filter |
|
121 */ |
|
122 IMPORT_C HBufC* DoGenerateRecordFilterQueryLC(const RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, TSyncMLFilterType& aFilterType, TDesC& aStoreName); |
|
123 |
|
124 /** |
|
125 This method generates a field filter query to be sent to the SyncML server for the provided filters. |
|
126 @param aFilters The filters to be used for the query generation |
|
127 @param aFilterMimeType The mime type of the returned filter query |
|
128 @param aProperties The field filter query to be sent to the SyncML server - empty if no field filter involved |
|
129 for this specific filter |
|
130 @param aStoreName The name of used store |
|
131 */ |
|
132 IMPORT_C void DoGenerateFieldFilterQueryL(const RPointerArray<CSyncMLFilter>& aFilters, TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName); |
|
133 |
|
134 /** |
|
135 * C++ constructor. |
|
136 */ |
|
137 IMPORT_C CNSmlContactsDataProvider(); |
|
138 |
|
139 /** |
|
140 * 2nd phase constructor. |
|
141 */ |
|
142 IMPORT_C void ConstructL(); |
|
143 |
|
144 protected: // New |
|
145 |
|
146 IMPORT_C virtual const TDesC& GetStoreFormatResourceFileL() const; |
|
147 |
|
148 IMPORT_C virtual CNSmlContactsDataStore* CreateDataStoreLC() const; |
|
149 |
|
150 private: // data |
|
151 CNSmlContactsDataStore* iContactsDataStore; |
|
152 RPointerArray<CSyncMLFilter> iFilterArray; |
|
153 RFs iRfs; |
|
154 RStringPool iStringPool; |
|
155 CSmlDataStoreFormat* iStoreFormat; |
|
156 }; |
|
157 |
|
158 #endif // __NSMLCONTACTSDATAPROVIDER_H__ |
|
159 |
|
160 // End of File |