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