|
1 /* |
|
2 * Copyright (c) 2002-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 ROAP_CONNECTION_H |
|
20 #define ROAP_CONNECTION_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <es_sock.h> |
|
26 #include <CommDbConnPref.h> |
|
27 |
|
28 namespace Roap |
|
29 { |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 class CRoapConnection : public CActive |
|
34 { |
|
35 public: // Constructors and destructor. |
|
36 |
|
37 static CRoapConnection* NewL(); |
|
38 |
|
39 ~CRoapConnection(); |
|
40 |
|
41 public: // new methods |
|
42 |
|
43 void ConnectL |
|
44 ( TUint32 aIap, TRequestStatus* aStatus ); |
|
45 |
|
46 void Close(); |
|
47 |
|
48 TBool IsConnected( TUint32& aIap ); |
|
49 |
|
50 RSocketServ& SocketServ(); |
|
51 |
|
52 RConnection& Conn(); |
|
53 |
|
54 private: |
|
55 |
|
56 enum TState |
|
57 { |
|
58 EInit, |
|
59 EConnecting, |
|
60 EConnected |
|
61 }; |
|
62 |
|
63 private: // Constructors and destructor. |
|
64 |
|
65 CRoapConnection(); |
|
66 |
|
67 void ConstructL(); |
|
68 |
|
69 private: // from CActive |
|
70 |
|
71 virtual void DoCancel(); |
|
72 |
|
73 virtual void RunL(); |
|
74 |
|
75 virtual TInt RunError( TInt aError ); |
|
76 |
|
77 private: // new methods |
|
78 |
|
79 void DoClose(); |
|
80 |
|
81 void Done(); |
|
82 |
|
83 private: // data |
|
84 |
|
85 RSocketServ iSocketServ; |
|
86 RConnection iConnection; |
|
87 TState iState; |
|
88 TRequestStatus* iParentStatus; |
|
89 TCommDbConnPref iConnPref; |
|
90 }; |
|
91 } |
|
92 |
|
93 #endif /* def CONNECTION_H */ |