|
1 /* |
|
2 * Copyright (c) 2006 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 the License "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: This class contains data for scheduled programs.* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef __CCSESCHEDULEDPROGRAM_H__ |
|
19 #define __CCSESCHEDULEDPROGRAM_H__ |
|
20 |
|
21 #include <e32def.h> |
|
22 #include <e32base.h> |
|
23 #include <s32strm.h> |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KCseNameMaxLength = 255; // Based on SymbianDB column max length |
|
27 |
|
28 /** |
|
29 * Scheduled program data. |
|
30 */ |
|
31 class CCseScheduledProgram : public CBase |
|
32 { |
|
33 public: // Constructors and destructors |
|
34 /** |
|
35 * Two-phased constructor. |
|
36 */ |
|
37 IMPORT_C static CCseScheduledProgram* NewL(); |
|
38 |
|
39 /** |
|
40 * Two-phased copy constructor. |
|
41 */ |
|
42 IMPORT_C static CCseScheduledProgram* NewL( CCseScheduledProgram& aProg ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 * @return None. |
|
47 */ |
|
48 IMPORT_C virtual ~CCseScheduledProgram(); |
|
49 |
|
50 |
|
51 // Enums |
|
52 // Schedule type |
|
53 enum TCseScheduleType |
|
54 { |
|
55 ECseReminder = 0, |
|
56 ECseRecording, |
|
57 ECseProgramGuideUpdate, |
|
58 ECseScheduleDownload, |
|
59 ECseOther |
|
60 }; |
|
61 |
|
62 // Plugin type: |
|
63 enum TCsePluginType |
|
64 { |
|
65 // Only one of this kind of plugin can be running at same time |
|
66 ECseUniPlugin = 1, |
|
67 // Several of this kind of plugin can be running same time |
|
68 ECseMultiPlugin |
|
69 }; |
|
70 public: // New methods |
|
71 /** |
|
72 * Externalizes class content to stream. |
|
73 * @param aStream Writestream where to write content |
|
74 * @return None. |
|
75 */ |
|
76 IMPORT_C void ExternalizeL( RWriteStream& aStream ); |
|
77 |
|
78 /** |
|
79 * Internalizes class content from stream. |
|
80 * @param aStream Readstream from where to read content |
|
81 * @return None. |
|
82 */ |
|
83 IMPORT_C void InternalizeL( RReadStream& aStream ); |
|
84 |
|
85 /** |
|
86 * Calculates externalization length. |
|
87 * @return Length of the stream needed when class is externalized. |
|
88 */ |
|
89 IMPORT_C TInt ExternalizeLength(); |
|
90 |
|
91 public: // Setters |
|
92 |
|
93 /** |
|
94 * Sets new plugin type for schedule. |
|
95 * EUniPlugin for plugins that can have only one running at a given time. |
|
96 * EMultiPlugin for plugins that can have several running at a given time |
|
97 * @param aPluginType New plugin type |
|
98 */ |
|
99 IMPORT_C void SetPluginType( TInt32 aPluginType ); |
|
100 |
|
101 /** |
|
102 * Sets new schedule name. |
|
103 * @param aName New name of the schedule |
|
104 */ |
|
105 IMPORT_C void SetName( const TDesC8& aName ); |
|
106 |
|
107 /** |
|
108 * Sets new schedule start time. |
|
109 * @param aStartTime New start time of the schedule |
|
110 */ |
|
111 IMPORT_C void SetStartTime( const TTime& aStartTime ); |
|
112 |
|
113 /** |
|
114 * Sets new schedule end time. |
|
115 * @param aEndTime New end time of the schedule |
|
116 */ |
|
117 IMPORT_C void SetEndTime( const TTime& aEndTime ); |
|
118 |
|
119 /** |
|
120 * Sets new application uid for schedule. |
|
121 * @param aAppUid New application uid of the schedule |
|
122 */ |
|
123 IMPORT_C void SetAppUid( const TInt32 aAppUid ); |
|
124 |
|
125 /** |
|
126 * Sets new plugin uid for schedule |
|
127 * @param aPluginUid New plugin uid of the schedule |
|
128 */ |
|
129 IMPORT_C void SetPluginUid( const TInt32 aPluginUid ); |
|
130 |
|
131 /** |
|
132 * Sets new application data for schedule |
|
133 * @param aAppData New application data of the schedule |
|
134 */ |
|
135 IMPORT_C void SetApplicationDataL( const TDesC8& aAppData ); |
|
136 |
|
137 /** |
|
138 * Sets new database identifier for the schedule. Note that this should only |
|
139 * be set by Common Scheduling Engine, not the application using it. |
|
140 * @param aDbIdentifier New database identifier of the schedule |
|
141 */ |
|
142 IMPORT_C void SetDbIdentifier( const TUint32 aDbIdentifier ); |
|
143 |
|
144 /** |
|
145 * Sets new schedule for the schedule. |
|
146 * @param aScheduleType New schedule type of the schedule |
|
147 */ |
|
148 IMPORT_C void SetScheduleType( const TInt32 aScheduleType ); |
|
149 |
|
150 // Getters |
|
151 /** |
|
152 * Get the type of scheduler plugin |
|
153 * EUniPlugin for plugins that can have only one running at a given time. |
|
154 * EMultiPlugin for plugins that can have several running at a given time |
|
155 * @return Schedule plugin type. |
|
156 */ |
|
157 IMPORT_C TInt32 PluginType() const; |
|
158 |
|
159 /** |
|
160 * Get the name of the schedule. |
|
161 * @return Schedule name. |
|
162 */ |
|
163 IMPORT_C TPtrC8 Name() const; |
|
164 |
|
165 /** |
|
166 * Gets the start time of the schedule. |
|
167 * @return Start time. |
|
168 */ |
|
169 IMPORT_C TTime& StartTime(); |
|
170 |
|
171 /** |
|
172 * Gets the end time of the schedule. |
|
173 * @return End time. |
|
174 */ |
|
175 IMPORT_C TTime& EndTime(); |
|
176 |
|
177 /** |
|
178 * Gets the application uid of the schedule |
|
179 * @return Application uid. |
|
180 */ |
|
181 IMPORT_C TInt32 AppUid() const; |
|
182 |
|
183 /** |
|
184 * Gets the plugin uid of the schedule. |
|
185 * @return Plugin uid. |
|
186 */ |
|
187 IMPORT_C TInt32 PluginUid() const; |
|
188 |
|
189 /** |
|
190 * Gets the application data of the schedule. |
|
191 * @return Application data. |
|
192 */ |
|
193 IMPORT_C TPtrC8 ApplicationData(); |
|
194 |
|
195 /** |
|
196 * Gets the database identifier of the schedule. |
|
197 * @return Database identifier |
|
198 */ |
|
199 IMPORT_C TUint32 DbIdentifier() const; |
|
200 |
|
201 /** |
|
202 * Gets the schedule type of the schedule. |
|
203 * @return Schedule type |
|
204 */ |
|
205 IMPORT_C TInt32 ScheduleType() const; |
|
206 |
|
207 /** |
|
208 * Dumps content of schedule to debug trace |
|
209 * @return None |
|
210 */ |
|
211 IMPORT_C void DebugDump() const; |
|
212 |
|
213 protected: // Constructors |
|
214 /** |
|
215 * Default constructor |
|
216 */ |
|
217 EXPORT_C CCseScheduledProgram(); |
|
218 |
|
219 /** |
|
220 * Symbian 2nd phase constructor can leave. |
|
221 */ |
|
222 void ConstructL(); |
|
223 |
|
224 protected: // Data |
|
225 /** |
|
226 * Name |
|
227 * Name of the scheduled program, e.g. name of the TV program. |
|
228 */ |
|
229 TBuf8<KCseNameMaxLength> iName; |
|
230 |
|
231 /** |
|
232 * Start time |
|
233 * Start time when the scheduled program is run (passed to plugin which is defined here). |
|
234 */ |
|
235 TTime iStartTime; |
|
236 |
|
237 /** |
|
238 * End time |
|
239 * End time for schedules that take longer time to complete, for example recording of the TV program. |
|
240 * If schedule is "instant" (e.g. just notification to user) start time and end time should be the same. |
|
241 */ |
|
242 TTime iEndTime; |
|
243 |
|
244 /** |
|
245 * Application UID |
|
246 * This is the application uid of the program that has added this schedule. Can be used to retrieve |
|
247 * all schedules of certain application. |
|
248 */ |
|
249 TInt32 iAppUid; |
|
250 |
|
251 /** |
|
252 * Plugin UID |
|
253 * UID of the plugin where this scheduled program is passed when the time is right. |
|
254 */ |
|
255 TInt32 iPluginUid; |
|
256 |
|
257 /** |
|
258 * Application Data |
|
259 * Application specific data for the plugin. Common scheduling Engine has no knowledge what |
|
260 * this data contains. |
|
261 */ |
|
262 HBufC8* iAppData; |
|
263 |
|
264 /** |
|
265 * DB identifier |
|
266 * Used to separate schedules from each other in database. Should be only added by Common |
|
267 * scheduling engine, not by application using it. |
|
268 */ |
|
269 TUint32 iDbIdentifier; |
|
270 |
|
271 /** |
|
272 * Schedule type |
|
273 * Type of this schedule, e.g. reminder, recording... |
|
274 */ |
|
275 TInt32 iScheduleType; |
|
276 |
|
277 /** |
|
278 * Schedule plugin type |
|
279 * Type of the plugin where this schedule will be run |
|
280 */ |
|
281 TInt32 iPluginType; |
|
282 }; |
|
283 |
|
284 #endif //__CCSESCHEDULEDPROGRAM_H__ |
|
285 |
|
286 // End of file |