0
|
1 |
/*
|
|
2 |
* Copyright (c) 2004 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 __TRKENGINE_H__
|
|
20 |
#define __TRKENGINE_H__
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include "TrkEngineCallback.h"
|
|
24 |
#include "TrkConnectionListener.h"
|
|
25 |
#include "TrkCommPortListener.h"
|
|
26 |
#include "TrkConnData.h"
|
|
27 |
#include "TrkCommPort.h"
|
|
28 |
//
|
|
29 |
// Forward declarations
|
|
30 |
//
|
|
31 |
class CTrkFramingLayer;
|
|
32 |
class CTrkDispatchLayer;
|
|
33 |
class CTrkCommPort;
|
|
34 |
class CTrkEngineModel;
|
|
35 |
class TTrkConnData;
|
|
36 |
|
|
37 |
|
|
38 |
//
|
|
39 |
// class CTrkEngine
|
|
40 |
//
|
|
41 |
// Provides the interface to the Trk engine
|
|
42 |
//
|
|
43 |
class CTrkEngine : public CBase, public MTrkConnectionListener
|
|
44 |
{
|
|
45 |
public:
|
|
46 |
|
|
47 |
IMPORT_C static CTrkEngine* NewL();
|
|
48 |
IMPORT_C static CTrkEngine* NewLC();
|
|
49 |
IMPORT_C static CTrkEngine* NewL(MTrkEngineCallback* aCallback);
|
|
50 |
IMPORT_C static CTrkEngine* NewLC(MTrkEngineCallback* aCallback);
|
|
51 |
|
|
52 |
IMPORT_C ~CTrkEngine();
|
|
53 |
|
|
54 |
IMPORT_C void StartL();
|
|
55 |
IMPORT_C void StartL(TTrkConnType aConnType);
|
|
56 |
IMPORT_C void Stop();
|
|
57 |
IMPORT_C void GetVersionInfo(TInt &aMajorVersion, TInt &aMinorVersion, TInt &aMajorAPIVersion, TInt &aMinorAPIVersion, TInt &aBuildNumber);
|
|
58 |
IMPORT_C void GetConnectionInfo(TDes& aMessage);
|
|
59 |
IMPORT_C void GetErrorInfo(TDes& aMessage);
|
|
60 |
IMPORT_C TTrkConnStatus GetConnectionStatus();
|
|
61 |
|
|
62 |
IMPORT_C void GetConnectionData(TTrkConnData& aConnData);
|
|
63 |
IMPORT_C TInt SetConnectionData(TTrkConnData& aConnData);
|
|
64 |
IMPORT_C TBool IsDebugging();
|
|
65 |
IMPORT_C TTrkConnType GetConnectionType();
|
|
66 |
IMPORT_C TBool GetPlugPlaySetting();
|
|
67 |
|
|
68 |
public:
|
|
69 |
// From MTrkConnectionListener
|
|
70 |
void AsyncConnectionSuccessfulL();
|
|
71 |
void AsyncConnectionFailed();
|
|
72 |
|
|
73 |
public:
|
|
74 |
// call backs to dispatch layer
|
|
75 |
void DebuggingStarted();
|
|
76 |
void DebuggingEnded();
|
|
77 |
|
|
78 |
|
|
79 |
private:
|
|
80 |
|
|
81 |
private:
|
|
82 |
CTrkEngine();
|
|
83 |
void DoStartL();
|
|
84 |
void CreateCommInterfaceL();
|
|
85 |
void ConstructL(MTrkEngineCallback* aCallback=NULL);
|
|
86 |
void StartInactivityTimerDisabler();
|
|
87 |
|
|
88 |
private:
|
|
89 |
|
|
90 |
CTrkCommPort* iCommPort;
|
|
91 |
CTrkDispatchLayer* iDispatchLayer;
|
|
92 |
CTrkEngineModel* iModel;
|
|
93 |
TBuf<KMaxPath> iErrorMessage;
|
|
94 |
|
|
95 |
CTrkCommPortListener* iCommPortListener;
|
|
96 |
CInactivityTimerDisabler *iInactivityTimerDisabler;
|
|
97 |
MTrkEngineCallback* iCallback;
|
|
98 |
|
|
99 |
TTrkConnData iCurrentConnData;
|
|
100 |
TTrkConnType iCurrentConnType;
|
|
101 |
};
|
|
102 |
|
|
103 |
|
|
104 |
#endif // __TRKENGINE_H__
|
|
105 |
|