1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/uikon/eikalsup.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,143 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalComponent
1.24 +*/
1.25 +
1.26 +#ifndef __EIKALSUP_H__
1.27 +#define __EIKALSUP_H__
1.28 +
1.29 +// System includes
1.30 +#include <e32base.h>
1.31 +#include <uikon/eiksvfty.h>
1.32 +#include <asaltdefs.h>
1.33 +#include <uikon/eikalsrv.h>
1.34 +
1.35 +/** Patchable ROM constant for the default number of minutes to snooze. See uikon.iby.
1.36 +@publishedPartner */
1.37 +IMPORT_C extern const TInt KEikAlarmDefaultSnoozeInMinutes; // default snooze increment in minutes
1.38 +
1.39 +/** @internalComponent */
1.40 +const TInt KEikUseDefaultAlarmSnoozeIncrement = -1; // Use ROM constant KAlarmDefaultSnoozeInMinutes
1.41 +
1.42 +/** Provides an interface between the alarm server and applications that need to
1.43 +handle expiring alarms.
1.44 +
1.45 +When an alarm has expired, this class handles silencing, acknowledging and snoozing it,
1.46 +and users switching to another application (which causes the alarm to be snoozed for a
1.47 +default period).
1.48 +
1.49 +@publishedPartner
1.50 +@released */
1.51 +NONSHARABLE_CLASS(CEikAlmControlSupervisor) : public CBase
1.52 + {
1.53 +public:
1.54 + /** The priority of the periodic timer that is used to count down the snooze period. */
1.55 + enum TPriority
1.56 + {
1.57 + /** The timer's priority. This value is between EPriorityStandard and EPriorityUserInput. */
1.58 + ESnoozeCountDownPriority = 0x00000001
1.59 + };
1.60 +public: //exported API
1.61 + inline TInt PauseSoundMinutes() const;
1.62 + inline TTime QuietPeriodEndTime() const;
1.63 + IMPORT_C void CmdAcknowledgeAlarm();
1.64 + IMPORT_C void CmdPauseAlarmSoundL(TInt aNumMinutes = KEikUseDefaultAlarmSnoozeIncrement);
1.65 + IMPORT_C void CmdSilenceAlarmSound();
1.66 + IMPORT_C TBool CmdTaskAwayFromAlarmL(); // use default snooze time
1.67 + IMPORT_C TBool CmdTaskAwayFromAlarmL(TInt aMinutesToSnooze);
1.68 + IMPORT_C TDesC8& AlarmData() const;
1.69 + IMPORT_C void CmdAcknowledgeAllAlarms();
1.70 +public: // deprecated
1.71 + inline TBool CmdTaskAwayFromAlarm(); // deprecated
1.72 + inline void CmdPauseAlarmSound(TInt aNumMinutes = KEikUseDefaultAlarmSnoozeIncrement); // deprecated
1.73 +public: // internal to Symbian
1.74 + static CEikAlmControlSupervisor* NewLC(MEikServAlarmFactory& aAlarmControlFactory, CEikServAlarmAlertSession* aSession);
1.75 + ~CEikAlmControlSupervisor();
1.76 + void CancelTimeCountDown();
1.77 + void SynchronizeCountDownTimer();
1.78 + void ServiceL(const RMessage2& aMessage);
1.79 + TBool IsVisible() const;
1.80 + TAlarmId AlarmId() const;
1.81 +protected:
1.82 + IMPORT_C virtual void CEikAlmControlSupervisor_Reserved1();
1.83 + IMPORT_C virtual void CEikAlmControlSupervisor_Reserved2();
1.84 +private:
1.85 + CEikAlmControlSupervisor();
1.86 + void ConstructL(MEikServAlarmFactory& aAlarmControl, CEikServAlarmAlertSession* aSession);
1.87 +
1.88 + void StartTimeCountDown();
1.89 + static TInt CallbackSnoozeDecrement(TAny *aAlarmAlert);
1.90 + void DecrementSnoozeMinutes();
1.91 + void SetAlertState(TInt aAlarmServerStateFlags);
1.92 + void StartPlayAlarmL(const RMessage2& aMessage);
1.93 + void StopPlayAlarm();
1.94 +
1.95 + TTime ReturnTimeToSnooze(TInt aMinutesToSnooze);
1.96 + void UpdateAlarmInfoL(const RMessage2& aMessage);
1.97 + void SetVisibility(TBool aVisible);
1.98 +private:
1.99 + CPeriodic* iMinuteCountDown;
1.100 + TInt iPauseSoundMinutes;
1.101 + TTime iPauseSoundDueTime;
1.102 +
1.103 + HBufC8* iAlarmData;
1.104 + TBool iVisible;
1.105 + CEikServAlarmAlertSession* iSession;
1.106 + TAlarmId iAlarmId;
1.107 +
1.108 + MEikServAlarm* iAlarmAlert;
1.109 + };
1.110 +
1.111 +/** Gets the number of minutes remaining in the alarm's snooze period, before
1.112 +the alarm is due to expire again.
1.113 +
1.114 +@return The number of minutes remaining in the alarm's snooze period. */
1.115 +inline TInt CEikAlmControlSupervisor::PauseSoundMinutes() const
1.116 + {
1.117 + return(iPauseSoundMinutes);
1.118 + }
1.119 +
1.120 +/** Gets the end time for the alarm server's quiet period.
1.121 +
1.122 +During a quiet period, any alarms that are due to expire are
1.123 +deferred until the quiet period is over. Not all UIs support
1.124 +this feature.
1.125 +
1.126 +@return The end time for the quiet period (if any). */
1.127 +inline TTime CEikAlmControlSupervisor::QuietPeriodEndTime() const
1.128 + {
1.129 + return(iSession->QuietPeriodEndTime());
1.130 + }
1.131 +
1.132 +/** @deprecated
1.133 +
1.134 +Deprecated in 7.0s. Use CEikAlmControlSupervisor::CmdPauseAlarmSoundL() instead
1.135 +because RMessage::WriteL() could leave. */
1.136 +inline void CEikAlmControlSupervisor::CmdPauseAlarmSound(TInt aNumMinutes)
1.137 + { CmdPauseAlarmSoundL(aNumMinutes); }
1.138 +
1.139 +/** @deprecated
1.140 +
1.141 +Deprecated in 7.0s. Use CEikAlmControlSupervisor::CmdTaskAwayFromAlarmL() instead
1.142 +because RMessage::WriteL() could leave. */
1.143 +inline TBool CEikAlmControlSupervisor::CmdTaskAwayFromAlarm()
1.144 + { return CmdTaskAwayFromAlarmL(); }
1.145 +
1.146 +#endif // __EIKALSUP_H__