24
|
1 |
// Copyright (c) 2007-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 |
#ifndef RMOCKSY_H
|
|
17 |
#define RMOCKSY_H
|
|
18 |
|
|
19 |
#include <e32def.h>
|
|
20 |
#include <e32base.h>
|
|
21 |
|
|
22 |
/**
|
|
23 |
Base class for a Mock SY session
|
|
24 |
Must be sub-class for specific types of SY and implement specific Expect and Complete
|
|
25 |
public methods
|
|
26 |
|
|
27 |
*/
|
|
28 |
class RMockSY : public RSessionBase
|
|
29 |
{
|
|
30 |
public:
|
|
31 |
enum TMessage
|
|
32 |
{
|
|
33 |
KExpect =1,
|
|
34 |
KComplete,
|
|
35 |
KNotifyTerminated,
|
|
36 |
KGetNextLogLine,
|
|
37 |
KGetStatus,
|
|
38 |
KPause,
|
|
39 |
KResume
|
|
40 |
};
|
|
41 |
|
|
42 |
IMPORT_C TInt Connect();
|
|
43 |
IMPORT_C void NotifyTerminated(TRequestStatus& aStatus);
|
|
44 |
IMPORT_C void GetNextLogLine(TDes& aLine);
|
|
45 |
IMPORT_C void GetStatus(TBool& aHasWaitingExpect, TBool& aHasPendingComplete,TBool& aHasError);
|
|
46 |
IMPORT_C TInt PauseCompletion();
|
|
47 |
IMPORT_C TInt ResumeCompletion();
|
|
48 |
|
|
49 |
protected:
|
|
50 |
virtual const TDesC& ServerName() =0;
|
|
51 |
|
|
52 |
protected:
|
|
53 |
IMPORT_C void DoExpect(TInt aCmdId, TInt aErrorCode, TBool aLeave, const TDesC8& aData);
|
|
54 |
IMPORT_C void DoComplete(TInt aCmdId, TInt aErrorCode, TInt aDelay, const TDesC8& aData);
|
|
55 |
|
|
56 |
};
|
|
57 |
#endif
|