|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <calentryview.h> |
|
17 |
|
18 #include "calentryviewimpl.h" |
|
19 |
|
20 CCalEntryView::CCalEntryView() |
|
21 { |
|
22 } |
|
23 |
|
24 /** The destructor frees all resources owned by the entry view, prior to its destruction. |
|
25 @publishedAll |
|
26 @released |
|
27 @capability None |
|
28 */ |
|
29 EXPORT_C CCalEntryView::~CCalEntryView() |
|
30 { |
|
31 delete iImpl; |
|
32 } |
|
33 |
|
34 void CCalEntryView::ConstructL(CCalSession& aCalSession, MCalProgressCallBack* aProgressCallBack) |
|
35 { |
|
36 iImpl = CCalEntryViewImpl::NewL(aCalSession,aProgressCallBack); |
|
37 } |
|
38 |
|
39 /** Allocates and constructs an entry view, with a reference to a state callback object. |
|
40 @param aSession The handle to the calendar session. |
|
41 @param aProgressCallBack Provides a callback function which notifies the user when the index has been built. |
|
42 @return A pointer to the new entry view object. |
|
43 @publishedAll |
|
44 @released |
|
45 @capability None |
|
46 */ |
|
47 EXPORT_C CCalEntryView* CCalEntryView::NewL(CCalSession& aSession, MCalProgressCallBack& aProgressCallBack) |
|
48 { |
|
49 CCalEntryView* self = new (ELeave) CCalEntryView(); |
|
50 CleanupStack::PushL(self); |
|
51 self->ConstructL(aSession,&aProgressCallBack); |
|
52 CleanupStack::Pop(self); |
|
53 return self; |
|
54 } |
|
55 |
|
56 /* Allocates and constructs an entry view. |
|
57 @param aSession The handle to the calendar session. |
|
58 @return A pointer to the new entry view object. |
|
59 @publishedAll |
|
60 @released |
|
61 @capability None |
|
62 */ |
|
63 EXPORT_C CCalEntryView* CCalEntryView::NewL(CCalSession& aSession) |
|
64 { |
|
65 CCalEntryView* self = new (ELeave) CCalEntryView(); |
|
66 CleanupStack::PushL(self); |
|
67 self->ConstructL(aSession, NULL); |
|
68 CleanupStack::Pop(self); |
|
69 return self; |
|
70 } |
|
71 |
|
72 /** Fetches all CCalEntry objects related to the Uid. |
|
73 The first entry in the array will always be the parent entry. |
|
74 see CCalEntry for definition of parent entry. |
|
75 @param aUid The Uid of the entries to fetch. |
|
76 @param aCalEntryArray On return, this contains an array of related CCalEntry objects. |
|
77 @see CCalEntry |
|
78 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
79 @publishedAll |
|
80 @released |
|
81 @capability ReadUserData |
|
82 */ |
|
83 EXPORT_C void CCalEntryView::FetchL(const TDesC8& aUid, RPointerArray<CCalEntry>& aCalEntryArray) const |
|
84 { |
|
85 iImpl->FetchL(aUid, aCalEntryArray); |
|
86 } |
|
87 |
|
88 /** Fetches a CCalEntry object related to the cal unique id. |
|
89 @param aCalLocalId The cal id of the entry to fetch. |
|
90 @return The entry that has been fetched, this will be NULL if there are no entries with the cal unique id |
|
91 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
92 @publishedAll |
|
93 @released |
|
94 @capability ReadUserData |
|
95 */ |
|
96 EXPORT_C CCalEntry* CCalEntryView::FetchL(TCalLocalUid aCalLocalId) const |
|
97 { |
|
98 return iImpl->FetchL(aCalLocalId); |
|
99 } |
|
100 |
|
101 /** Gets all the modified calendar local ids in the file since a specified date |
|
102 @param aTime The time to get the ids since. |
|
103 @param aIds On return will contain all the calendar local ids. |
|
104 @publishedAll |
|
105 @released |
|
106 @capability ReadUserData |
|
107 */ |
|
108 EXPORT_C void CCalEntryView::GetIdsModifiedSinceDateL(const TCalTime& aTime, RArray<TCalLocalUid>& aIds) const |
|
109 { |
|
110 iImpl->GetIdsModifiedSinceDateL(aTime, aIds); |
|
111 } |
|
112 |
|
113 /** Stores entries in the calendar file. |
|
114 @param aCalEntryList The list of entries to be stored. |
|
115 @param aNumSuccessfulEntry On return, this contains the number of entries which were successfully stored. |
|
116 @leave KErrAccessDenied if one of these entries contains a file attachment with a file handle that does not |
|
117 have the EFileWrite mode. |
|
118 @leave KErrBadHandle if one of these entries contains a file attachment with a file handle that does not belong |
|
119 to a shared protected file server session. |
|
120 @leave KErrArgument if one of these entries contains a file attachment which has a content ID but no binary data or file handle. |
|
121 @leave KErrArgument if one of these entries has an invalid repeat rule. Possible causes are: |
|
122 - the start time is later or equal to the until time; |
|
123 - the interval is less than 1; |
|
124 - the repeat rule has no data to indicate when it should repeat, e.g. a weekly repeat with no weekdays set. |
|
125 @leave KErrArgument if one of these entries is a modifying entry with a different time mode (fixed / floating) to the original entry. |
|
126 @leave KErrArgument if one of these entries is a modifying entry with a different type (e.g. appt / todo) to the original entry. |
|
127 @leave KErrArgument if one of these entries is a modifying entry but the original entry is not in the calendar store. |
|
128 @leave KErrArgument if one of these entries is a repeating modifying entry with a recurrence range of CalCommon::EThisOnly. |
|
129 @leave KErrNotFound if one of these entries is a modifying entry with a non-existent recurrence ID. |
|
130 @leave KErrNotSupported if one of these entries is a repeating modifying entry, but the original entry already has a repeating modifying entry. |
|
131 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
132 @leave KErrNotReady If an attachment file belonging to an entry is on a drive where the media has been removed. |
|
133 Otherwise any of the system-wide error codes. |
|
134 @publishedAll |
|
135 @released |
|
136 @capability WriteUserData |
|
137 */ |
|
138 EXPORT_C void CCalEntryView::StoreL(const RPointerArray<CCalEntry>& aCalEntryList, TInt& aNumSuccessfulEntry) |
|
139 { |
|
140 iImpl->StoreL(aCalEntryList, aNumSuccessfulEntry); |
|
141 } |
|
142 |
|
143 /** Updates entries in the calendar file. |
|
144 @param aCalEntryList The list of entries to be updated. |
|
145 @param aNumSuccessfulEntry On return, this contains the number of entries which were successfully updated. |
|
146 @publishedAll |
|
147 @released |
|
148 @capability WriteUserData |
|
149 @leave KErrArgument If aCalEntryList contains a CCalEntry that is not the parent. see CCalEntry for definition of a parent entry. |
|
150 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
151 @leave KErrNotReady If an attachment file belonging to an entry is on a drive where the media has been removed. |
|
152 @see CCalEntry |
|
153 */ |
|
154 EXPORT_C void CCalEntryView::UpdateL(const RPointerArray<CCalEntry>& aCalEntryList, TInt& aNumSuccessfulEntry) |
|
155 { |
|
156 iImpl->UpdateL(aCalEntryList, aNumSuccessfulEntry); |
|
157 } |
|
158 |
|
159 /** Deletes an entry from the calender file. |
|
160 If this a parent entry all it's children will also be deleted. |
|
161 see CCalEntry for definition of parent entry. |
|
162 @param aCalEntry The entry to delete. |
|
163 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
164 @publishedAll |
|
165 @released |
|
166 @capability WriteUserData |
|
167 */ |
|
168 EXPORT_C void CCalEntryView::DeleteL(const CCalEntry& aCalEntry) |
|
169 { |
|
170 iImpl->DeleteL(aCalEntry); |
|
171 } |
|
172 |
|
173 /** Deletes multiple entries from the calendar file. |
|
174 If this function leaves, then no entries have been deleted. |
|
175 @param aUidList A list of UIDs to delete. |
|
176 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
177 @publishedAll |
|
178 @released |
|
179 @capability WriteUserData |
|
180 */ |
|
181 EXPORT_C void CCalEntryView::DeleteL(const CDesC8Array& aUidList) |
|
182 { |
|
183 iImpl->DeleteL(aUidList); |
|
184 } |
|
185 |
|
186 /** Deletes a subset of the model's entries. |
|
187 The entries affected are those which occur within the time range specified by aCalTimeRange. |
|
188 |
|
189 This method will lock the calendar file. Any request made, by any client, before this has completed will leave with KErrLocked. |
|
190 |
|
191 @param aCalTimeRange The Time Range for the operation. |
|
192 @param aFilter Identifies which entry types should be included in the operation. |
|
193 @param aProgressCallBack Reference to a callback object which reports the progress of the operation. |
|
194 @publishedAll |
|
195 @released |
|
196 */ |
|
197 EXPORT_C void CCalEntryView::DeleteL(const CalCommon::TCalTimeRange& aCalTimeRange, CalCommon::TCalViewFilter aFilter, MCalProgressCallBack& aProgressCallBack) |
|
198 { |
|
199 iImpl->DeleteL(aCalTimeRange,aFilter,aProgressCallBack); |
|
200 } |
|
201 |
|
202 /** Deletes multiple entries from the calendar file. |
|
203 @param aCalLocalIds A list of calendar local ids to delete. |
|
204 @param aNumSuccessfulDeleted The number of local ids that have been successfully processed. |
|
205 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
206 @publishedAll |
|
207 @released |
|
208 @capability WriteUserData |
|
209 */ |
|
210 EXPORT_C void CCalEntryView::DeleteL(const RArray<TCalLocalUid>& aIds, TInt& aNumSuccessfulDeleted) |
|
211 { |
|
212 iImpl->DeleteL(aIds, aNumSuccessfulDeleted); |
|
213 } |