sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @test sl@0: */ sl@0: sl@0: #ifndef MSGAPP_H_ sl@0: #define MSGAPP_H_ sl@0: sl@0: #include sl@0: #include sl@0: #include "tmsgclient.h" sl@0: sl@0: // Utility interface for classes that require a callback after a given timeout sl@0: class MAlarmObserver sl@0: { sl@0: public: sl@0: virtual void WakeupL() = 0; sl@0: }; sl@0: sl@0: // Utility class that invokes a call back after a given timeout sl@0: class CAlarm : public CTimer sl@0: { sl@0: public: sl@0: inline CAlarm(); sl@0: inline void ConstructL(); sl@0: void After(MAlarmObserver* aObserver, TTimeIntervalMicroSeconds32 anInterval); sl@0: private: sl@0: void RunL(); sl@0: MAlarmObserver* iObserver; sl@0: }; sl@0: sl@0: /** sl@0: * Sends a series of test messages to trigger user prompting. sl@0: */ sl@0: class CSendMessages : public CActive, public MAlarmObserver sl@0: { sl@0: public: sl@0: static CSendMessages* NewLC(); sl@0: void WakeupL(); sl@0: ~CSendMessages(); sl@0: sl@0: private: sl@0: CSendMessages(); sl@0: void ConstructL(); sl@0: sl@0: // From CActive sl@0: void DoCancel(); sl@0: TInt RunError(TInt aError); sl@0: void RunL(); sl@0: sl@0: private: sl@0: static const TInt KDefaultTimeout = 10 * 1000 * 1000; sl@0: TInt iTestNum; sl@0: RMsgSession iMsgCon; sl@0: CAlarm iAlarm; sl@0: }; sl@0: sl@0: sl@0: #endif /*MSGAPP_H_*/