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