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