|
1 /* |
|
2 * Copyright (c) 2008 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: An access interface to an adapter module. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MPIMADAPTERACCESS_H |
|
20 #define MPIMADAPTERACCESS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <badesca.h> |
|
24 #include "pimcommon.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MPIMContactAdapterManager; |
|
28 class MPIMContactListAdapter; |
|
29 class MPIMEventAdapterManager; |
|
30 class MPIMEventListAdapter; |
|
31 class MPIMToDoAdapterManager; |
|
32 class MPIMToDoListAdapter; |
|
33 class MPIMLocalizationData; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Provides the elementary access the PIM lists provided by a single adapter |
|
39 * module. |
|
40 */ |
|
41 class MPIMAdapterAccess |
|
42 { |
|
43 public: |
|
44 // Destructor |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~MPIMAdapterAccess() |
|
50 { |
|
51 } |
|
52 |
|
53 public: |
|
54 // New functions |
|
55 |
|
56 /** |
|
57 * Gets list names of given list type from this Adapter. |
|
58 * |
|
59 * @param aListType One of EPIMContactList, EPIMEventList |
|
60 * and EPIMToDoList. |
|
61 * |
|
62 * @return Array of list names of given type. A zero-length |
|
63 * array is returned if the list type is not supported |
|
64 * by this adapter or the list type is invalid. |
|
65 * Caller takes the ownership of the returned object. |
|
66 */ |
|
67 virtual const CDesCArray& ListNamesL(const TPIMListType aListType) = 0; |
|
68 |
|
69 /** |
|
70 * Opens a list managed by this adapter and provides instances of |
|
71 * Adapter Manager, List Adapter and associated Localization Data. |
|
72 * The objects are returned through arguments. If no matching list |
|
73 * exists, the arguments are left untouch. |
|
74 * |
|
75 * If the adapter does not support multiple simultaneous list instances |
|
76 * and an instance already exists, the method leaves. |
|
77 * |
|
78 * @param aListName List name. If NULL, first list if opened (if any). |
|
79 * @param aRetAdapterManager The returned Adapter Manager. |
|
80 * Caller takes the ownership of the returned object. |
|
81 * @param aRetListAdapter The returned List Adapter. |
|
82 * Caller takes the ownership of the returned object. |
|
83 * @param aRetLocalizationData The returned Localization Data. |
|
84 * |
|
85 * @return ETrue, if a Contact list with given name exists and |
|
86 * was successfully opened, EFalse otherwise. |
|
87 * Caller takes the ownership of the returned object. |
|
88 * |
|
89 * @par Leaving: |
|
90 * The method leaves on error. Error codes should be interpreted as |
|
91 * follows: |
|
92 * @li \c KErrAlreadyExists - An instance of the list adapter has already |
|
93 * been opened and multiple simultaneous instances are not |
|
94 * supported. |
|
95 * @li \c KErrNotFound - The native database does not exist any more. |
|
96 * @li Other - The system is non-functional. |
|
97 */ |
|
98 virtual TBool OpenContactListL(const TDesC* aListName, |
|
99 MPIMContactAdapterManager** aRetAdapterManager, |
|
100 MPIMContactListAdapter** aRetListAdapter, |
|
101 MPIMLocalizationData** aRetLocalizationData) = 0; |
|
102 |
|
103 /** |
|
104 * Opens a list managed by this adapter and provides instances of |
|
105 * Adapter Manager, List Adapter and associated Localization Data. |
|
106 * The objects are returned through arguments. If no matching list |
|
107 * exists, the arguments are left untouch. |
|
108 * |
|
109 * If the adapter does not support multiple simultaneous list instances |
|
110 * and an instance already exists, the method leaves. |
|
111 * |
|
112 * @param aListName List name. If NULL, first list if opened (if any). |
|
113 * @param aRetAdapterManager The returned Adapter Manager. |
|
114 * Caller takes the ownership of the returned object. |
|
115 * @param aRetListAdapter The returned List Adapter. |
|
116 * Caller takes the ownership of the returned object. |
|
117 * @param aRetLocalizationData The returned Localization Data. |
|
118 * |
|
119 * @return ETrue, if a Event list with given name exists and |
|
120 * was successfully opened, EFalse otherwise. |
|
121 * Caller takes the ownership of the returned object. |
|
122 * |
|
123 * @par Leaving: |
|
124 * The method leaves on error. Error codes should be interpreted as |
|
125 * follows: |
|
126 * @li \c KErrAlreadyExists - An instance of the list adapter has already |
|
127 * been opened and multiple simultaneous instances are not |
|
128 * supported. |
|
129 * @li \c KErrNotFound - The native database does not exist any more. |
|
130 * @li Other - The system is non-functional. |
|
131 */ |
|
132 virtual TBool OpenEventListL(const TDesC* aListName, |
|
133 MPIMEventAdapterManager** aRetAdapterManager, |
|
134 MPIMEventListAdapter** aRetListAdapter, |
|
135 MPIMLocalizationData** aRetLocalizationData) = 0; |
|
136 |
|
137 /** |
|
138 * Opens a list managed by this adapter and provides instances of |
|
139 * Adapter Manager, List Adapter and associated Localization Data. |
|
140 * The objects are returned through arguments. If no matching list |
|
141 * exists, the arguments are left untouch. |
|
142 * |
|
143 * If the adapter does not support multiple simultaneous list instances |
|
144 * and an instance already exists, the method leaves. |
|
145 * |
|
146 * @param aListName List name. If NULL, first list if opened (if any). |
|
147 * @param aRetAdapterManager The returned Adapter Manager. |
|
148 * Caller takes the ownership of the returned object. |
|
149 * @param aRetListAdapter The returned List Adapter. |
|
150 * Caller takes the ownership of the returned object. |
|
151 * @param aRetLocalizationData The returned Localization Data. |
|
152 * |
|
153 * @return ETrue, if a ToDo list with given name exists and |
|
154 * was successfully opened, EFalse otherwise. |
|
155 * Caller takes the ownership of the returned object. |
|
156 * |
|
157 * @par Leaving: |
|
158 * The method leaves on error. Error codes should be interpreted as |
|
159 * follows: |
|
160 * @li \c KErrAlreadyExists - An instance of the list adapter has already |
|
161 * been opened and multiple simultaneous instances are not |
|
162 * supported. |
|
163 * @li \c KErrNotFound - The native database does not exist any more. |
|
164 * @li Other - The system is non-functional. |
|
165 */ |
|
166 virtual TBool OpenToDoListL(const TDesC* aListName, |
|
167 MPIMToDoAdapterManager** aRetAdapterManager, |
|
168 MPIMToDoListAdapter** aRetListAdapter, |
|
169 MPIMLocalizationData** aRetLocalizationData) = 0; |
|
170 |
|
171 protected: |
|
172 // Protected constructor |
|
173 |
|
174 // Default constructor is protected to enable derivation |
|
175 MPIMAdapterAccess() |
|
176 { |
|
177 } |
|
178 |
|
179 private: |
|
180 // Prohibited operations |
|
181 |
|
182 // Prohibit copy constructor.. |
|
183 MPIMAdapterAccess(const MPIMAdapterAccess&) |
|
184 { |
|
185 } |
|
186 |
|
187 // Prohibit assigment operator. |
|
188 MPIMAdapterAccess& operator=(const MPIMAdapterAccess&) |
|
189 { |
|
190 return *this; |
|
191 } |
|
192 |
|
193 }; |
|
194 |
|
195 #endif // MPIMADAPTERACCESS_H |
|
196 // End of File |