author | Simon Howkins <simonh@symbian.org> |
Mon, 22 Nov 2010 16:01:09 +0000 | |
branch | RCL_3 |
changeset 93 | d216ae5a8733 |
parent 66 | bd7edf625bdd |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Provides services for native Calendar extensions |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#ifndef CALENSERVICESIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#define CALENSERVICESIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <e32base.h> |
66 | 22 |
#include <calennotificationhandler.h> |
23 |
#include <calsession.h> |
|
24 |
#include <calenservices.h> |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
// Forward declarations |
66 | 27 |
class CCalenGlobalData; // Calendar-wide accessors |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
class CCalenController; // Calendar controller |
66 | 29 |
class CCalenIcons; |
30 |
class CGulIcon; |
|
31 |
class CCalenAttachmentModel; |
|
32 |
class CCalCalendarInfo; |
|
33 |
class MCalenPreview; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
/** |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
* Calendar Services External API implementation. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
*/ |
66 | 38 |
NONSHARABLE_CLASS( CCalenServicesImpl ) : public CBase, |
39 |
public MCalenServices |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
{ |
66 | 41 |
public: // Construction and destruction. |
42 |
/** |
|
43 |
* Two phased constructor. Use this in preference to the C++ |
|
44 |
* constructor where possible. |
|
45 |
* @param aCommandRangeStart start of the command range |
|
46 |
* @param aCommandRangeEnd end of command range |
|
47 |
*/ |
|
48 |
static CCalenServicesImpl* NewL( TInt aCommandRangeStart, |
|
49 |
TInt aCommandRangeEnd ); |
|
50 |
||
51 |
/** |
|
52 |
* Two phased constructor. Use this in preference to the C++ |
|
53 |
* constructor where possible. |
|
54 |
*/ |
|
55 |
static CCalenServicesImpl* NewL(); |
|
56 |
||
57 |
/** |
|
58 |
* Completes construction of this object. |
|
59 |
*/ |
|
60 |
void ConstructL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
66 | 62 |
/** |
63 |
* Performs cleanup of this object. |
|
64 |
*/ |
|
65 |
void Release(); |
|
66 |
||
67 |
public: // Functions from base classes. |
|
68 |
/** |
|
69 |
* Retrieve the calendar session currently in use by Calendar |
|
70 |
* @return CCalSession& currently used by Calendar |
|
71 |
*/ |
|
72 |
CCalSession& SessionL(); |
|
73 |
||
74 |
/** |
|
75 |
* Retrieve the calendar session currently in use by Calendar |
|
76 |
* @return CCalSession& currently used by Calendar |
|
77 |
*/ |
|
78 |
CCalSession& SessionL( const TDesC& aCalendar ); |
|
79 |
||
80 |
/** |
|
81 |
* Retrieve the calendar entry view currently in use by Calendar |
|
82 |
* @return CCalEntryView* currently used by Calendar |
|
83 |
*/ |
|
84 |
CCalEntryView* EntryViewL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
|
66 | 86 |
|
87 |
/** |
|
88 |
* Retrieve the calendar entry view currently in use by Calendar |
|
89 |
* @return CCalEntryView* currently used by Calendar |
|
90 |
*/ |
|
91 |
CCalEntryView* EntryViewL(const TCalCollectionId aCollectionId ); |
|
92 |
||
93 |
||
94 |
/** |
|
95 |
* Retrieve the calendar instance view currently in use by Calendar |
|
96 |
* @return CCalInstanceView* currently used by Calendar |
|
97 |
*/ |
|
98 |
CCalInstanceView* InstanceViewL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
|
66 | 100 |
/** |
101 |
* Retrieve the calendar instance view currently in use by Calendar |
|
102 |
* @return CCalInstanceView* currently used by Calendar |
|
103 |
*/ |
|
104 |
CCalInstanceView* InstanceViewL( |
|
105 |
const RArray<TInt>& aCollectionIds ); |
|
106 |
||
107 |
/** |
|
108 |
* Retrieve the InterimUtils |
|
109 |
* @return CCalenInterimUtils2& |
|
110 |
*/ |
|
111 |
CCalenInterimUtils2& InterimUtilsL(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
|
66 | 113 |
TBool QueueKeyEvent( const TKeyEvent& aEvent, TEventCode aType ); |
114 |
TBool GetQueuedKeyEvent( TKeyEvent& aEvent, TEventCode& aType ); |
|
115 |
void ResetKeyEventQueue(); |
|
116 |
/** |
|
117 |
* Get calendar icon of specific type |
|
118 |
* @return CGulIcon* |
|
119 |
*/ |
|
120 |
CGulIcon* GetIconL( MCalenServices::TCalenIcons aIndex, const TInt aViewId = 0 ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
|
66 | 122 |
/** |
123 |
* Register for notifications of Calendar events |
|
124 |
* @param aHandler the MCalenNotificationHandler to notify |
|
125 |
* @param aNotification single notification to be notified about |
|
126 |
*/ |
|
127 |
virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
|
128 |
TCalenNotification aNotification ); |
|
129 |
||
130 |
/** |
|
131 |
* Register for notifications of Calendar events |
|
132 |
* @param aHandler the MCalenNotificationHandler to notify |
|
133 |
* @param aNotifications array of notifications to be notified about |
|
134 |
*/ |
|
135 |
virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, |
|
136 |
RArray<TCalenNotification>& aNotifications ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
|
66 | 138 |
/** |
139 |
* Cancel notifications of Calendar events |
|
140 |
* @param aHandler the MCalenNotificationHandler to stop notifying |
|
141 |
*/ |
|
142 |
void CancelNotifications( MCalenNotificationHandler* aHandler ); |
|
143 |
||
144 |
/** |
|
145 |
* Issue a command to be handled by Calendar or a customization |
|
146 |
* All commands will be handled asynchronously. Calendar may reject |
|
147 |
* @param aCommand the command to be handled |
|
148 |
* @return ETrue, if Calendar will attempt to handle the command |
|
149 |
* @return EFalse, if Calendar will not attempt to handle the command |
|
150 |
*/ |
|
151 |
TBool IssueCommandL( TInt aCommand ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
|
66 | 153 |
/** |
154 |
* Issue a notification to Calendar, which will be broadcast |
|
155 |
* synchronously to all registered notification handlers. |
|
156 |
* Only one notification may be issued at once. |
|
157 |
* @param aNotification the notification to broadcast |
|
158 |
*/ |
|
159 |
void IssueNotificationL( TCalenNotification aNotification ); |
|
160 |
||
161 |
/** |
|
162 |
* Returns the context. This includes information such |
|
163 |
* as the currently focused date/instance. |
|
164 |
*/ |
|
165 |
MCalenContext& Context(); |
|
166 |
||
167 |
/** |
|
168 |
* Request activation of a specific view |
|
169 |
* @param aViewId The view to be activated |
|
170 |
*/ |
|
171 |
void RequestActivationL( const TVwsViewId& aViewId ); |
|
172 |
||
173 |
/** |
|
174 |
* Notify Calendar that a specific view has been activated. |
|
175 |
* Custom views must call this on activation |
|
176 |
* @param aViewId The view that was activated |
|
177 |
*/ |
|
178 |
void ActivationNotificationL( const TVwsViewId& aViewId ); |
|
179 |
||
180 |
/** |
|
181 |
* Offers the menu pane for population, interested parties can |
|
182 |
* add or remove menu items |
|
183 |
* @param aMenuPane meu pane to be populated |
|
184 |
* @param aResourceId resource id of menu pane |
|
185 |
*/ |
|
186 |
void OfferMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
187 |
||
188 |
/** |
|
189 |
* Gets the command range that has been allocated to this MCalenServices |
|
190 |
* instance |
|
191 |
* |
|
192 |
* @param aCommandRangeStart start of command range |
|
193 |
* @param aCommandRangeEnd end of command range |
|
194 |
*/ |
|
195 |
void GetCommandRange( TInt& aCommandRangeStart, |
|
196 |
TInt& aCommandRangeEnd ) const; |
|
197 |
||
198 |
/** |
|
199 |
* Offers a TRect to customisations for the creation of |
|
200 |
* a control to be displayed in the infobar |
|
201 |
* @return info bar control |
|
202 |
*/ |
|
203 |
CCoeControl* Infobar( const TRect& aRect ); |
|
204 |
||
205 |
/** |
|
206 |
* Customisation creates the text for display in infobar |
|
207 |
* @return infobar Text |
|
208 |
*/ |
|
209 |
const TDesC& Infobar( ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
|
66 | 211 |
MCalenPreview* CustomPreviewPaneL( TRect& aRect ); |
212 |
/** |
|
213 |
* Offers a TRect to available customisations for the creation of a |
|
214 |
* control to be displayed in the preview pane |
|
215 |
* @return preview pane control |
|
216 |
*/ |
|
217 |
CCoeControl* PreviewPane( TRect& aRect ); |
|
218 |
||
219 |
/** |
|
220 |
* Get a pointer to the Calendar toolbar, or NULL if none is available. |
|
221 |
* Ownership is not transferred. |
|
222 |
* @return Calendar toolbar if available |
|
223 |
*/ |
|
224 |
MCalenToolbar* ToolbarOrNull(); |
|
225 |
||
226 |
/** |
|
227 |
* Get Missed alarm store |
|
228 |
* @return reference to Missed alarm store |
|
229 |
*/ |
|
230 |
CMissedAlarmStore* MissedAlarmStore(); |
|
231 |
||
232 |
/** |
|
233 |
* Get missed alarms list |
|
234 |
* @return an array of missed alarms |
|
235 |
*/ |
|
236 |
void GetMissedAlarmsList(RArray<TCalenInstanceId>& aMissedAlarmList); |
|
237 |
||
238 |
/** |
|
239 |
* Get attachment model |
|
240 |
* @return CCalenAttachmentModel* pointer to CCalenAttachmentModel |
|
241 |
*/ |
|
242 |
CCalenAttachmentModel* GetAttachmentData(); |
|
243 |
||
244 |
/** |
|
245 |
* @brief Get all available calendar info |
|
246 |
* |
|
247 |
* @param returns the list of available calendar info iterating |
|
248 |
* through all calendars |
|
249 |
*/ |
|
250 |
void GetAllCalendarInfoL( |
|
251 |
RPointerArray<CCalCalendarInfo>& aCalendarInfoList ); |
|
252 |
||
253 |
/** |
|
254 |
* @brief get calendar file name for the collection id |
|
255 |
* |
|
256 |
* @param aCalendarFile reference to the calendar file name |
|
257 |
* @param aCollectionId collection id of the session for |
|
258 |
* which calendar file name is required |
|
259 |
*/ |
|
260 |
const TDesC& GetCalFileNameForCollectionId(const TCalCollectionId aCollectionId); |
|
261 |
||
262 |
private: |
|
263 |
/** |
|
264 |
* C++ constructor. |
|
265 |
*/ |
|
266 |
CCalenServicesImpl( TInt aCommandRangeStart, |
|
267 |
TInt aCommandRangeEnd ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
private: // Data |
66 | 270 |
CCalenGlobalData* iGlobalData; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
CCalenController* iController; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
|
66 | 273 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
TInt iCommandRangeStart; // start of the valid command range |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
TInt iCommandRangeEnd; // end of the valid command range |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
}; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
#endif // CALENSERVICESIMPL_H |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
// End of file |