sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef __SCHMAN_H__
|
sl@0
|
17 |
#define __SCHMAN_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
// System includes
|
sl@0
|
20 |
#include <f32file.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
// User includes
|
sl@0
|
23 |
#include "SCHINFO.H"
|
sl@0
|
24 |
#include "SchSSAObserver.h"
|
sl@0
|
25 |
|
sl@0
|
26 |
#include <babackup.h>
|
sl@0
|
27 |
|
sl@0
|
28 |
// Classes referenced
|
sl@0
|
29 |
class CSchedule;
|
sl@0
|
30 |
class TScheduledTask;
|
sl@0
|
31 |
class CScheduleCriteriaManager;
|
sl@0
|
32 |
class CClientProxy;
|
sl@0
|
33 |
class TScheduleEntryInfo2;
|
sl@0
|
34 |
class CSchBackupManager;
|
sl@0
|
35 |
class CEnvironmentChangeNotifier;
|
sl@0
|
36 |
class CSchLogManager;
|
sl@0
|
37 |
class TTaskSchedulerCondition;
|
sl@0
|
38 |
|
sl@0
|
39 |
enum TBUROperation
|
sl@0
|
40 |
{
|
sl@0
|
41 |
EBUROperationNoActivity = 0,
|
sl@0
|
42 |
EBUROperationBackup,
|
sl@0
|
43 |
EBUROperationRestore
|
sl@0
|
44 |
};
|
sl@0
|
45 |
|
sl@0
|
46 |
enum TBUROperationResult
|
sl@0
|
47 |
{
|
sl@0
|
48 |
EBUROperationAbort = 0,
|
sl@0
|
49 |
EBUROperationSuccess
|
sl@0
|
50 |
};
|
sl@0
|
51 |
|
sl@0
|
52 |
NONSHARABLE_CLASS(CTaskScheduler) : public CBase, public MSchStartupStateObserver, private MBackupOperationObserver
|
sl@0
|
53 |
{
|
sl@0
|
54 |
public:
|
sl@0
|
55 |
static CTaskScheduler* NewL();
|
sl@0
|
56 |
static CTaskScheduler* NewLC();
|
sl@0
|
57 |
~CTaskScheduler();
|
sl@0
|
58 |
|
sl@0
|
59 |
public:
|
sl@0
|
60 |
// Client, Schedule and Task functions
|
sl@0
|
61 |
CClientProxy* AddClientL(const TDesC& aFilename, TInt aPriority);
|
sl@0
|
62 |
void AddScheduleL(CSchedule& aSchedule);
|
sl@0
|
63 |
void RemoveScheduleL(TInt aHandle);
|
sl@0
|
64 |
void EditScheduleL(TInt aScheduleHandle,
|
sl@0
|
65 |
CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
|
sl@0
|
66 |
void EditScheduleL(TInt aScheduleHandle,
|
sl@0
|
67 |
CArrayFixFlat<TTaskSchedulerCondition>& aEntryList,
|
sl@0
|
68 |
const TTsTime& aDefaultTime);
|
sl@0
|
69 |
void EnableScheduleL(TInt aHandle);
|
sl@0
|
70 |
void DisableScheduleL(TInt aHandle);
|
sl@0
|
71 |
void ScheduleTaskL(CSchedule& aSchedule,
|
sl@0
|
72 |
CClientProxy& aClient);
|
sl@0
|
73 |
void DeleteTaskL(TInt aScheduleHandle, TInt aTaskHandle);
|
sl@0
|
74 |
|
sl@0
|
75 |
TInt GetScheduleRefsL(CArrayFixFlat<TSchedulerItemRef>* aRefArray,
|
sl@0
|
76 |
TScheduleFilter aFilter,
|
sl@0
|
77 |
const RMessagePtr2& aMessage);
|
sl@0
|
78 |
TInt GetTaskRefsL(CArrayFixFlat<TSchedulerItemRef>* aRefArray,
|
sl@0
|
79 |
TScheduleFilter aScheduleFilter,
|
sl@0
|
80 |
TTaskFilter aTaskFilter,
|
sl@0
|
81 |
CClientProxy* aClient,
|
sl@0
|
82 |
const RMessagePtr2& aMessage);
|
sl@0
|
83 |
// Utility functions
|
sl@0
|
84 |
CSchedule* FindL(TInt aHandle);
|
sl@0
|
85 |
TInt GenerateId();
|
sl@0
|
86 |
void DueTaskNotifyL(TInt aScheduleHandle); //called when some task is due
|
sl@0
|
87 |
|
sl@0
|
88 |
// from MSchStartupStateObserver
|
sl@0
|
89 |
void ProcessSSAEventL(TStartupStateIdentifier aKnownState);
|
sl@0
|
90 |
TBool IsScheduleReadyForUpdate(CSchedule& aSchedule);
|
sl@0
|
91 |
TBool IsStartupStateNonCritical();
|
sl@0
|
92 |
|
sl@0
|
93 |
inline TBUROperation BUROperationInProgress() { return iBUROperationInProgress; }
|
sl@0
|
94 |
|
sl@0
|
95 |
// from MBackupOperationObserver
|
sl@0
|
96 |
virtual void HandleBackupOperationEventL(const TBackupOperationAttributes &aBackupOperationAttributes);
|
sl@0
|
97 |
|
sl@0
|
98 |
private:
|
sl@0
|
99 |
// Construction functions
|
sl@0
|
100 |
CTaskScheduler();
|
sl@0
|
101 |
void ConstructL();
|
sl@0
|
102 |
|
sl@0
|
103 |
//Environment change functions
|
sl@0
|
104 |
static TInt EnvironmentChanged(TAny* aScheduler);
|
sl@0
|
105 |
void HandleEnvironmentChange();
|
sl@0
|
106 |
|
sl@0
|
107 |
// Utility functions
|
sl@0
|
108 |
CSchedule* Find(TInt aHandle);
|
sl@0
|
109 |
void DoRemoveL(CSchedule* aSchedule);
|
sl@0
|
110 |
void ExecuteClients(TBool aUpdateClient=ETrue);
|
sl@0
|
111 |
void DoEditScheduleL(CSchedule& aSchedule,
|
sl@0
|
112 |
CArrayFixFlat<TTaskSchedulerCondition>& aConditionList,
|
sl@0
|
113 |
const TTsTime& aDefaultTime);
|
sl@0
|
114 |
void AddSchedulesToTimerL();
|
sl@0
|
115 |
void CleanupScheduledTasksL();
|
sl@0
|
116 |
void UpdateClients();
|
sl@0
|
117 |
|
sl@0
|
118 |
void BURBeginningL(TBUROperation aOperationType);
|
sl@0
|
119 |
void BURCompleteL(TBUROperation aOperationType, TBUROperationResult aBURResult);
|
sl@0
|
120 |
|
sl@0
|
121 |
private:
|
sl@0
|
122 |
RFs iFsSession;
|
sl@0
|
123 |
//
|
sl@0
|
124 |
TSglQue<CSchedule> iSchedules;
|
sl@0
|
125 |
TPriQue<CClientProxy> iClients;
|
sl@0
|
126 |
//
|
sl@0
|
127 |
CScheduleCriteriaManager* iScheduleCriteriaManager;
|
sl@0
|
128 |
CSchBackupManager* iBackupManager;
|
sl@0
|
129 |
CEnvironmentChangeNotifier* iNotifier;
|
sl@0
|
130 |
CSchLogManager* iSchLogManager;
|
sl@0
|
131 |
TBool iStartupStatePassNonCritical;
|
sl@0
|
132 |
|
sl@0
|
133 |
TBUROperation iBUROperationInProgress;
|
sl@0
|
134 |
TBool iTaskExecutedDuringBUR;
|
sl@0
|
135 |
CBaBackupSessionWrapper* iBackupNotification;
|
sl@0
|
136 |
};
|
sl@0
|
137 |
|
sl@0
|
138 |
#endif
|