os/security/authorisation/userpromptservice/examples/integration/tmsgapp/tmsgapp.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/examples/integration/tmsgapp/tmsgapp.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,78 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @internalComponent
1.25 + @test
1.26 +*/
1.27 +
1.28 +#ifndef MSGAPP_H_
1.29 +#define MSGAPP_H_
1.30 +
1.31 +#include <e32base.h>
1.32 +#include <e32cmn.h>
1.33 +#include "tmsgclient.h"
1.34 +
1.35 +// Utility interface for classes that require a callback after a given timeout
1.36 +class MAlarmObserver
1.37 +{
1.38 +public:
1.39 + virtual void WakeupL() = 0;
1.40 +};
1.41 +
1.42 +// Utility class that invokes a call back after a given timeout
1.43 +class CAlarm : public CTimer
1.44 + {
1.45 +public:
1.46 + inline CAlarm();
1.47 + inline void ConstructL();
1.48 + void After(MAlarmObserver* aObserver, TTimeIntervalMicroSeconds32 anInterval);
1.49 +private:
1.50 + void RunL();
1.51 + MAlarmObserver* iObserver;
1.52 + };
1.53 +
1.54 +/**
1.55 + * Sends a series of test messages to trigger user prompting.
1.56 + */
1.57 +class CSendMessages : public CActive, public MAlarmObserver
1.58 + {
1.59 +public:
1.60 + static CSendMessages* NewLC();
1.61 + void WakeupL();
1.62 + ~CSendMessages();
1.63 +
1.64 +private:
1.65 + CSendMessages();
1.66 + void ConstructL();
1.67 +
1.68 + // From CActive
1.69 + void DoCancel();
1.70 + TInt RunError(TInt aError);
1.71 + void RunL();
1.72 +
1.73 +private:
1.74 + static const TInt KDefaultTimeout = 10 * 1000 * 1000;
1.75 + TInt iTestNum;
1.76 + RMsgSession iMsgCon;
1.77 + CAlarm iAlarm;
1.78 + };
1.79 +
1.80 +
1.81 +#endif /*MSGAPP_H_*/