Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
23 #ifndef __EIKALSRV_H__
24 #define __EIKALSRV_H__
27 #include <asaltdefs.h>
28 #include <asshddefs.h>
30 class MEikServAlarmFactory;
32 class CEikServAlarmAlertSession;
37 NONSHARABLE_CLASS(CEikServAlarmAlertServer) : public CPolicyServer
40 IMPORT_C static CEikServAlarmAlertServer* NewL(MEikServAlarmFactory* aAlarmControlFactory);
41 IMPORT_C static CEikServAlarmAlertServer* NewL(MEikServAlarmFactory* aAlarmControlFactory, TInt aMaxAlarms);
42 ~CEikServAlarmAlertServer();
43 IMPORT_C void HandleSwitchOnEvent();
44 IMPORT_C void TaskKeyPressedL();
45 inline TBool AlarmAlertIsVisible() const;
46 inline void SessionDied();
47 IMPORT_C void SetQuietPeriodL(TTime aQuietPeriodEndTime);
48 IMPORT_C void ClearAllAlarmsL();
49 public: // from CPolicyServer
50 CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
52 CEikServAlarmAlertServer(TInt aPriority, MEikServAlarmFactory& aAlarmControlFactory, TInt aMaxAlarms);
54 CEikServAlarmAlertSession* iSession; // iSession does not *own* what it points to
55 MEikServAlarmFactory& iAlarmControlFactory;
60 class CEikAlmControlSupervisor;
63 Helper class for CEikServAlarmAlertSession. Holds response data for queuing
66 NONSHARABLE_CLASS(TAlarmResponse)
69 TAlarmResponse (TASAltAlertServerResponse aCode, TAlarmId aId, TTime aTime);
70 TASAltAlertServerResponse ResponseCode () const;
71 TAlarmId AlarmId () const;
72 TTime TimeToSnooze() const;
74 TASAltAlertServerResponse iCode;
79 // supposed to be maximum one response in a queue, because client should resubmit request
80 // for response as soon as it receive previous
81 const TInt KAlertResponseQueueSize = 20;
84 Represents a session for a client thread on the server-side.
87 NONSHARABLE_CLASS(CEikServAlarmAlertSession) : public CSession2
90 static CEikServAlarmAlertSession* NewL(MEikServAlarmFactory& aAlarmControlFactory, TInt aMaxAlarms);
91 ~CEikServAlarmAlertSession();
92 void TaskKeyPressedL();
93 void HandleSwitchOnEvent();
94 inline TBool AlarmAlertIsVisible() const;
96 void SetQuietPeriodL(TTime aQuietPeriodEndTime);
97 inline TTime QuietPeriodEndTime() const;
98 void RespondEventL(TASAltAlertServerResponse aCode);
99 void RespondEventL(TASAltAlertServerResponse aCode, TAlarmId aId, TTime aTimeToSnooze = 0);
100 void ClearAllAlarmsL();
102 CEikServAlarmAlertServer* AlarmAlertServer() const;
104 virtual void ServiceL(const RMessage2 &aMessage);
106 CEikServAlarmAlertSession(MEikServAlarmFactory& aAlarmControl, TInt aMaxAlarms);
107 void QueueEventL (TASAltAlertServerResponse& aCode,TAlarmId& aId, TTime& aTimeToSnooze);
108 TInt FindAlarm(TAlarmId aAlarmId) const;
109 void DeleteAlarmL(const RMessage2& aMessage);
110 void UpdateVisibility();
113 MEikServAlarmFactory& iAlarmControlFactory;
114 TTime iQuietPeriodEndTime;
116 RPointerArray<CEikAlmControlSupervisor> iAlarmSupervisors;
117 RArray <TAlarmResponse> iResponseQueue;
121 inline TBool CEikServAlarmAlertServer::AlarmAlertIsVisible() const
122 { return iSession->AlarmAlertIsVisible(); }
124 inline TBool CEikServAlarmAlertSession::AlarmAlertIsVisible() const
127 inline void CEikServAlarmAlertServer::SessionDied()
130 inline TTime CEikServAlarmAlertSession::QuietPeriodEndTime() const
131 { return iQuietPeriodEndTime; }
133 #endif //__EIKALSRV_H__