|
1 /* |
|
2 * Copyright (c) 2005-2009 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 #if (!defined __T_RSOCKET_DATA_H__) |
|
20 #define __T_RSOCKET_DATA_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "DataWrapperBase.h" |
|
24 |
|
25 // EPOC includes |
|
26 #include <w32std.h> |
|
27 #include <e32std.h> |
|
28 #include <es_sock.h> // TSockAddr address |
|
29 #include <bt_sock.h> // Bluetooth address classes |
|
30 |
|
31 |
|
32 class CT_RSocketData: public CDataWrapperBase |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Two phase constructor |
|
37 */ |
|
38 static CT_RSocketData* NewL(); |
|
39 |
|
40 /** |
|
41 * Process a command read from the ini file |
|
42 * |
|
43 * @param aCommand The command to process |
|
44 * @param aSection The section in the ini containing data for the command |
|
45 * @param aAsyncErrorIndex Command index for async calls to return errors to |
|
46 * |
|
47 * @return ETrue if the command is processed |
|
48 * |
|
49 * @leave System wide error |
|
50 */ |
|
51 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CT_RSocketData(); |
|
57 |
|
58 protected: |
|
59 /** |
|
60 * Protected constructor. First phase construction |
|
61 */ |
|
62 CT_RSocketData(); |
|
63 |
|
64 /** |
|
65 * Return a pointer to the object that the data wraps |
|
66 * |
|
67 * \return pointer to the object that the data wraps |
|
68 */ |
|
69 virtual TAny* GetObject(); |
|
70 |
|
71 private: |
|
72 void CloseSocketServer(); |
|
73 |
|
74 void RSocketOpen(const TDesC& aSection); |
|
75 void Info(const TDesC& aSection); |
|
76 |
|
77 private: |
|
78 |
|
79 // An object of TSockAddr class in order to retain state between calls |
|
80 RSocket iRSocket; |
|
81 RSocketServ iSocketServer; |
|
82 }; |
|
83 |
|
84 #endif /* __T_RSOCKET_DATA_H__ */ |