|
1 // Copyright (c) 1999-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __ASSRVSESSIONENGINE_H__ |
|
17 #define __ASSRVSESSIONENGINE_H__ |
|
18 |
|
19 // System includes |
|
20 #include <e32base.h> |
|
21 |
|
22 // User includes |
|
23 #include "ASSrvDefs.h" |
|
24 #include "ASSrvAlarm.h" |
|
25 #include "ASSrvAnyEventObserver.h" |
|
26 #include "ASSrvSessionCollection.h" |
|
27 |
|
28 // Classes referenced |
|
29 class RASSrvIteratorBase; |
|
30 class CASSrvServerWideData; |
|
31 |
|
32 /** |
|
33 Copy of System-Wide Unique Agenda Entry Reference defined in agmalarm.h |
|
34 */ |
|
35 struct TAgnAlarmInfo |
|
36 { |
|
37 TUid iAlarmCategory; |
|
38 TUint32 iEntryId; |
|
39 TTime iInstanceTime; |
|
40 TUint32 iTimeMode; |
|
41 TFileName iFileName; |
|
42 TBuf8<255> iGlobalIdentifier; |
|
43 TTime iRecurrenceId; |
|
44 TUint32 iAgnUniqueId; |
|
45 }; |
|
46 |
|
47 |
|
48 // |
|
49 // ----> CASSrvSessionEngine (header) |
|
50 // |
|
51 /** |
|
52 * The underlying engine used by each session. Manipulates the server-side objects. |
|
53 */ |
|
54 class CASSrvSessionEngine : public CBase, public MASSrvAnyEventObserver, public MASSrvSession |
|
55 { |
|
56 // |
|
57 public: // STATIC CONSTRUCT / DESTRUCT |
|
58 // |
|
59 static CASSrvSessionEngine* NewL(CASSrvServerWideData& aServerWideData, MASSrvAnyEventObserver& aChangeObserver, MASSrvSession& aSession); |
|
60 ~CASSrvSessionEngine(); |
|
61 |
|
62 // |
|
63 private: // INTERNAL CONSTRUCT |
|
64 // |
|
65 CASSrvSessionEngine(CASSrvServerWideData& aServerWideData, MASSrvAnyEventObserver& aChangeObserver, MASSrvSession& aSession); |
|
66 void ConstructL(); |
|
67 |
|
68 // |
|
69 public: // FROM MASSrvAnyEventObserver |
|
70 // |
|
71 |
|
72 void MASSrvAnyEventHandleChange(TAlarmChangeEvent aEvent, TAlarmId aAlarmId); |
|
73 |
|
74 // |
|
75 public: // FROM MASSrvSession |
|
76 // |
|
77 |
|
78 TASSrvSessionId MASSrvSessionId() const; |
|
79 |
|
80 void MASSrvSessionFullName(TDes& aDes) const; |
|
81 |
|
82 // |
|
83 public: // ENGINE API |
|
84 // |
|
85 |
|
86 void AlarmAddL(TASSrvAlarm& aAlarm, TAlarmId aSpecificAlarmId = KNullAlarmId); |
|
87 |
|
88 void AlarmDetailsL(TAlarmId aAlarmId, TASSrvAlarm& aAlarm) const; |
|
89 |
|
90 void AlarmDeleteL(TAlarmId aAlarmId); |
|
91 |
|
92 TAlarmCategory AlarmCategoryL(TAlarmId aAlarmId) const; |
|
93 |
|
94 void SetAlarmStatusL(TAlarmId aAlarmId, TAlarmStatus aStatus); |
|
95 |
|
96 void SetAlarmStatusForCalendarFileL(const TDesC& aCalendarFileName, TAlarmStatus aStatus); |
|
97 |
|
98 TAlarmStatus AlarmStatusL(TAlarmId aAlarmId) const; |
|
99 |
|
100 void SetAlarmDayOrTimedL(TAlarmId aAlarmId, TAlarmDayOrTimed aDayOrTimed); |
|
101 |
|
102 TAlarmDayOrTimed AlarmDayOrTimedL(TAlarmId aAlarmId) const; |
|
103 |
|
104 void SetAlarmCharacteristicsL(TAlarmId aAlarmId, TAlarmCharacteristicsFlags aCharacteristics); |
|
105 |
|
106 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
|
107 void SetWakeupL(TAlarmId aAlarmId, TBool aEnable); |
|
108 #endif |
|
109 |
|
110 #ifdef SYMBIAN_ALARM_REPEAT_EXTENSIONS |
|
111 void SetAlarmDaysL(TAlarmId aAlarmId, TUint8 aAlarmDays); |
|
112 TUint8 AlarmDaysL(TAlarmId aAlarmId) const; |
|
113 void SetContinuousL(TAlarmId aAlarmId, TBool aContinuous); |
|
114 TBool ContinuousL(TAlarmId aAlarmId) const; |
|
115 #endif |
|
116 |
|
117 void SetAlarmOrphanedL(TAlarmId aAlarmId); |
|
118 |
|
119 TAlarmCharacteristicsFlags AlarmCharacteristicsL(TAlarmId aAlarmId) const; |
|
120 |
|
121 void SetAlarmStatusByCategoryL(TAlarmCategory aCategory, TAlarmStatus aStatus); |
|
122 |
|
123 TInt AlarmCountByCategory(TAlarmCategory aCategory) const; |
|
124 |
|
125 TInt AlarmCountByState(TAlarmState aState) const; |
|
126 |
|
127 void DeleteAllAlarmsByCategoryL(TAlarmCategory aCategory, TBool aRestrictToOrphanedAlarms, TDeleteType aWhatToDelete=EAllAlarms); |
|
128 |
|
129 void DeleteAllAlarmsByCalendarFileL(const TDesC& aCalendarFileName, TDeleteType aWhatToDelete); |
|
130 |
|
131 RArray<TAlarmCategory>* AlarmCategoryListLC() const; |
|
132 |
|
133 RArray<TAlarmId>* AlarmIdListByCategoryLC(TAlarmCategory aCategory) const; |
|
134 |
|
135 RArray<TAlarmId>* AlarmIdListByStateLC(TAlarmState aState) const; |
|
136 |
|
137 RArray<TAlarmId>* AlarmIdListLC() const; |
|
138 |
|
139 TInt NumberOfActiveAlarmsInQueue() const; |
|
140 |
|
141 void AlarmDataAttachL(TAlarmId aAlarmId, HBufC8* aData); |
|
142 |
|
143 void AlarmDataDetachL(TAlarmId aAlarmId); |
|
144 |
|
145 |
|
146 // |
|
147 private: // INTERNAL METHODS |
|
148 // |
|
149 |
|
150 /** |
|
151 * Access the server wide data |
|
152 */ |
|
153 inline CASSrvServerWideData& ServerData() const { return iServerWideData; } |
|
154 |
|
155 RArray<TAlarmId>* AlarmIdListFromIteratorLC(RASSrvIteratorBase& aIterator) const; |
|
156 |
|
157 // |
|
158 private: // MEMBER DATA |
|
159 // |
|
160 |
|
161 /** |
|
162 * The server wide data |
|
163 */ |
|
164 CASSrvServerWideData& iServerWideData; |
|
165 |
|
166 /** |
|
167 * The handle to the real any event observer |
|
168 */ |
|
169 MASSrvAnyEventObserver& iChangeObserver; |
|
170 |
|
171 /** |
|
172 * The handle to the real session |
|
173 */ |
|
174 MASSrvSession& iSession; |
|
175 |
|
176 /** |
|
177 * The session id assocaited with this object |
|
178 */ |
|
179 TASSrvSessionId iSessionId; |
|
180 }; |
|
181 |
|
182 #endif |