commonappservices/alarmserver/ConsoleAlarmAlertServer/Include/ConsoleAlarmAlertConsole.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 __CONSOLEALARMALERTCONSOLE_H__
       
    21 #define __CONSOLEALARMALERTCONSOLE_H__
       
    22 
       
    23 // System includes
       
    24 #include <e32base.h>
       
    25 #include <calprogresscallback.h>
       
    26 
       
    27 // User includes
       
    28 #include <asaltdefs.h>
       
    29 
       
    30 // Type definitions
       
    31 
       
    32 // Constants
       
    33 
       
    34 // Classes referenced
       
    35 class CConsoleAlarmAlertSession;
       
    36 
       
    37 // Enumerations
       
    38 
       
    39 //Helper Class
       
    40 // The following class is only needed to allow the establishment of the proper
       
    41 // CalInterimApi classes used to verify that the associated data from an
       
    42 // alarm created through the CalInterimApi is able to find the relevant CCalEntry
       
    43 // for the alarm
       
    44 class CCAASHelperCallBack : public CBase, public MCalProgressCallBack
       
    45 	{
       
    46 	public:
       
    47 	
       
    48 	CCAASHelperCallBack();
       
    49 
       
    50 	/** Progress callback.
       
    51 	
       
    52 	This calls the observing class with the percentage complete of the current operation.
       
    53 	
       
    54 	@param aPercentageCompleted The percentage complete. */
       
    55 	void Progress(TInt aPercentageCompleted);
       
    56 	
       
    57 	/** Completion callback.
       
    58 	
       
    59 	This calls the observing class when the current operation is finished.
       
    60 	
       
    61 	@param aError The error if the operation failed, or KErrNone if successful. */
       
    62 	void Completed(TInt aError);
       
    63 	
       
    64 	/** Asks the observing class whether progress callbacks are required.
       
    65 	
       
    66 	@return If the observing class returns EFalse, then the Progress() function will not be called. */
       
    67 	TBool NotifyProgress();
       
    68 
       
    69 	};
       
    70 
       
    71 ///////////////////////////////////////////////////////////////////////////////////////
       
    72 // ----> CConsoleAlarmAlertConsole (header)
       
    73 ///////////////////////////////////////////////////////////////////////////////////////
       
    74 class CConsoleAlarmAlertConsole : public CActive
       
    75 	{
       
    76 ///////////////////////////////////////////////////////////////////////////////////////
       
    77 public:										// CONSTRUCT / DESTRUCT
       
    78 ///////////////////////////////////////////////////////////////////////////////////////
       
    79 	CConsoleAlarmAlertConsole(CConsoleAlarmAlertSession& aSession);
       
    80 	~CConsoleAlarmAlertConsole();
       
    81 
       
    82 ///////////////////////////////////////////////////////////////////////////////////////
       
    83 public:										// ACCESS
       
    84 ///////////////////////////////////////////////////////////////////////////////////////
       
    85 	void									GetKey();
       
    86 	void									CancelKey();
       
    87 	void									DecCounterL();
       
    88 	void									UpdateDisplayL();
       
    89 	TInt									GetTimeInterval() const;
       
    90 	void									SetVisibilityL(TInt aVis);
       
    91 	void									SetAlertStateL(TInt aFlags);
       
    92 
       
    93 ///////////////////////////////////////////////////////////////////////////////////////
       
    94 protected:									// FROM CActive
       
    95 ///////////////////////////////////////////////////////////////////////////////////////
       
    96 	void									RunL();
       
    97 	void									DoCancel();
       
    98 
       
    99 ///////////////////////////////////////////////////////////////////////////////////////
       
   100 protected:									// INTERNAL METHODS
       
   101 ///////////////////////////////////////////////////////////////////////////////////////
       
   102 	void									Hide();
       
   103 	void									CreateWinL();
       
   104 	void									DoDeferTime(TASAltAlertServerResponse aResponse);
       
   105 
       
   106 	static TBool							CountDownCallBackL(TAny* aSelf);
       
   107 
       
   108 ///////////////////////////////////////////////////////////////////////////////////////
       
   109 private:									// MEMBER DATA
       
   110 ///////////////////////////////////////////////////////////////////////////////////////
       
   111 
       
   112 	TInt									iAlertState;
       
   113 
       
   114 	TInt									iTimeInterval;
       
   115 
       
   116 	CPeriodic*								iCountDown;
       
   117 
       
   118 	CConsoleBase*							iWin;
       
   119 
       
   120 	CConsoleAlarmAlertSession&				iSession;
       
   121 
       
   122 	friend class							CConsoleAlarmAlertSession;
       
   123 
       
   124 	TInt									iInstructionIndex;
       
   125 	};
       
   126 
       
   127 #endif