commonappservices/alarmserver/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertServer.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 __CONSOLEALARMALERTSERVER_H__
       
    21 #define __CONSOLEALARMALERTSERVER_H__
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 #define __FILELOGGER_ACTIVE // Include logging in release builds
       
    26 #include <test/rfileloggermacro.h>
       
    27 #include <asshdalarm.h>
       
    28 
       
    29 _LIT(KLogFile, "C:\\Logs\\ConsoleAlarmAlertServer\\ConsoleAlarmAlertServer.log");
       
    30 
       
    31 class CConsoleAlarmAlertSession;
       
    32 
       
    33 class CConsoleAlarmAlertServer : public CPolicyServer
       
    34 	{
       
    35 public:
       
    36 	static CConsoleAlarmAlertServer* NewLC();
       
    37 	~CConsoleAlarmAlertServer();
       
    38 
       
    39 public:
       
    40 	inline void								AddResponseArray(TAny* aResponseArray);
       
    41 	void									SetAttachment(HBufC8* aData);
       
    42 	inline HBufC8*							Attachment() const;
       
    43 	inline TAny*							ResponseArray() const;
       
    44 	inline CConsoleAlarmAlertSession*		WaitingSession() const;
       
    45 	inline void								SetWaitingSession(CConsoleAlarmAlertSession* aSession);
       
    46 	inline void								SetNotifying(TBool aIsNotifying);
       
    47 	inline TBool							IsNotifying() const;
       
    48 
       
    49 	inline TBool							IsExtendedMode() const;
       
    50 	inline void								SetExtendedMode(const TBool aMode);
       
    51 	
       
    52 	inline void								SetUserTime(const TTime& aTime);
       
    53 	inline const TTime& 					UserTime() const;
       
    54 	inline void								SetMaxAlarms(const TInt aMaxAlarms);
       
    55 	inline const TInt						MaxAlarms() const;
       
    56 	
       
    57 	inline RMessage2*						NotifyMessage() const;
       
    58 	inline void								SetNotifyMessage(RMessage2* aMessage);
       
    59 	
       
    60 	void									NotifyAlarmObserversL(const TASShdAlarm& aAlarm, const TFullName& aFullName, const TDes8& aData);
       
    61 	void									NotifySoundStartObserversL(const TAlarmId& aId, const TDesC& aFilename);
       
    62 	void									NotifySoundStopObserversL(const TAlarmId& aId);
       
    63 	void									NotifyVisibleObserversL(const TAlarmId& aId, const TBool aVisible);
       
    64 	void									NotifyStateObserversL(const TAlarmId& aId, const TInt aState);
       
    65 	void									NotifyDeleteObserversL(const TAlarmId& aId);
       
    66 
       
    67 	enum TObserverIndex
       
    68 		{
       
    69 		EAlarmObserver,
       
    70 		ESoundStartObserver,
       
    71 		ESoundStopObserver,
       
    72 		EVisibleObserver,
       
    73 		EStateObserver,
       
    74 		EDeleteObserver
       
    75 		};
       
    76 
       
    77 	void									AddObserverL(TObserverIndex aIndex, CConsoleAlarmAlertSession* aObserver);
       
    78 	void									RemoveObserver(TObserverIndex aIndex, CConsoleAlarmAlertSession* aObserver);
       
    79 	
       
    80 	
       
    81 private:
       
    82 	CConsoleAlarmAlertServer();
       
    83 	void									ConstructL();
       
    84 
       
    85 public: // from CServer2
       
    86 	CSession2*								NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
       
    87 
       
    88 private:
       
    89 	TAny*									iInstructionSet;
       
    90 	HBufC8*									iAttachment;
       
    91 	CConsoleAlarmAlertSession*				iWaitingSession;
       
    92 	TBool									iIsNotifying;
       
    93 
       
    94 	TBool									iExtendedMode;
       
    95 	TInt									iMaxAlarms;
       
    96 	TTime									iUserTime;
       
    97 	RMessage2* 								iNotify;
       
    98 		
       
    99 	RPointerArray<CConsoleAlarmAlertSession> iObservers[6];
       
   100 	__FLOG_DECLARATION_MEMBER;
       
   101 	
       
   102 	};
       
   103 
       
   104 #include "ConsoleAlarmAlertServer.inl"
       
   105 
       
   106 #endif