internetradio2.0/uiinc/iralarmobserver.h
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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 #ifndef IRALARMOBSERVER_H
       
    20 #define IRALARMOBSERVER_H
       
    21 
       
    22 #include <asclisession.h>
       
    23 //d #include <e32property.h>
       
    24 
       
    25 class CIRUi;
       
    26  
       
    27 	
       
    28 /**
       
    29  * This is the alarm observer class is used for alarm observing
       
    30  * When alarm is comes or made it calls HandleAlarmStart which does the call handling
       
    31  * When call is disconnected it calls HandleAlarmEnd to handle the scenerio
       
    32  *
       
    33  * @code
       
    34  * 
       
    35  * CIRAlarmObserver* obj
       
    36  * obj = CIRAlarmObserver::NewL(instance of CIRUi* aUi); //creating call observer
       
    37  * obj->Start();//starting the observer
       
    38  *
       
    39  * @endcode
       
    40  * 
       
    41  */
       
    42 
       
    43 NONSHARABLE_CLASS(CIRAlarmObserver) : public CActive
       
    44 	{
       
    45 								//member functions
       
    46 public:
       
    47 
       
    48 	/**
       
    49 	 * Function : NewL
       
    50 	 * Function returns an instance of CIRAlarmObserver
       
    51 	 * Two phase constructor
       
    52 	 * @param CIRUi instance
       
    53 	 * @return instance of CIRAlarmObserver
       
    54 	 */
       
    55 	static CIRAlarmObserver* NewL(CIRUi* aUi);
       
    56 	
       
    57 	/**
       
    58 	 * Function : NewLC
       
    59 	 * Function returns an instance of CIRAlarmObserver
       
    60 	 * Two phase constructor
       
    61 	 * @param CIRUi instance
       
    62 	 * @return instance of CIRAlarmObserver
       
    63 	 */
       
    64 	static CIRAlarmObserver* NewLC(CIRUi* aUi);
       
    65 
       
    66 	/**
       
    67 	 * Function : ~CIRAlarmObserver
       
    68 	 * Default destructor calls Cancel function which cancel the active request 
       
    69 	 */
       
    70 	~CIRAlarmObserver();
       
    71 	
       
    72 	/**
       
    73 	 * Function : Start
       
    74 	 * Function starts the call observer
       
    75 	 */
       
    76 	void Start();
       
    77 	
       
    78 	/**
       
    79 	 * Function : RunL
       
    80 	 * This is the RunL function if a call is recieved or disconnected when the player 
       
    81 	 *	is active, is handled here
       
    82 	 */	
       
    83 	void RunL();
       
    84 	
       
    85 	/**
       
    86 	 * Function : DoCancel
       
    87 	 * Function stops the call observer if it is active
       
    88 	 */
       
    89 	void DoCancel();
       
    90 	
       
    91 	/**
       
    92 	 * Function : RunError
       
    93 	 * Function which handles RunL error
       
    94 	 * @param Error value 
       
    95 	 */
       
    96 	TInt RunError(TInt aError);
       
    97 
       
    98 private:	
       
    99 	/**
       
   100 	 * Function : ConstructL
       
   101 	 * Function does all the initializations
       
   102 	 * Two phase constructor
       
   103 	 * @param CIRNowPlayingView instance
       
   104 	 */
       
   105 	void ConstructL(CIRUi* aUi);
       
   106 	
       
   107 	/**
       
   108 	 * Function : CIRAlarmObserver
       
   109 	 * Function is the default constructor, sets the CActive priority, Line status
       
   110 	 */
       
   111 	CIRAlarmObserver();
       
   112 
       
   113 							//data member declaration
       
   114 private:
       
   115 	
       
   116 	//The client-side interface to the Symbian OS alarm server
       
   117 	RASCliSession iAlarmSession;
       
   118 	
       
   119 	//Alarm id
       
   120 	TAlarmId iAlarmId;
       
   121 	
       
   122 	//instance of Now Playing View 
       
   123 	CIRUi* iUi;
       
   124 	
       
   125 	//Checks whether alarm is on or off
       
   126 	TBool iAlarmOn;
       
   127 	};
       
   128 	
       
   129 #endif	//IRALARMOBSERVER_H
       
   130