66
|
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: Calendar context, info on what's currently focused
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CALENCONTEXT_H
|
|
19 |
#define CALENCONTEXT_H
|
|
20 |
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <e32cmn.h>
|
|
25 |
#include <calcommon.h>
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
class TVwsViewId;
|
|
29 |
class TCalTime;
|
|
30 |
class TCalenInstanceId;
|
|
31 |
class TTimeIntervalMinutes;
|
|
32 |
class CPosLandmark;
|
|
33 |
class CCalGeoValue;
|
|
34 |
|
|
35 |
// Class declaration
|
|
36 |
/**
|
|
37 |
* @class MCalenContext
|
|
38 |
* @brief Holds the current calendar context.
|
|
39 |
* Clients need to implement this to hold the context
|
|
40 |
*/
|
|
41 |
class MCalenContext
|
|
42 |
{
|
|
43 |
public: // New functions
|
|
44 |
|
|
45 |
/**
|
|
46 |
* @brief Returns the default time for views. (Normally 8am.) This would be
|
|
47 |
* used for example by the month view, which sets the focus time to
|
|
48 |
* 8am on a day. Then when opening the week view, the same time is shown.
|
|
49 |
* @return TTimeIntervalMinutes The default time in minutes
|
|
50 |
*/
|
|
51 |
virtual TTimeIntervalMinutes DefaultTimeForViews() const = 0;
|
|
52 |
|
|
53 |
/**
|
|
54 |
* @brief Returns the default TCalTime for views. (Normally 8am today.) This
|
|
55 |
* would be used for example when a view is the first view loaded in
|
|
56 |
* Calendar.
|
|
57 |
* @return TCalTime The default TCalTime for views
|
|
58 |
*/
|
|
59 |
virtual TCalTime DefaultCalTimeForViewsL() const = 0;
|
|
60 |
|
|
61 |
/**
|
|
62 |
* @brief Sets the date and time currently focused
|
|
63 |
*
|
|
64 |
* @param aFocusDateTime The new focus date and time.
|
|
65 |
* @param aViewId The view id of the currently active view
|
|
66 |
*/
|
|
67 |
virtual void SetFocusDateAndTimeL( const TCalTime& aFocusDateTime,
|
|
68 |
const TVwsViewId& aViewId ) = 0;
|
|
69 |
|
|
70 |
/**
|
|
71 |
* @brief Sets the date currently focused. When retrieving the focus
|
|
72 |
* date and time after calling this function, the time component
|
|
73 |
* will be set to the default of view. When retrieving the focus
|
|
74 |
* time only, it will be set to -1
|
|
75 |
*
|
|
76 |
* @param aFocusDate The new focus date and time.
|
|
77 |
* @param aViewId The view id of the currently active view.
|
|
78 |
*/
|
|
79 |
virtual void SetFocusDateL( const TCalTime& aFocusDate,
|
|
80 |
const TVwsViewId& aViewId ) = 0;
|
|
81 |
|
|
82 |
/**
|
|
83 |
* @brief Sets the id of the instance currently focused
|
|
84 |
*
|
|
85 |
* @param aInstanceId the id of the focused instance.
|
|
86 |
* @param aViewId The view id of the currently active view
|
|
87 |
*/
|
|
88 |
virtual void SetInstanceIdL( const TCalenInstanceId& aInstanceId,
|
|
89 |
const TVwsViewId& aViewId ) = 0;
|
|
90 |
|
|
91 |
/**
|
|
92 |
* @brief Sets the time and instance currently focused.
|
|
93 |
*
|
|
94 |
* @param aFocusDateTime The new focus time. If no time is focused, set
|
|
95 |
* the Utc time of this object to be Time::NullTTime
|
|
96 |
* @param aInstanceId The id of the focused instance
|
|
97 |
* @param aViewId The view id of the currently active view.
|
|
98 |
*/
|
|
99 |
virtual void SetFocusDateAndTimeAndInstanceL( const TCalTime& aFocusDateTime,
|
|
100 |
const TCalenInstanceId& aInstanceId,
|
|
101 |
const TVwsViewId& aViewId ) = 0;
|
|
102 |
|
|
103 |
/**
|
|
104 |
* @brief Gets the date and time currently focused.
|
|
105 |
*
|
|
106 |
* @return TCalTime The currently focused date and time. When no time is
|
|
107 |
* focused, the default time on the current date will be returned
|
|
108 |
*/
|
|
109 |
virtual TCalTime FocusDateAndTimeL() const = 0;
|
|
110 |
|
|
111 |
/**
|
|
112 |
* @brief Gets the time currently focused.
|
|
113 |
*
|
|
114 |
* @return TTimeIntervalMinutes The currently focused time in minutes. When no time is
|
|
115 |
* focused, -1 will be returned
|
|
116 |
*/
|
|
117 |
virtual TTimeIntervalMinutes FocusTime() const = 0;
|
|
118 |
|
|
119 |
/**
|
|
120 |
* @brief Gets the id of the instance currently focused
|
|
121 |
*
|
|
122 |
* @return TCalenInstanceId The instance id currently focused. When no instance is focused,
|
|
123 |
* this will be TCalenInstanceId::NullInstanceIdL()
|
|
124 |
*/
|
|
125 |
virtual TCalenInstanceId InstanceId() const = 0;
|
|
126 |
|
|
127 |
/**
|
|
128 |
* @brief Gets the id of the currently active view
|
|
129 |
*
|
|
130 |
* @return TVwsViewId The view id of the currently active view
|
|
131 |
*/
|
|
132 |
virtual TVwsViewId ViewId() const = 0;
|
|
133 |
|
|
134 |
|
|
135 |
public: // For Mutliple Context Support
|
|
136 |
|
|
137 |
/**
|
|
138 |
* @brief Sets multiple context ids
|
|
139 |
*
|
|
140 |
* @param aMutlipleContextIds The array of TCalenInstanceId
|
|
141 |
*/
|
|
142 |
virtual void SetMutlipleContextIds( RArray<TCalenInstanceId>& aMutlipleContextIds ) = 0;
|
|
143 |
|
|
144 |
/**
|
|
145 |
* @brief Removes the multiple context id specified by aInstanceId
|
|
146 |
*
|
|
147 |
* @param aInstanceId Instance Id for which context needs to be removed
|
|
148 |
*/
|
|
149 |
virtual void RemoveMultipleContextId( TCalenInstanceId aInstanceId ) = 0;
|
|
150 |
|
|
151 |
/**
|
|
152 |
* @brief Resets all the multiple context ids
|
|
153 |
*
|
|
154 |
* @param aDbId The database Id
|
|
155 |
*/
|
|
156 |
virtual void ResetMultipleContextIds( TInt aDbId = 0 ) = 0;
|
|
157 |
|
|
158 |
/**
|
|
159 |
* @brief Gets for multiple context ids
|
|
160 |
*
|
|
161 |
* @return RArray<TCalenInstanceId> Multiple context Ids
|
|
162 |
*/
|
|
163 |
virtual RArray<TCalenInstanceId>& GetMutlipleContextIds( TInt aDbId = 0 ) = 0;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* @brief Returns the number of context
|
|
167 |
*
|
|
168 |
* @return TInt Multiple context count
|
|
169 |
*/
|
|
170 |
virtual TInt MutlipleContextIdsCount() = 0;
|
|
171 |
|
|
172 |
/**
|
|
173 |
* @brief Sets the user selected landmark to aLandMark
|
|
174 |
*
|
|
175 |
* @param aLandMark Landmark object of type CPosLandMark
|
|
176 |
*/
|
|
177 |
virtual void SetLandMark( CPosLandmark* aLandMark ) = 0;
|
|
178 |
|
|
179 |
/**
|
|
180 |
* @brief Returns the user selected landmark
|
|
181 |
*
|
|
182 |
* @return CPosLandMark Landmark object
|
|
183 |
*/
|
|
184 |
virtual CPosLandmark* GetLandMark() = 0;
|
|
185 |
|
|
186 |
/**
|
|
187 |
* @brief Resets the landmark.
|
|
188 |
* Once landmark is set reset the landmark coordinates
|
|
189 |
*/
|
|
190 |
virtual void ResetLandMark() = 0;
|
|
191 |
|
|
192 |
/**
|
|
193 |
* @brief Allows extending this API without breaking BC.
|
|
194 |
*
|
|
195 |
* @param aExtensionUid Specifies UID of the extenstion
|
|
196 |
* @return TAny Extension of the requested type
|
|
197 |
*/
|
|
198 |
virtual TAny* CalenContextExtensionL( TUid aExtensionUid ) = 0;
|
|
199 |
|
|
200 |
/**
|
|
201 |
* @brief Get calendar filename
|
|
202 |
*
|
|
203 |
* @return TDesC& reference to calendar file name
|
|
204 |
*/
|
|
205 |
virtual TDesC& GetCalendarFileNameL() const = 0;
|
|
206 |
|
|
207 |
/**
|
|
208 |
* @brief Set calendar filename
|
|
209 |
*
|
|
210 |
* @param aName referance to calendar file name
|
|
211 |
*/
|
|
212 |
virtual void SetCalendarFileNameL(const TDesC& aName) = 0;
|
|
213 |
|
|
214 |
/**
|
|
215 |
* @brief Resets calendar file name in context
|
|
216 |
*/
|
|
217 |
virtual void ResetCalendarFileName() = 0;
|
|
218 |
/**
|
|
219 |
* @brief Set calendar file name of Alarm entry in context
|
|
220 |
*/
|
|
221 |
virtual void SetCalAlarmEntryFileNameL(const TDesC& aName) = 0;
|
|
222 |
|
|
223 |
/**
|
|
224 |
* @brief Get calendar filename
|
|
225 |
*
|
|
226 |
* @return HBufC pointer to calendar filename of Alarm entry
|
|
227 |
*/
|
|
228 |
virtual HBufC* GetCalAlarmEntryFileNameL() const = 0;
|
|
229 |
|
|
230 |
/**
|
|
231 |
* @brief Resets Alarm Entry calendar file name in context
|
|
232 |
*/
|
|
233 |
virtual void ResetCalAlarmEntryFileName() = 0;
|
|
234 |
|
|
235 |
/**
|
|
236 |
* @brief set Alarm Entry LocalUid in context
|
|
237 |
*/
|
|
238 |
virtual void SetCalAlarmEntryLocalUid(TCalLocalUid aLocalId) = 0;
|
|
239 |
|
|
240 |
/**
|
|
241 |
* @brief Get Alarm Entry LocalUid from context
|
|
242 |
*/
|
|
243 |
virtual TCalLocalUid CalAlarmLocalUidL() const = 0;
|
|
244 |
};
|
|
245 |
|
|
246 |
#endif // CALENCONTEXT_H
|
|
247 |
|
|
248 |
// End of file
|