Update contrib.
1 // Copyright (c) 2004-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Representation of a task:
15 // Includes both user-defined data (iInfo+iData) and data set by system
16 // construction from stream & accessors are exported for task executors
20 #if !defined(__SCHTASK_H__)
23 #if !defined(__SCHINFO_H__)
33 When SYMBIAN_SECURE_TASK_SCHEDULER is defined, platform security
34 support functionality is included in Task Scheduler.
38 (i) Scheduled executables will be passed a shared file handle to
39 the scheduled task file by the Task Scheduler.
41 (ii) The CScheduledTask::SecurityInfo() API is availble to
42 retrieve security information about the schedule creator.
46 //Only to be used internally and by Phone Manufacturers
47 #ifndef SYMBIAN_SECURE_TASK_SCHEDULER
48 #define SYMBIAN_SECURE_TASK_SCHEDULER
52 Class used by registered programs to access the scheduled task file store.
54 When tasks are due, the Task Scheduler encapsulates task information within
55 CScheduledTask objects, and externalises them to a direct file store.
57 This file store is located in the task scheduler's private data cage and thus
58 cannot be accessed directly. Instead the task scheduler passes a shared RFs and
59 RFile handle to the registered program.
61 The registered program can use the RFile::AdoptFromCreator API in conjunction
62 with the APIs provided by this class to access the scheduled task file store as
63 shown in the following example:
67 TInt error = file.AdoptFromCreator(TScheduledTaskFile::FsHandleIndex(),
68 TScheduledTaskFile::FileHandleIndex());
71 @see RFile::AdoptFromCreator
75 class TScheduledTaskFile
78 IMPORT_C static TInt FsHandleIndex();
79 IMPORT_C static TInt FileHandleIndex();
83 The representation of a scheduled task that is passed to registered programs.
85 When tasks are due, the Task Scheduler encapsulates task information within
86 CScheduledTask objects, and externalises them to a direct file store.
88 The root stream of the direct file store contains a 32 bit value, followed
89 by the external representations of one or more CScheduledTask objects. The
90 32 bit value is interpreted as a TInt32 and contains the number of CScheduledTask
91 objects that follow in the stream.
93 The registered program can create successive CScheduledTask objects from this
94 stream using the static NewLC() function.
96 @see TScheduledTaskFile
101 class CScheduledTask : public CBase
104 IMPORT_C static CScheduledTask* NewLC(RReadStream& aStream);
106 IMPORT_C const TTaskInfo& Info() const;
107 IMPORT_C const HBufC& Data() const;
108 IMPORT_C const TTsTime& ValidUntil() const;
109 IMPORT_C TScheduleType ScheduleType() const;
110 IMPORT_C const TSecurityInfo& SecurityInfo() const;
112 // These methods only used by task scheduler server
113 CScheduledTask(TTaskInfo& aInfo,
115 TScheduleType aScheduleType,
116 const TSecurityInfo& aSecurityInfo);
119 void SetDue(TBool aDue);
120 void OnDue(const TTsTime& aValidUntil);
123 void ExternalizeL(RWriteStream& aStream) const;
125 TInt ScheduleId() const;
126 void SetScheduleId(TInt aScheduleId);
128 TBool Persists() const;
131 static TInt Offset();
135 void InternalizeL(RReadStream& aStream);
143 TScheduleType iScheduleType;
144 TSecurityInfo iSecurityInfo;