|
1 /* |
|
2 * Copyright (c) 2005-2010 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: Part of SyncML Data Synchronization Plug In Adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MMSDATAPROVIDER_H__ |
|
20 #define __MMSDATAPROVIDER_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <SmlDataProvider.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CMmsDataStore; |
|
27 class CSmlDataStoreFormat; |
|
28 |
|
29 /** |
|
30 * @brief This class is derived from ECom Data Provider plugin-interface (CSmlDataProvider). |
|
31 * It makes it possible to synchronize MMS messages from the device message store. |
|
32 */ |
|
33 class CMmsDataProvider : public CSmlDataProvider, public MMsvSessionObserver |
|
34 { |
|
35 |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Constructor. |
|
40 * |
|
41 * @return CMmsDataProvider*, a new CMmsDataProvider instance. |
|
42 */ |
|
43 static CMmsDataProvider* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CMmsDataProvider(); |
|
49 |
|
50 /** |
|
51 * Callback from MMsvSessionObserver. |
|
52 */ |
|
53 void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3 ); |
|
54 |
|
55 protected: // Inherited from CSmlDataProvider |
|
56 |
|
57 virtual void DoOnFrameworkEvent( TSmlFrameworkEvent, TInt aParam1, TInt aParam2 ); |
|
58 |
|
59 virtual TBool DoSupportsOperation( TUid aOpId ) const; |
|
60 |
|
61 virtual const CSmlDataStoreFormat& DoStoreFormatL(); |
|
62 |
|
63 virtual CDesCArray* DoListStoresLC(); |
|
64 |
|
65 virtual const TDesC& DoDefaultStoreL(); |
|
66 |
|
67 virtual CSmlDataStore* DoNewStoreInstanceLC(); |
|
68 |
|
69 virtual void DoCheckSupportedServerFiltersL( const CSmlDataStoreFormat& aServerDataStoreFormat, |
|
70 RPointerArray<CSyncMLFilter>& aFilters, TSyncMLFilterChangeInfo& aChangeInfo ); |
|
71 |
|
72 virtual void DoCheckServerFiltersL( RPointerArray<CSyncMLFilter>& aFilters, |
|
73 TSyncMLFilterChangeInfo& aChangeInfo ); |
|
74 |
|
75 virtual const RPointerArray<CSyncMLFilter>& DoSupportedServerFiltersL(); |
|
76 |
|
77 virtual TBool DoSupportsUserSelectableMatchType() const; |
|
78 |
|
79 virtual HBufC* DoGenerateRecordFilterQueryLC( const RPointerArray<CSyncMLFilter>& aFilters, |
|
80 TSyncMLFilterMatchType aMatch, TDes& aFilterMimeType, |
|
81 TSyncMLFilterType& aFilterType, TDesC& aStoreName ); |
|
82 |
|
83 virtual void DoGenerateFieldFilterQueryL( const RPointerArray<CSyncMLFilter>& aFilters, |
|
84 TDes& aFilterMimeType, RPointerArray<CSmlDataProperty>& aProperties, TDesC& aStoreName ); |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * C++ Constructor. |
|
90 */ |
|
91 CMmsDataProvider(); |
|
92 |
|
93 /** |
|
94 * 2nd-phase Constructor. |
|
95 */ |
|
96 void ConstructL(); |
|
97 |
|
98 /** |
|
99 * Creates new DataStore format. |
|
100 */ |
|
101 CSmlDataStoreFormat* DoOwnStoreFormatL(); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * String pool, used in store format creation. |
|
107 */ |
|
108 RStringPool iStringPool; |
|
109 |
|
110 /** |
|
111 * Data store format. |
|
112 */ |
|
113 CSmlDataStoreFormat* iOwnStoreFormat; |
|
114 |
|
115 /** |
|
116 * Supported filters (none supported at the moment). |
|
117 */ |
|
118 RPointerArray<CSyncMLFilter> iFilters; |
|
119 |
|
120 /** |
|
121 * File system handle. |
|
122 */ |
|
123 RFs iRFs; |
|
124 |
|
125 /** |
|
126 * Message store handle. |
|
127 */ |
|
128 CMsvSession* iMsvSession; |
|
129 |
|
130 /** |
|
131 * Reserved pointer for future extension. |
|
132 */ |
|
133 TAny* iReserved; |
|
134 |
|
135 }; |
|
136 |
|
137 #endif // __MMSDATAPROVIDER_H__ |