|
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: Provides services for native Calendar extensions |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALENDUMMYSERVICES_H |
|
19 #define CALENDUMMYSERVICES_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <calennotificationhandler.h> |
|
23 #include <calenservices.h> |
|
24 #include <calsession.h> |
|
25 |
|
26 // Forward declarations |
|
27 class CCalenGlobalData; // Calendar-wide accessors |
|
28 class CGulIcon; |
|
29 class CMissedAlarmStore; |
|
30 class MCalenPreview; |
|
31 |
|
32 /** |
|
33 * Calendar Services External API implementation. |
|
34 * This is just a dummy with no implementation for general settings. |
|
35 */ |
|
36 NONSHARABLE_CLASS( CCalenDummyServices ) : public CBase, public MCalenServices |
|
37 { |
|
38 public: // Construction and destruction. |
|
39 /** |
|
40 * C++ constructor |
|
41 */ |
|
42 CCalenDummyServices( CCalenGlobalData& aGlobalData ); |
|
43 |
|
44 /** |
|
45 * Destructor |
|
46 */ |
|
47 ~CCalenDummyServices(); |
|
48 |
|
49 public: // Functions from base classes. |
|
50 /** |
|
51 * Cleans all resources assocaited with this object and frees its memory. |
|
52 */ |
|
53 virtual void Release(); |
|
54 |
|
55 /** |
|
56 * Retrieve the calendar session currently in use by Calendar |
|
57 * @return CCalSession& currently used by Calendar |
|
58 */ |
|
59 CCalSession& SessionL(); |
|
60 |
|
61 /** |
|
62 * Retrieve the calendar session currently in use by Calendar |
|
63 * @return CCalSession& currently used by Calendar |
|
64 */ |
|
65 CCalSession& SessionL( const TDesC& aCalendar ); |
|
66 |
|
67 /** |
|
68 * Retrieve the calendar entry view currently in use by Calendar |
|
69 * @return CCalEntryView* currently used by Calendar |
|
70 */ |
|
71 CCalEntryView* EntryViewL(); |
|
72 |
|
73 |
|
74 /** |
|
75 * Retrieve the calendar entry view currently in use by Calendar |
|
76 * @return CCalEntryView* currently used by Calendar |
|
77 */ |
|
78 CCalEntryView* EntryViewL(const TCalCollectionId aCollectionId ); |
|
79 |
|
80 |
|
81 /** |
|
82 * Retrieve the calendar instance view currently in use by Calendar |
|
83 * @return CCalInstanceView* currently used by Calendar |
|
84 */ |
|
85 CCalInstanceView* InstanceViewL(); |
|
86 |
|
87 /** |
|
88 * Retrieve the calendar instance view currently in use by Calendar |
|
89 * @return CCalInstanceView* currently used by Calendar |
|
90 */ |
|
91 CCalInstanceView* InstanceViewL( |
|
92 const RArray<TInt>& aCollectionIds ); |
|
93 |
|
94 /** |
|
95 * Retrieve the InterimUtils |
|
96 * @return CCalenInterimUtils2& |
|
97 */ |
|
98 CCalenInterimUtils2& InterimUtilsL(); |
|
99 |
|
100 TBool QueueKeyEvent(const TKeyEvent& aEvent, TEventCode aType); |
|
101 TBool GetQueuedKeyEvent(TKeyEvent& aEvent, TEventCode& aType); |
|
102 void ResetKeyEventQueue(); |
|
103 /** |
|
104 * Get calendar icon of specific type |
|
105 * @return CGulIcon* |
|
106 */ |
|
107 CGulIcon* GetIconL( MCalenServices::TCalenIcons aIndex ); |
|
108 |
|
109 /** |
|
110 * Register for notifications of Calendar events |
|
111 * @param aHandler the MCalenNotificationHandler to notify |
|
112 * @param aNotification single notification to be notified about |
|
113 */ |
|
114 virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
|
115 TCalenNotification aNotification ); |
|
116 |
|
117 /** |
|
118 * Register for notifications of Calendar events |
|
119 * @param aHandler the MCalenNotificationHandler to notify |
|
120 * @param aNotifications array of notifications to be notified about |
|
121 */ |
|
122 virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
|
123 RArray<TCalenNotification>& aNotifications ); |
|
124 |
|
125 |
|
126 /** |
|
127 * Cancel notifications of Calendar events |
|
128 * @param aHandler the MCalenNotificationHandler to stop notifying |
|
129 */ |
|
130 void CancelNotifications( MCalenNotificationHandler* aHandler ); |
|
131 |
|
132 /** |
|
133 * Issue a command to be handled by Calendar or a customization |
|
134 * All commands will be handled asynchronously. Calendar may reject |
|
135 * @param aCommand the command to be handled |
|
136 * @return ETrue, if Calendar will attempt to handle the command |
|
137 * @return EFalse, if Calendar will not attempt to handle the command |
|
138 */ |
|
139 TBool IssueCommandL( TInt aCommand ); |
|
140 |
|
141 /** |
|
142 * Issue a notification to Calendar, which will be broadcast |
|
143 * synchronously to all registered notification handlers. |
|
144 * Only one notification may be issued at once. |
|
145 * @param aNotification the notification to broadcast |
|
146 */ |
|
147 void IssueNotificationL( TCalenNotification aNotification ); |
|
148 |
|
149 /** |
|
150 * Returns the context. This includes information such |
|
151 * as the currently focused date/instance. |
|
152 */ |
|
153 MCalenContext& Context(); |
|
154 |
|
155 /** |
|
156 * Request activation of a specific view |
|
157 * @param aViewId The view to be activated |
|
158 */ |
|
159 void RequestActivationL( const TVwsViewId& aViewId ); |
|
160 |
|
161 /** |
|
162 * Notify Calendar that a specific view has been activated. |
|
163 * Custom views must call this on activation |
|
164 * @param aViewId The view that was activated |
|
165 */ |
|
166 void ActivationNotificationL( const TVwsViewId& aViewId ); |
|
167 |
|
168 /** |
|
169 * Offers the menu pane for population, interested parties can |
|
170 * add or remove menu items |
|
171 * @param aMenuPane meu pane to be populated |
|
172 * @param aResourceId resource id of menu pane |
|
173 */ |
|
174 void OfferMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
175 |
|
176 /** |
|
177 * Gets the command range that has been allocated to this MCalenServices |
|
178 * instance |
|
179 * |
|
180 * @param aCommandRangeStart start of command range |
|
181 * @param aCommandRangeEnd end of command range |
|
182 */ |
|
183 void GetCommandRange( TInt& aCommandRangeStart, TInt& aCommandRangeEnd ) const; |
|
184 |
|
185 /** |
|
186 * Offers a TRect to customisations for the creation of |
|
187 * a control to be displayed in the infobar |
|
188 * @return info bar control |
|
189 */ |
|
190 virtual CCoeControl* Infobar( const TRect& aRect ); |
|
191 |
|
192 /** |
|
193 * Offers a TRect to customisations for the creation of |
|
194 * a control to be displayed in the infobar |
|
195 * @return info bar control |
|
196 */ |
|
197 virtual const TDesC& Infobar( ); |
|
198 |
|
199 /* |
|
200 * Offers a TRect to available customisations for the creation of a |
|
201 * control to be displayed in the preview pane |
|
202 * @param aRect rect area of preview pane display |
|
203 * @return MCalenPreview* pointer to MCalenPreview |
|
204 * |
|
205 */ |
|
206 MCalenPreview* CustomPreviewPaneL( TRect& aRect ); |
|
207 |
|
208 /** |
|
209 * Offers a TRect to available customisations for the creation of a |
|
210 * control to be displayed in the preview pane |
|
211 * @return preview pane control |
|
212 */ |
|
213 virtual CCoeControl* PreviewPane( TRect& aRect ); |
|
214 |
|
215 /** |
|
216 * Get a pointer to the Calendar toolbar, or NULL if none is available. |
|
217 * Ownership is not transferred. |
|
218 * @return Calendar toolbar if available |
|
219 */ |
|
220 virtual MCalenToolbar* ToolbarOrNull(); |
|
221 |
|
222 /** |
|
223 * Get Missed alarm store |
|
224 * @return reference to Missed alarm store |
|
225 */ |
|
226 virtual CMissedAlarmStore* MissedAlarmStore(); |
|
227 |
|
228 /** |
|
229 * Get Missed alarms list |
|
230 */ |
|
231 virtual void GetMissedAlarmsList(RArray<TCalenInstanceId>& aMissedAlarmList); |
|
232 |
|
233 /** |
|
234 * Get attachment model |
|
235 * @return CCalenAttachmentModel* |
|
236 */ |
|
237 CCalenAttachmentModel* GetAttachmentData(); |
|
238 |
|
239 |
|
240 /** |
|
241 * @brief Get all available calendar info |
|
242 * |
|
243 * @param returns the list of available calendar info iterating |
|
244 * through all calendars |
|
245 */ |
|
246 void GetAllCalendarInfoL( RPointerArray<CCalCalendarInfo>& aCalendarInfoList ); |
|
247 |
|
248 /** |
|
249 * @brief Gets calendar filename from collection id |
|
250 * |
|
251 * @param aColId Collection id for which db id has to be returned |
|
252 * @param aCalendarFileName calendar file name |
|
253 */ |
|
254 const TDesC& GetCalFileNameForCollectionId(const TCalCollectionId aCollectionId); |
|
255 |
|
256 private: |
|
257 CCalenGlobalData& iGlobalData; |
|
258 |
|
259 MCalenNotificationHandler* iHandler; |
|
260 }; |
|
261 |
|
262 #endif // CALENDUMMYSERVICES_H |
|
263 |
|
264 // End of file |