1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 // |
7 // |
8 // Initial Contributors: |
8 // Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
9 // Nokia Corporation - initial contribution. |
10 // |
10 // |
11 // Contributors: |
11 // Contributors: |
31 /** The client-side interface to the Symbian OS alarm server. |
31 /** The client-side interface to the Symbian OS alarm server. |
32 @publishedAll |
32 @publishedAll |
33 @released |
33 @released |
34 */ |
34 */ |
35 { |
35 { |
36 /////////////////////////////////////////////////////////////////////////////////////// |
36 // |
37 public: // CONNECT TO SERVER & VERSIONING |
37 public: // CONNECT TO SERVER & VERSIONING |
38 /////////////////////////////////////////////////////////////////////////////////////// |
38 // |
39 |
39 |
40 IMPORT_C RASCliSession(); |
40 IMPORT_C RASCliSession(); |
41 |
41 |
42 IMPORT_C TInt Connect(); |
42 IMPORT_C TInt Connect(); |
43 |
43 |
44 IMPORT_C TVersion Version() const; |
44 IMPORT_C TVersion Version() const; |
45 |
45 |
46 /////////////////////////////////////////////////////////////////////////////////////// |
46 // |
47 public: // ALARM SPECIFIC FUNCTIONALITY |
47 public: // ALARM SPECIFIC FUNCTIONALITY |
48 /////////////////////////////////////////////////////////////////////////////////////// |
48 // |
49 |
49 |
50 IMPORT_C TInt AlarmAdd(TASShdAlarm& aAlarm) const; |
50 IMPORT_C TInt AlarmAdd(TASShdAlarm& aAlarm) const; |
51 |
51 |
52 IMPORT_C TInt AlarmAdd(TASShdAlarm& aAlarm, const TDesC8& aData) const; |
52 IMPORT_C TInt AlarmAdd(TASShdAlarm& aAlarm, const TDesC8& aData) const; |
53 |
53 |
64 IMPORT_C TInt GetAlarmCategory(TAlarmId aAlarmId, TAlarmCategory& aCategory) const; |
64 IMPORT_C TInt GetAlarmCategory(TAlarmId aAlarmId, TAlarmCategory& aCategory) const; |
65 |
65 |
66 IMPORT_C TInt GetAlarmOwner(TAlarmId aAlarmId, TFullName& aThreadName) const; |
66 IMPORT_C TInt GetAlarmOwner(TAlarmId aAlarmId, TFullName& aThreadName) const; |
67 |
67 |
68 IMPORT_C TInt SetAlarmStatus(TAlarmId aAlarmId, TAlarmStatus aStatus) const; |
68 IMPORT_C TInt SetAlarmStatus(TAlarmId aAlarmId, TAlarmStatus aStatus) const; |
|
69 |
|
70 IMPORT_C TInt SetAlarmStatusForCalendarFile(const TDesC& aFileName, TAlarmStatus aStatus) const; |
69 |
71 |
70 IMPORT_C TInt GetAlarmStatus(TAlarmId aAlarmId, TAlarmStatus& aStatus) const; |
72 IMPORT_C TInt GetAlarmStatus(TAlarmId aAlarmId, TAlarmStatus& aStatus) const; |
71 |
73 |
72 IMPORT_C TInt SetAlarmDayOrTimed(TAlarmId aAlarmId, TAlarmDayOrTimed aDayOrTimed) const; |
74 IMPORT_C TInt SetAlarmDayOrTimed(TAlarmId aAlarmId, TAlarmDayOrTimed aDayOrTimed) const; |
73 |
75 |
75 |
77 |
76 IMPORT_C TInt SetAlarmCharacteristics(TAlarmId aAlarmId, TAlarmCharacteristicsFlags aCharacteristics) const; |
78 IMPORT_C TInt SetAlarmCharacteristics(TAlarmId aAlarmId, TAlarmCharacteristicsFlags aCharacteristics) const; |
77 |
79 |
78 IMPORT_C TInt GetAlarmCharacteristics(TAlarmId aAlarmId, TAlarmCharacteristicsFlags& aCharacteristics) const; |
80 IMPORT_C TInt GetAlarmCharacteristics(TAlarmId aAlarmId, TAlarmCharacteristicsFlags& aCharacteristics) const; |
79 |
81 |
|
82 #ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT |
|
83 IMPORT_C TInt SetWakeup(TAlarmId aAlarmId, TBool aEnabled) const; |
|
84 #endif |
|
85 |
80 IMPORT_C TInt SetClientData(const TASShdAlarm& aAlarm); |
86 IMPORT_C TInt SetClientData(const TASShdAlarm& aAlarm); |
81 |
87 |
|
88 #ifdef SYMBIAN_ALARM_REPEAT_EXTENSIONS |
82 IMPORT_C TInt SetAlarmDays(TAlarmId aAlarmId, TUint8 aAlarmDays) const; |
89 IMPORT_C TInt SetAlarmDays(TAlarmId aAlarmId, TUint8 aAlarmDays) const; |
83 IMPORT_C TInt GetAlarmDays(TAlarmId aAlarmId, TUint8& aAlarmDays) const; |
90 IMPORT_C TInt GetAlarmDays(TAlarmId aAlarmId, TUint8& aAlarmDays) const; |
84 IMPORT_C TInt SetContinuous(TAlarmId aAlarmId, TBool aContinuous) const; |
91 IMPORT_C TInt SetContinuous(TAlarmId aAlarmId, TBool aContinuous) const; |
85 IMPORT_C TInt GetContinuous(TAlarmId aAlarmId, TBool& aContinuous) const; |
92 IMPORT_C TInt GetContinuous(TAlarmId aAlarmId, TBool& aContinuous) const; |
86 |
93 #endif |
87 /////////////////////////////////////////////////////////////////////////////////////// |
94 |
|
95 // |
88 public: // ALARM DATA FUNCTIONALITY |
96 public: // ALARM DATA FUNCTIONALITY |
89 /////////////////////////////////////////////////////////////////////////////////////// |
97 // |
90 |
98 |
91 IMPORT_C TInt AlarmDataAttachL(TAlarmId aAlarmId, const TDesC8& aData) const; |
99 IMPORT_C TInt AlarmDataAttachL(TAlarmId aAlarmId, const TDesC8& aData) const; |
92 |
100 |
93 IMPORT_C TInt AlarmDataDetach(TAlarmId aAlarmId) const; |
101 IMPORT_C TInt AlarmDataDetach(TAlarmId aAlarmId) const; |
94 |
102 |
98 |
106 |
99 IMPORT_C TInt GetAlarmData(TAlarmId aAlarmId, TDes8& aSink) const; |
107 IMPORT_C TInt GetAlarmData(TAlarmId aAlarmId, TDes8& aSink) const; |
100 |
108 |
101 IMPORT_C TInt GetAlarmData(TAlarmId aAlarmId, HBufC8*& aSink) const; |
109 IMPORT_C TInt GetAlarmData(TAlarmId aAlarmId, HBufC8*& aSink) const; |
102 |
110 |
103 /////////////////////////////////////////////////////////////////////////////////////// |
111 // |
104 public: // CATEGORY-SPECIFIC FUNCTIONALITY |
112 public: // CATEGORY-SPECIFIC FUNCTIONALITY |
105 /////////////////////////////////////////////////////////////////////////////////////// |
113 // |
106 |
114 |
107 IMPORT_C TInt SetAlarmStatusByCategory(TAlarmCategory aCategory, TAlarmStatus aStatus) const; |
115 IMPORT_C TInt SetAlarmStatusByCategory(TAlarmCategory aCategory, TAlarmStatus aStatus) const; |
108 |
116 |
109 IMPORT_C TInt GetAlarmCountForCategory(TAlarmCategory aCategory) const; |
117 IMPORT_C TInt GetAlarmCountForCategory(TAlarmCategory aCategory) const; |
110 |
118 |
111 IMPORT_C TInt AlarmDeleteAllByCategory(TAlarmCategory aCategory, TBool aDeleteOnlyOrphanedAlarmsInCategory) const; |
119 IMPORT_C TInt AlarmDeleteAllByCategory(TAlarmCategory aCategory, TBool aDeleteOnlyOrphanedAlarmsInCategory) const; |
112 |
120 |
113 IMPORT_C TInt AlarmDeleteByCategory(TAlarmCategory aCategory, TDeleteType aWhatToDelete) const; |
121 IMPORT_C TInt AlarmDeleteByCategory(TAlarmCategory aCategory, TDeleteType aWhatToDelete) const; |
114 |
122 |
|
123 IMPORT_C TInt AlarmDeleteByCalendarFile(const TDesC& aFileName, TDeleteType aWhatToDelete) const; |
|
124 |
115 IMPORT_C void GetAvailableCategoryListL(RArray<TAlarmCategory>& aCategories) const; |
125 IMPORT_C void GetAvailableCategoryListL(RArray<TAlarmCategory>& aCategories) const; |
116 |
126 |
117 IMPORT_C void GetAlarmIdListForCategoryL(TAlarmCategory aCategory, RArray<TAlarmId>& aAlarmIds) const; |
127 IMPORT_C void GetAlarmIdListForCategoryL(TAlarmCategory aCategory, RArray<TAlarmId>& aAlarmIds) const; |
118 |
128 |
119 /////////////////////////////////////////////////////////////////////////////////////// |
129 // |
120 public: // MISC FUNCTIONALITY |
130 public: // MISC FUNCTIONALITY |
121 /////////////////////////////////////////////////////////////////////////////////////// |
131 // |
122 |
132 |
123 IMPORT_C TInt AlarmCountByState(TAlarmState aState) const; |
133 IMPORT_C TInt AlarmCountByState(TAlarmState aState) const; |
124 |
134 |
125 IMPORT_C void GetAlarmIdListByStateL(TAlarmState aState, RArray<TAlarmId>& aAlarmIds) const; |
135 IMPORT_C void GetAlarmIdListByStateL(TAlarmState aState, RArray<TAlarmId>& aAlarmIds) const; |
126 |
136 |
128 |
138 |
129 IMPORT_C TInt GetNextDueAlarmId(TAlarmId& aAlarmId) const; |
139 IMPORT_C TInt GetNextDueAlarmId(TAlarmId& aAlarmId) const; |
130 |
140 |
131 IMPORT_C TInt NumberOfAlarmsActiveInQueue() const; |
141 IMPORT_C TInt NumberOfAlarmsActiveInQueue() const; |
132 |
142 |
133 /////////////////////////////////////////////////////////////////////////////////////// |
143 // |
134 public: // SOUND CONTROL |
144 public: // SOUND CONTROL |
135 /////////////////////////////////////////////////////////////////////////////////////// |
145 // |
136 |
146 |
137 IMPORT_C TInt SetAlarmSoundState(TAlarmGlobalSoundState aState) const; |
147 IMPORT_C TInt SetAlarmSoundState(TAlarmGlobalSoundState aState) const; |
138 |
148 |
139 IMPORT_C TInt GetAlarmSoundState(TAlarmGlobalSoundState& aState) const; |
149 IMPORT_C TInt GetAlarmSoundState(TAlarmGlobalSoundState& aState) const; |
140 |
150 |
150 |
160 |
151 IMPORT_C void SetAlarmPlayIntervalsL(const CArrayFix<TASCliSoundPlayDefinition>& aIntervals) const; |
161 IMPORT_C void SetAlarmPlayIntervalsL(const CArrayFix<TASCliSoundPlayDefinition>& aIntervals) const; |
152 |
162 |
153 IMPORT_C void GetAlarmPlayIntervalsL(CArrayFix<TASCliSoundPlayDefinition>& aIntervals) const; |
163 IMPORT_C void GetAlarmPlayIntervalsL(CArrayFix<TASCliSoundPlayDefinition>& aIntervals) const; |
154 |
164 |
155 /////////////////////////////////////////////////////////////////////////////////////// |
165 // |
156 public: // CHANGE NOTIFICATION |
166 public: // CHANGE NOTIFICATION |
157 /////////////////////////////////////////////////////////////////////////////////////// |
167 // |
158 |
168 |
159 IMPORT_C void NotifyChange(TRequestStatus& aStatus, TAlarmId& aAlarmId); |
169 IMPORT_C void NotifyChange(TRequestStatus& aStatus, TAlarmId& aAlarmId); |
160 |
170 |
161 IMPORT_C void NotifyChangeCancel() const; |
171 IMPORT_C void NotifyChangeCancel() const; |
162 |
172 |
163 /////////////////////////////////////////////////////////////////////////////////////// |
173 // |
164 public: // DEBUG ONLY |
174 public: // DEBUG ONLY |
165 /////////////////////////////////////////////////////////////////////////////////////// |
175 // |
166 |
176 |
167 IMPORT_C void __DbgShutDownServer() const; |
177 IMPORT_C void __DbgShutDownServer() const; |
168 |
178 |
169 IMPORT_C void __DbgFailAlloc(TInt aCount) const; |
179 IMPORT_C void __DbgFailAlloc(TInt aCount) const; |
170 |
180 |
171 IMPORT_C void __DbgPreventUserNotify(TBool aShouldStop) const; |
181 IMPORT_C void __DbgPreventUserNotify(TBool aShouldStop) const; |
172 |
182 |
173 IMPORT_C TInt __DbgSnoozeAlarm(TAlarmId aAlarmId, const TTime& aNewTime) const; |
183 IMPORT_C TInt __DbgSnoozeAlarm(TAlarmId aAlarmId, const TTime& aNewTime) const; |
174 |
184 |
175 IMPORT_C TInt __DbgSetEnvChgHandling(TBool aFlag) const; |
185 IMPORT_C TInt __DbgSetEnvChgHandling(TBool aFlag) const; |
176 /////////////////////////////////////////////////////////////////////////////////////// |
186 // |
177 private: // MEMBER DATA |
187 private: // MEMBER DATA |
178 /////////////////////////////////////////////////////////////////////////////////////// |
188 // |
179 |
189 |
180 void FetchAlarmIdsFromBufferL(RArray<TAlarmId>& aAlarmIds, TInt aBufferSize) const; |
190 void FetchAlarmIdsFromBufferL(RArray<TAlarmId>& aAlarmIds, TInt aBufferSize) const; |
181 |
191 |
182 CBufBase* FetchTransferBufferLC(TInt aBufferSize) const; |
192 CBufBase* FetchTransferBufferLC(TInt aBufferSize) const; |
183 |
193 |
184 void DoAlarmAddWithNotification(TRequestStatus& aStatus, TASShdAlarm& aAlarm, const TDesC8& aData); |
194 void DoAlarmAddWithNotification(TRequestStatus& aStatus, TASShdAlarm& aAlarm, const TDesC8& aData); |
185 TInt DoAlarmAdd(TASShdAlarm& aAlarm, const TDesC8& aData) const; |
195 TInt DoAlarmAdd(TASShdAlarm& aAlarm, const TDesC8& aData) const; |
186 |
196 |
187 /////////////////////////////////////////////////////////////////////////////////////// |
197 // |
188 private: // MEMBER DATA |
198 private: // MEMBER DATA |
189 /////////////////////////////////////////////////////////////////////////////////////// |
199 // |
190 |
200 |
191 TPtr8 iPackage; |
201 TPtr8 iPackage; |
192 TPtr8 iAlarmIdPointer; |
202 TPtr8 iAlarmIdPointer; |
193 }; |
203 }; |
194 |
204 |
195 /////////////////////////////////////////////////////////////////////////////////////// |
205 // |
196 // ----> RASCliSession (inlines) |
206 // ----> RASCliSession (inlines) |
197 /////////////////////////////////////////////////////////////////////////////////////// |
207 // |
198 inline TInt RASCliSession::AlarmDataDetatch(TAlarmId aAlarmId) const |
208 inline TInt RASCliSession::AlarmDataDetatch(TAlarmId aAlarmId) const |
199 /** @deprecated 8.0 |
209 /** @deprecated 8.0 |
200 |
210 |
201 RASCliSession::AlarmDataDetach() should be used instead */ |
211 RASCliSession::AlarmDataDetach() should be used instead */ |
202 { |
212 { |