17 |
17 |
18 |
18 |
19 #ifndef C_ESMRCOMBINEDTASK_H |
19 #ifndef C_ESMRCOMBINEDTASK_H |
20 #define C_ESMRCOMBINEDTASK_H |
20 #define C_ESMRCOMBINEDTASK_H |
21 |
21 |
22 #include "cesmrtaskbase.h" |
22 #include "mesmrtask.h" |
|
23 #include <e32base.h> |
|
24 |
|
25 class MESMRCalEntry; |
23 |
26 |
24 /** |
27 /** |
25 * CESMRCombinedTask is responsibe for executing multiple tasks. |
28 * CESMRCombinedTask is responsibe for executing multiple tasks. |
26 * |
29 * |
27 * CESMRCombinedTask executes the tasks in the order they are appended |
30 * CESMRCombinedTask executes the tasks in the order they are appended |
68 * @param aCalDbMgr Reference to cal db manager. |
72 * @param aCalDbMgr Reference to cal db manager. |
69 * @param aEntry Reference to ES MR calendar entry. |
73 * @param aEntry Reference to ES MR calendar entry. |
70 * @param aMRMailboxUtils Reference mr mailbox utilities. |
74 * @param aMRMailboxUtils Reference mr mailbox utilities. |
71 * @param aRule Exection rule |
75 * @param aRule Exection rule |
72 */ |
76 */ |
73 static CESMRCombinedTask* NewL( |
77 IMPORT_C static CESMRCombinedTask* NewL( |
74 MESMRCalDbMgr& aCalDbMgr, |
78 MESMRCalEntry& aEntry, |
75 MESMRMeetingRequestEntry& aEntry, |
|
76 CMRMailboxUtils& aMRMailboxUtils, |
|
77 TESMRExecutionRule aRule = CESMRCombinedTask::EESMRLeave ); |
79 TESMRExecutionRule aRule = CESMRCombinedTask::EESMRLeave ); |
78 |
80 |
79 /** |
81 /** |
80 * C++ destructor. |
82 * C++ destructor. |
81 */ |
83 */ |
82 ~CESMRCombinedTask(); |
84 IMPORT_C ~CESMRCombinedTask(); |
83 |
85 |
84 /** |
86 /** |
85 * Appends task to be executed. Ownership of appended task |
87 * Appends task to be executed. Ownership of appended task |
86 * is transferred. |
88 * is transferred. |
87 * @param aTask Pointer to task to be executed. |
89 * @param aTask Pointer to task to be executed. |
88 */ |
90 */ |
89 void AppendTaskL( MESMRTask* aTask ); |
91 IMPORT_C void AppendTaskL( MESMRTask* aTask ); |
90 |
92 |
91 /** |
93 /** |
92 * Removes the task from task list. Method returns the pointer to |
94 * Removes the task from task list. Method returns the pointer to |
93 * removed task. Ownership of the removed task is transferred to caller. |
95 * removed task. Ownership of the removed task is transferred to caller. |
94 * |
96 * |
95 * @param aTask Pointer to task to be removed. |
97 * @param aTask Pointer to task to be removed. |
96 * @return Pointer to removed task. |
98 * @return Pointer to removed task. |
97 */ |
99 */ |
98 MESMRTask* RemoveTaskL( MESMRTask* aTask ); |
100 IMPORT_C MESMRTask* RemoveTaskL( MESMRTask* aTask ); |
99 |
101 |
100 public:// From MESMRTask |
102 public:// From MESMRTask |
101 void ExecuteTaskL(); |
103 void ExecuteTaskL(); |
102 |
104 |
103 private: // Implementation |
105 private: // Implementation |
104 CESMRCombinedTask( |
106 CESMRCombinedTask( |
105 MESMRCalDbMgr& aCalDbMgr, |
107 MESMRCalEntry& aEntry, |
106 MESMRMeetingRequestEntry& aEntry, |
|
107 CMRMailboxUtils& aMRMailboxUtils, |
|
108 TESMRExecutionRule aRule ); |
108 TESMRExecutionRule aRule ); |
109 |
109 |
110 void ConstructL(); |
110 void ConstructL(); |
111 |
111 |
112 private: // Data |
112 private: // Data |
115 * Own |
115 * Own |
116 */ |
116 */ |
117 RPointerArray<MESMRTask> iTasks; |
117 RPointerArray<MESMRTask> iTasks; |
118 |
118 |
119 /** |
119 /** |
|
120 * Reference to entry. |
|
121 */ |
|
122 MESMRCalEntry& iEntry; |
|
123 |
|
124 /** |
120 * Task execution rule |
125 * Task execution rule |
121 */ |
126 */ |
122 TESMRExecutionRule iExecutionRule; |
127 TESMRExecutionRule iExecutionRule; |
123 }; |
128 }; |
124 |
129 |
|
130 /** |
|
131 * Helper function to append task into a combined task. |
|
132 * Takes ownership of aTask at calling time and delegates it to the combined task. |
|
133 * aTask must not be into CleanupStack at calling time. |
|
134 * |
|
135 * @param aContainer combined task |
|
136 * @param aTask a task to append into container |
|
137 */ |
|
138 IMPORT_C void AppendTaskL( CESMRCombinedTask& aContainer, MESMRTask* aTask ); |
|
139 |
125 #endif // C_ESMRCOMBINEDTASK_H |
140 #endif // C_ESMRCOMBINEDTASK_H |