|
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_INQUIRY_SOCKADDR__DATA_H__) |
|
20 #define __T_INQUIRY_SOCKADDR__DATA_H__ |
|
21 |
|
22 // User Includes |
|
23 #include "DataWrapperBase.h" |
|
24 |
|
25 // Classes to get to protected members |
|
26 #include "T_InquirySockAddrChild.h" |
|
27 |
|
28 // EPOC includes |
|
29 #include <bt_sock.h> |
|
30 #include <es_sock.h> |
|
31 |
|
32 /** |
|
33 * Test Socket address class used for inquiries |
|
34 * |
|
35 */ |
|
36 class CT_InquirySockAddrData : public CDataWrapperBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Public destructor |
|
41 */ |
|
42 ~CT_InquirySockAddrData(); |
|
43 |
|
44 /** |
|
45 * Two phase constructor |
|
46 */ |
|
47 static CT_InquirySockAddrData* NewL(); |
|
48 |
|
49 /** |
|
50 * Process a command read from the ini file |
|
51 * |
|
52 * @param aCommand The command to process |
|
53 * @param aSection The section in the ini containing data for the command |
|
54 * @param aAsyncErrorIndex Command index for async calls to return errors to |
|
55 * |
|
56 * @return ETrue if the command is processed |
|
57 * |
|
58 * @leave System wide error |
|
59 */ |
|
60 virtual TBool DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex); |
|
61 |
|
62 /** |
|
63 * Return a pointer to the object that the data wraps |
|
64 * |
|
65 * @return pointer to the object that the data wraps |
|
66 */ |
|
67 virtual TAny* GetObject(); |
|
68 |
|
69 /** |
|
70 * Set the object that the data wraps |
|
71 * |
|
72 * @param aObject object that the wrapper is testing |
|
73 * |
|
74 * @leave KErrNotSupported if the the function is not supported |
|
75 */ |
|
76 virtual void SetObjectL(TAny* aObject); |
|
77 |
|
78 /** |
|
79 * The object will no longer be owned by this |
|
80 * |
|
81 * @leave KErrNotSupported if the the function is not supported |
|
82 */ |
|
83 virtual void DisownObjectL(); |
|
84 |
|
85 inline virtual TCleanupOperation CleanupOperation(); |
|
86 |
|
87 protected: |
|
88 CT_InquirySockAddrData(); |
|
89 void ConstructL(); |
|
90 |
|
91 private: |
|
92 void DestroyData(); |
|
93 |
|
94 inline void DoCmdTInquirySockAddr(const TDesC& aSection); |
|
95 inline void DoCmdBTAddr(const TDesC& aSection); |
|
96 inline void DoCmdSetBTAddr(const TDesC& aSection); |
|
97 inline void DoCmdCast(const TDesC& aSection); |
|
98 inline void DoCmdMajorServiceClass(const TDesC& aSection); |
|
99 inline void DoCmdSetMajorServiceClass(const TDesC& aSection); |
|
100 inline void DoCmdMajorClassOfDevice(const TDesC& aSection); |
|
101 inline void DoCmdSetMajorClassOfDevice(const TDesC& aSection); |
|
102 inline void DoCmdMinorClassOfDevice(const TDesC& aSection); |
|
103 inline void DoCmdSetMinorClassOfDevice(const TDesC& aSection); |
|
104 inline void DoCmdIAC(const TDesC& aSection); |
|
105 inline void DoCmdSetIAC(const TDesC& aSection); |
|
106 inline void DoCmdAction(const TDesC& aSection); |
|
107 inline void DoCmdSetAction(const TDesC& aSection); |
|
108 inline void DoCmdVersion(const TDesC& aSection); |
|
109 inline void DoCmdPROTECTEDFormatTypeField(const TDesC& aSection); |
|
110 |
|
111 //RHostResolver |
|
112 inline void DoCmdOpenHostResolver(const TDesC& aSection); |
|
113 inline void DoCmdGetByAddress(const TDesC& aSection, const TInt aAsyncErrorIndex); |
|
114 inline void DoCmdSetHostName(const TDesC& aSection); |
|
115 inline void SetDiscoverable(const TDesC& aSection); |
|
116 |
|
117 static void CleanupOperation(TAny* aAny); |
|
118 |
|
119 virtual void RunL(CActive* aActive, TInt aIndex); |
|
120 virtual void DoCancel(CActive* aActive, TInt aIndex); |
|
121 inline void RunGetDeviceAddress(TInt aIndex); |
|
122 inline void DoCancelGetDeviceAddress(); |
|
123 |
|
124 private: |
|
125 T_InquirySockAddrChild* iData; |
|
126 TBool iTInquirySockAddrOwned; |
|
127 TInquirySockAddr iSockAddr; |
|
128 TBTDevAddr* iBTDevAddr; |
|
129 |
|
130 //RHostResolver |
|
131 CActiveCallback* iActive; |
|
132 RHostResolver iHostResolver; |
|
133 TBool iHostResolverOpen; |
|
134 TNameEntry iBtNameEntry; |
|
135 TPtrC iDeviceName; |
|
136 }; |
|
137 |
|
138 #endif /* __T_INQUIRY_SOCKADDR__DATA_H__ */ |