commonappservices/alarmserver/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertSession.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /**
       
     2 * Copyright (c) 1999-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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CONSOLEALARMALERTSESSION_H__
       
    21 #define __CONSOLEALARMALERTSESSION_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #define __FILELOGGER_ACTIVE // Include logging in release builds
       
    26 #include <test/rfileloggermacro.h>
       
    27 
       
    28 #include <asaltdefs.h>
       
    29 #include <asshdalarm.h>
       
    30 
       
    31 class CConsoleAlarmAlertConsole;
       
    32 class CConsoleAlarmAlertLEDFlasher;
       
    33 class CConsoleAlarmAlertServer;
       
    34 
       
    35 struct TAgnAlarmInfo
       
    36  	/**
       
    37  	Copy of System-Wide Unique Agenda Entry Reference defined in agmalarm.h
       
    38  	*/
       
    39   	{
       
    40 	TUid iAlarmCategory;
       
    41 	TUint32 iAgnUniqueId_AgnId;
       
    42 	TInt64  iAgnUniqueId_AgnInstanceTime;
       
    43 	TUint16 iAgnUniqueId_AgnInstanceFiller;
       
    44 	TInt    iAgnUniqueId_AgnInstanceConstrError;
       
    45 	TFileName iFileName;
       
    46 	};
       
    47 
       
    48 class CConsoleAlarmAlertSession : public CSession2
       
    49 	{
       
    50 public:
       
    51 	static CConsoleAlarmAlertSession* NewL(CConsoleAlarmAlertServer* aServer);
       
    52 	~CConsoleAlarmAlertSession();
       
    53 
       
    54 private:
       
    55 	CConsoleAlarmAlertSession(CConsoleAlarmAlertServer* aServer);
       
    56 	void ConstructL();
       
    57 
       
    58 public:
       
    59 	TTime									DeferTime() const;
       
    60 	inline const TASShdAlarm& 				Alarm() const { return iAlarm; }
       
    61 	inline TInt								AlarmDataSize() const { return iAlarmAssociatedDataSize; }
       
    62 	inline const TAgnAlarmInfo&				AlarmData() const { return iAlarmData; }
       
    63 	void									Notify(TASAltAlertServerResponse aFlag);
       
    64 	void									Notify(TASAltAlertServerResponse aFlag, const TTime& aDeferTime);
       
    65 	TAny *									InstructionSet();
       
    66 
       
    67 public: // Observers
       
    68 	void NotifyAlarmL(const TASShdAlarm& aAlarm, const TFullName& aFullName, const TDes8& aData);
       
    69 	void NotifySoundStartL(const TAlarmId& aId, const TDesC& aFilename);
       
    70 	void NotifySoundStopL(const TAlarmId& aId);
       
    71 	void NotifyVisibleL(const TAlarmId& aId, const TBool aVisible);
       
    72 	void NotifyStateL(const TAlarmId& aId, const TInt aState);
       
    73 	void NotifyDeleteL(const TAlarmId& aId);
       
    74 
       
    75 private: // from CSession2
       
    76 	TBool									CmdL();
       
    77 	void									ServiceL(const RMessage2& aMessage);
       
    78 	void 									ServiceError(const RMessage2 &aMessage, TInt aError);
       
    79 
       
    80 private:
       
    81 	void									SetAlarmL(const RMessage2& aMessage);
       
    82 	void									GetUserTimeL(const RMessage2& aMessage);
       
    83 	void									SetDeferTimeL(const RMessage2& aMessage);
       
    84 	TBool									MultiDispatchL(const RMessage2& aMessage);
       
    85 	void									CmdSetUserTimeL(const RMessage2& aMessage);
       
    86 	void									CmdSetMaxAlarmsL(const RMessage2& aMessage);
       
    87 	void									CmdNotifyOnAlarmL(const RMessage2& aMessage);
       
    88 	void									CmdNotifyOnSoundStartL(const RMessage2& aMessage);
       
    89 	void									CmdNotifyOnSoundStopL(const RMessage2& aMessage);
       
    90 	void									CmdNotifyOnVisibleL(const RMessage2& aMessage);
       
    91 	void									CmdNotifyOnStateL(const RMessage2& aMessage);
       
    92 	void									CmdResponseSnoozeAlarmL(const RMessage2& aMessage);
       
    93 	void									CmdResponseSilenceAlarmL(const RMessage2& aMessage);
       
    94 	void									CmdResponseAcknowledgeAlarmL(const RMessage2& aMessage);
       
    95 	void									CmdResponsePauseSoundL(const RMessage2& aMessage);
       
    96 	void 									CmdSetAlarmL(const RMessage2& aMessage);
       
    97 	void									CmdSetStateL(const RMessage2& aMessage);
       
    98 	void									CmdVisibleL(const RMessage2& aMessage);
       
    99 	void									CmdStartPlayingSoundL(const RMessage2& aMessage);
       
   100 	void									CmdStopPlayingSoundL(const RMessage2& aMessage);
       
   101 	void 									CmdSetDeferTimeL(const RMessage2& aMessage);
       
   102 	void									CmdGetUserTimeL(const RMessage2& aMessage);
       
   103 	void									CancelNotifications();
       
   104 	void 									CmdResponseAcknowledgeAll();
       
   105 	void 									CmdGetMaxAlarmsL(const RMessage2& aMessage);
       
   106 	void									CmdNotifyOnDeleteL(const RMessage2& aMessage);
       
   107 	void									CmdDeleteAlarmL(const RMessage2& aMessage);
       
   108 	static TBool							SoundPlaybackCallbackL(TAny* aSelf);
       
   109 
       
   110 private:
       
   111 	TTime									iDeferTime;
       
   112 	TASShdAlarm								iAlarm;
       
   113 	TInt									iAlarmAssociatedDataSize;
       
   114 	TAgnAlarmInfo							iAlarmData;
       
   115 	TBool									iLoggedOn;
       
   116 	TBool									iHasMessage;
       
   117 	TBool									iMsgComplete;
       
   118 	RMessage2								iMsgPtr;
       
   119 	CPeriodic*								iSoundCallbackTimer;
       
   120 	CConsoleAlarmAlertLEDFlasher*			iSoundLEDFlasher;
       
   121 	CConsoleAlarmAlertConsole*				iConsole;
       
   122 	CConsoleAlarmAlertServer*				iServer;
       
   123 	TAny*									iInstructionSet;
       
   124 	TBool									iInstructionSetFound;
       
   125 	RMessage2								iAlarmNotify;
       
   126 	RMessage2								iSoundStartNotify;
       
   127 	RMessage2								iSoundStopNotify;
       
   128 	RMessage2								iVisibleNotify;
       
   129 	RMessage2								iStateNotify;
       
   130 	RMessage2								iDeleteNotify;
       
   131 	__FLOG_DECLARATION_MEMBER;
       
   132 	};
       
   133 
       
   134 #endif