|
1 /* |
|
2 * Copyright (c) 2007 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: ECom data adapters plugin interface definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_PS_DATAPLUGIN_H |
|
20 #define C_PS_DATAPLUGIN_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <ecom/ecom.h> |
|
25 |
|
26 // USER INCLUDES |
|
27 #include <mdatastoreobserver.h> |
|
28 #include <mstorelistobserver.h> |
|
29 // CLASS DECLARATION |
|
30 |
|
31 // Structure to hold PsData Plugin observers. |
|
32 // Need structure to pass as a parameter to ECOM interface |
|
33 struct TPsDataPluginParams |
|
34 { |
|
35 // Constructor |
|
36 TPsDataPluginParams( MDataStoreObserver* aDataStoreObserver, MStoreListObserver* aStoreListObserver ) |
|
37 : iDataStoreObserver( aDataStoreObserver ), iStoreListObserver( aStoreListObserver ) {} |
|
38 // Data |
|
39 MDataStoreObserver* iDataStoreObserver; |
|
40 MStoreListObserver* iStoreListObserver; |
|
41 }; |
|
42 |
|
43 /** |
|
44 * Data plug-ins (Ecom) interface definition. |
|
45 * This class acts as an interface for all the data stores (which will be |
|
46 * searched by the PS Algorithm). The Data stores have to inherit from |
|
47 * this class. |
|
48 * |
|
49 * @since S60 v3.2 |
|
50 */ |
|
51 class CPsDataPlugin: public CBase |
|
52 { |
|
53 |
|
54 public: |
|
55 |
|
56 /** |
|
57 * Ecom interface static factory method implementation. |
|
58 * @param aImpUid Ecom's implementation uid |
|
59 * @param aObserverForDataStore An observer instance for data store |
|
60 * @param aStoreListObserver A store list observer instance |
|
61 * @return A pointer to the created instance of CPsDataPlugin |
|
62 */ |
|
63 static inline CPsDataPlugin* NewL( TUid aImpUid, MDataStoreObserver* aObserverForDataStore, |
|
64 MStoreListObserver* aStoreListObserver ); |
|
65 |
|
66 /** |
|
67 * Ecom interface static factory method implementation. |
|
68 * |
|
69 * @param aImpUid Ecom's implementation uid |
|
70 * @param aObserverForDataStore An observer instance for data store |
|
71 * @param aStoreListObserver A store list observer instance |
|
72 * @return A pointer to the created instance of CPsDataPlugin |
|
73 */ |
|
74 static inline CPsDataPlugin* NewLC( TUid aImpUid, MDataStoreObserver* aObserverForDataStore, |
|
75 MStoreListObserver* aStoreListObserver ); |
|
76 |
|
77 /** |
|
78 * Destructor |
|
79 */ |
|
80 virtual ~CPsDataPlugin(); |
|
81 |
|
82 public: |
|
83 |
|
84 /** |
|
85 * Gets the plugin id. |
|
86 * |
|
87 * @return Id of the plugin. |
|
88 */ |
|
89 inline TUid PluginId() const; |
|
90 |
|
91 /** |
|
92 * Gets the supported data stores URIs |
|
93 * Implementation needs to be provided by the data adapters |
|
94 * |
|
95 * @param aDataStores supported data stores URIs |
|
96 * |
|
97 */ |
|
98 virtual void GetSupportedDataStoresL( RPointerArray<TDesC> &aDataStoresURIs ) = 0; |
|
99 |
|
100 /** |
|
101 * Checks if the given data store is supported. |
|
102 * Implementation needs to be provided by the data adapters |
|
103 * |
|
104 * @param aDataStoreURI data store |
|
105 * @return True if this store is supported |
|
106 */ |
|
107 virtual TBool IsDataStoresSupportedL( TDesC& aDataStoreURI ) = 0; |
|
108 |
|
109 /** |
|
110 * Gets the supported data fields |
|
111 * Implementation needs to be provided by the data adapters |
|
112 * |
|
113 * @param aDataStores supported data fields |
|
114 * |
|
115 */ |
|
116 virtual void GetSupportedDataFieldsL( RArray<TInt>& aDataFields ) = 0; |
|
117 |
|
118 /** |
|
119 * Requests for data from this store |
|
120 * Implementation needs to be provided by the data adapters |
|
121 * The adapters need to pass an instance of the observer. The data |
|
122 * to the algorithm is provided via the observer callback |
|
123 * |
|
124 * @param aObserverForDataStore An observer instance used to |
|
125 */ |
|
126 virtual void RequestForDataL(TDesC& aDataStoreURI )=0; |
|
127 |
|
128 private: |
|
129 |
|
130 /** |
|
131 * The plugin id |
|
132 */ |
|
133 TUid iPluginId; |
|
134 |
|
135 /** |
|
136 * Used internally to create ECOM implementation |
|
137 */ |
|
138 TUid iDtor_ID_Key; |
|
139 |
|
140 }; |
|
141 |
|
142 #include "CPsDataPlugin.inl" |
|
143 |
|
144 #endif // C_PS_DATAPLUGIN_H |
|
145 |
|
146 // End of File |
|
147 |