commonuisupport/uikon/test/tmultiplealarm/TRemoteFactory.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code
       
    19 */
       
    20 
       
    21 #ifndef __TRemoteFactory_h
       
    22 #define __TRemoteFactory_h
       
    23 
       
    24 #include <uikon/eiksvfty.h>
       
    25 #include <e32msgqueue.h>
       
    26 #include <asshdalarm.h>
       
    27 #include <uikon/eiknotifyalert.h>
       
    28 #include "TRemoteControl.h"
       
    29 
       
    30 class CEikServAlarmAlertServer;
       
    31 
       
    32 class CTRemoteFactory : public MEikServAlarmFactory
       
    33 {
       
    34 public:
       
    35 	static CTRemoteFactory* NewL(); 
       
    36 	~CTRemoteFactory();
       
    37 	
       
    38 	// MEikServAlarmFactory
       
    39 	MEikServAlarm* NewAlarmL(CEikAlmControlSupervisor& aSupervisor);
       
    40 
       
    41 	// Message queue stuff
       
    42 	TInt ReadInt();
       
    43 	TBool ReadBool();
       
    44 	void SendInt(const TInt aValue);
       
    45 	void SendData(const TDesC8& aData);
       
    46 	
       
    47 	TInt MaxAlarms() const
       
    48 		{
       
    49 		return iMaxAlarms;
       
    50 		}
       
    51 		
       
    52 	void SetServer(CEikServAlarmAlertServer* aServer) 
       
    53 		{
       
    54 		iServer = aServer;
       
    55 		}
       
    56 		
       
    57 	CEikServAlarmAlertServer* Server() const
       
    58 		{
       
    59 		return iServer;
       
    60 		}
       
    61 		
       
    62 	TBool Response() const
       
    63 		{
       
    64 		return iResponse;
       
    65 		}
       
    66 		
       
    67 	TAlarmId ResponseId() const
       
    68 		{
       
    69 		return iId;
       
    70 		}
       
    71 		
       
    72 	TInt ResponseCode() const
       
    73 		{
       
    74 		return iResponseCode;
       
    75 		}
       
    76 		
       
    77 	const TTime& QuietPeriod() const
       
    78 		{
       
    79 		return iQuietPeriod;
       
    80 		}
       
    81 		
       
    82 	TInt SnoozeTime() const
       
    83 		{
       
    84 		return iSnoozeTime;
       
    85 		}
       
    86 		
       
    87 	TBool UpdateSnooze() const
       
    88 		{
       
    89 		return iUpdateSnooze;	
       
    90 		}
       
    91 	
       
    92 private:
       
    93 	CTRemoteFactory();
       
    94 	void ConstructL();
       
    95 
       
    96 private:
       
    97 	TInt iMaxAlarms;
       
    98 	TBool iResponse;
       
    99 	TAlarmId iId;
       
   100 	TInt iResponseCode;
       
   101 	RMsgQueue<TRemoteMsg> iMsgQ;
       
   102 	CEikServAlarmAlertServer* iServer;
       
   103 	TInt iCount;
       
   104 	TTime iQuietPeriod;
       
   105 	TInt iSnoozeTime;
       
   106 	TBool iUpdateSnooze;
       
   107 	TInt iState;
       
   108 	};
       
   109 	
       
   110 class CTRemoteAlarm : public MEikServAlarm
       
   111 	{
       
   112 public:
       
   113 	static CTRemoteAlarm* NewL(CEikAlmControlSupervisor& aSupervisor, CTRemoteFactory* aFactory, TInt aState); 
       
   114 	~CTRemoteAlarm();
       
   115 	
       
   116 	// MEikServAlarm
       
   117 	void Release();
       
   118 	void ShowAlarm();
       
   119 	void HideAlarm();
       
   120 	TInt CurrentServerState() const;
       
   121 	void UpdateSoundPauseTimeInterval(TInt aMinutes);
       
   122 	void UpdateForAlarmServerState(TInt aNewAlarmServerState);
       
   123 	void UpdateAlarmInfo(const TASShdAlarm& aAlarm,const TFullName& aOwner);
       
   124 	void StartPlayAlarmL(const TDesC& aAlarmName);
       
   125 	void StopPlayAlarm();
       
   126 
       
   127 private:
       
   128 	CTRemoteAlarm(CEikAlmControlSupervisor& aSupervisor, CTRemoteFactory* aFactory, TInt aState);
       
   129 
       
   130 private:
       
   131 	CEikAlmControlSupervisor& iSupervisor;
       
   132 	CTRemoteFactory* iFactory;
       
   133 	TAlarmId iAlarmId;
       
   134 	TInt iState;
       
   135 	};
       
   136 
       
   137 
       
   138 #endif // __TRemoteFactory_h
       
   139