|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Header file for the class AlarmClient |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef ALARMCLIENT_H |
|
20 #define ALARMCLIENT_H |
|
21 |
|
22 // System includes |
|
23 #include <qglobal.h> |
|
24 #include <QObject> |
|
25 #include <QList> |
|
26 #include <QTime> |
|
27 #include <asshddefs.h> |
|
28 #include <asshdalarm.h> |
|
29 #include <asclisession.h> |
|
30 |
|
31 // User includes |
|
32 #include "clockdatatypes.h" |
|
33 |
|
34 #ifdef ALARMCLIENT_LIBRARY |
|
35 #define ALARMCLIENT_EXPORT Q_DECL_EXPORT |
|
36 #else |
|
37 #define ALARMCLIENT_EXPORT Q_DECL_IMPORT |
|
38 #endif |
|
39 |
|
40 // Constants |
|
41 // Clock alarm category ID (copied from T32alm.cpp!) |
|
42 const TUid KAlarmClockOne = { 0x101F793A }; // Clock alarm category |
|
43 |
|
44 // Forward declarations |
|
45 class AlarmListener; |
|
46 |
|
47 class ALARMCLIENT_EXPORT AlarmClient : public QObject |
|
48 { |
|
49 Q_OBJECT |
|
50 |
|
51 public: |
|
52 AlarmClient(QObject* parent); |
|
53 ~AlarmClient(); |
|
54 |
|
55 public: |
|
56 void getAlarmList(QList<AlarmInfo>& alarmList); |
|
57 void setAlarm(AlarmInfo& alarmInfo); |
|
58 void deleteAlarm(int alarmId); |
|
59 int getAlarmInfo(int alarmId, AlarmInfo& alarmInfo); |
|
60 void toggleAlarmStatus(int alarmId, int alarmStatus); |
|
61 |
|
62 void startListener(); |
|
63 void stopListener(); |
|
64 |
|
65 public: |
|
66 void notifyChange(int alarmId = 0); |
|
67 |
|
68 signals: |
|
69 void alarmStateChanged(int alarmId = 0); |
|
70 |
|
71 private: |
|
72 void setAlarmState( |
|
73 TAlarmState state, AlarmState& alarmState); |
|
74 void setAlarmState( |
|
75 AlarmState state, TAlarmState& alarmState); |
|
76 void setAlarmRepeatType( |
|
77 TAlarmRepeatDefinition repeat, AlarmRepeatType& repeatType); |
|
78 void setAlarmRepeatType( |
|
79 AlarmRepeatType repeat, TAlarmRepeatDefinition& repeatType); |
|
80 |
|
81 private: |
|
82 AlarmListener *mListener; |
|
83 |
|
84 RASCliSession mAlarmSrvSession; |
|
85 TASShdAlarm mAlmObj; |
|
86 TAlarmId mAlarmIdDetail; |
|
87 }; |
|
88 |
|
89 #endif // ALARMCLIENT_H |
|
90 |
|
91 // End of file --Don't remove this. |