|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef BTEXTNOTIFIERS_H |
|
17 #define BTEXTNOTIFIERS_H |
|
18 |
|
19 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
20 #include <btextnotifierspartner.h> |
|
21 #endif |
|
22 |
|
23 #include <btextnotifiersconsts.h> |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <bttypes.h> |
|
27 #include <btdevice.h> |
|
28 |
|
29 #define NOTIFIERS_SUPPORT_PASSKEY_MIN_LENGTH |
|
30 |
|
31 /** |
|
32 @file |
|
33 @publishedAll |
|
34 @released |
|
35 **/ |
|
36 |
|
37 NONSHARABLE_CLASS(TBTDeviceSelectionParams) |
|
38 /** |
|
39 @publishedAll |
|
40 @released |
|
41 |
|
42 Class to allow parameters to be sent to the device selection dialog via the RNotifier API. |
|
43 **/ |
|
44 { |
|
45 public: |
|
46 IMPORT_C TBTDeviceSelectionParams(); |
|
47 IMPORT_C void SetUUID(const TUUID& aUUID); |
|
48 IMPORT_C void SetDeviceClass(TBTDeviceClass aClass); |
|
49 IMPORT_C const TUUID& UUID(); |
|
50 IMPORT_C TBTDeviceClass DeviceClass(); |
|
51 IMPORT_C TBool IsValidDeviceClass(); |
|
52 IMPORT_C TBool IsValidUUID(); |
|
53 private: |
|
54 TBTDeviceClass iDeviceClass; /*!< The device class */ |
|
55 TUUID iSdpUuid; /*!< The sdp uuid */ |
|
56 TBool iValidDeviceClass; /*!< ETrue if iDeviceClass has been set, EFalse if not */ |
|
57 TBool iValidUuid; /*!< ETrue if iSdpUuid has be set, EFalse if not */ |
|
58 |
|
59 // This data padding has been added to help prevent future binary compatibility breaks |
|
60 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used |
|
61 TUint32 iPadding1; |
|
62 TUint32 iPadding2; |
|
63 }; |
|
64 |
|
65 NONSHARABLE_CLASS(TBTDeviceResponseParams) |
|
66 /** |
|
67 @publishedAll |
|
68 @released |
|
69 |
|
70 Class to allow parameters to be received from the device selection dialog via the RNotifier API. |
|
71 **/ |
|
72 { |
|
73 public: |
|
74 IMPORT_C TBTDeviceResponseParams(); |
|
75 IMPORT_C void SetDeviceAddress(const TBTDevAddr& aBDAddr); //< Set the address of the device |
|
76 IMPORT_C void SetDeviceName(const TDesC& aName); //< Set the name of the device |
|
77 IMPORT_C void SetDeviceClass(TBTDeviceClass aClass); |
|
78 IMPORT_C const TBTDevAddr& BDAddr() const; //< Returns the address of the device |
|
79 IMPORT_C const TDesC& DeviceName() const; //< Returns the name of the device |
|
80 IMPORT_C TBTDeviceClass DeviceClass(); |
|
81 IMPORT_C TBool IsValidBDAddr() const; //< Has the address of the device been set? |
|
82 IMPORT_C TBool IsValidDeviceName() const; //< Has the name of the device been set? |
|
83 IMPORT_C TBool IsValidDeviceClass(); |
|
84 private: |
|
85 TBTDevAddr iBDAddr; /*!< The BT address of the remote device */ |
|
86 TBuf<KMaxBluetoothNameLen> iDeviceName; /*!< The name given by the remote device */ |
|
87 TBTDeviceClass iDeviceClass; /*!< The device class */ |
|
88 TBool iValidBDAddr; /*!< ETrue if iBDAddr has been set, EFalse if not */ |
|
89 TBool iValidDeviceName; /*!< ETrue if iDeviceName has been set, EFalse if not */ |
|
90 TBool iValidDeviceClass; /*!< ETrue if iDeviceClass has been set, EFalse if not */ |
|
91 |
|
92 // This data padding has been added to help prevent future binary compatibility breaks |
|
93 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used |
|
94 TUint32 iPadding1; |
|
95 TUint32 iPadding2; |
|
96 }; |
|
97 |
|
98 /** |
|
99 @publishedAll |
|
100 @released |
|
101 |
|
102 Typedef'ed pckgbuf to send paramaters to the device selection dialog via the notifier framework. |
|
103 **/ |
|
104 typedef TPckgBuf<TBTDeviceSelectionParams> TBTDeviceSelectionParamsPckg; |
|
105 |
|
106 /** |
|
107 @publishedAll |
|
108 @released |
|
109 |
|
110 Typedef'ed pckgbuf to retrieve the response from the device selection dialog via the notifier framework. |
|
111 **/ |
|
112 typedef TPckgBuf<TBTDeviceResponseParams> TBTDeviceResponseParamsPckg; |
|
113 |
|
114 /** |
|
115 A remote device address, and a boolean indicating if the remote device has access |
|
116 to the uplink |
|
117 WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases. |
|
118 @publishedPartner |
|
119 @released |
|
120 */ |
|
121 NONSHARABLE_CLASS(TPanConnection) |
|
122 { |
|
123 public: |
|
124 IMPORT_C TPanConnection(TBTDevAddr& aRemoteDeviceAddress, |
|
125 TBool aUplinkAccessAllowed); |
|
126 |
|
127 IMPORT_C const TBTDevAddr& RemoteDeviceAddress() const; |
|
128 IMPORT_C TBool UplinkAccessAllowed() const; |
|
129 IMPORT_C TBool IsValid() const; |
|
130 |
|
131 // Non-exported constructor. Allows creation of default NULL instance |
|
132 TPanConnection(); |
|
133 |
|
134 private: |
|
135 TBTDevAddr iRemoteDeviceAddress; |
|
136 TBool iUplinkAccessAllowed; |
|
137 |
|
138 // This data padding has been added to help prevent future binary compatibility breaks |
|
139 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used |
|
140 TUint32 iPadding1; |
|
141 TUint32 iPadding2; |
|
142 }; |
|
143 |
|
144 /** |
|
145 A list of TPanConnection instances |
|
146 This is not intended for external use by application developers. |
|
147 |
|
148 @see TPanConnection |
|
149 @publishedAll |
|
150 @released |
|
151 */ |
|
152 NONSHARABLE_CLASS(TPanConnectionList) |
|
153 { |
|
154 public: |
|
155 IMPORT_C TPanConnectionList(); |
|
156 |
|
157 IMPORT_C void AddRemoteConnectionL(const TPanConnection& aRemoteConnection); |
|
158 IMPORT_C const TPanConnection* GetFirstRemoteConnection(); |
|
159 IMPORT_C const TPanConnection* GetNextRemoteConnection(); |
|
160 |
|
161 IMPORT_C void SetRequestedConnectionAddr(const TBTDevAddr& aRequestedConnectionAddr); |
|
162 IMPORT_C const TBTDevAddr* RequestedConnectionAddr(); |
|
163 |
|
164 IMPORT_C const TUUID& CurrentLocalRole() const; |
|
165 IMPORT_C void SetCurrentLocalRole(const TUUID& aLocalRole); |
|
166 |
|
167 IMPORT_C TUint8 MaxNumberOfRemoteConnections(); |
|
168 |
|
169 private: |
|
170 const static TUint8 KMaxRemoteConnections = 7; |
|
171 |
|
172 private: |
|
173 TUint8 iPosition; // the position within the list for stateful reading |
|
174 TFixedArray<TPanConnection, KMaxRemoteConnections> iRemoteConnections; |
|
175 |
|
176 TBTDevAddr iRequestedConnectionAddr; |
|
177 |
|
178 TUUID iCurrentLocalRole; |
|
179 |
|
180 // This data padding has been added to help prevent future binary compatibility breaks |
|
181 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used |
|
182 TUint32 iPadding1; |
|
183 TUint32 iPadding2; |
|
184 }; |
|
185 |
|
186 /** |
|
187 @publishedAll |
|
188 @released |
|
189 |
|
190 Typedef'ed pckgbuf for TPanConnectionList. |
|
191 This is not intended for external use by application developers. |
|
192 **/ |
|
193 typedef TPckgBuf<TPanConnectionList> TPanConnectionListPckg; |
|
194 |
|
195 |
|
196 /** |
|
197 @publishedAll |
|
198 @released |
|
199 |
|
200 The response from the incoming PAN NAP connection selection dialog. |
|
201 This is intended for internal sub-system use only. |
|
202 **/ |
|
203 enum TNapConnectionResult |
|
204 { |
|
205 EDisallowNewNapConnection, |
|
206 EAcceptNapConnectionAllowUplinkAccess, |
|
207 EAcceptNapConnectionDisallowUplinkAccess, |
|
208 }; |
|
209 |
|
210 /** |
|
211 @publishedAll |
|
212 @released |
|
213 |
|
214 Typedef'ed pckgbuf to retrieve the response from the incoming PAN NAP connection |
|
215 selection dialog via the notifier framework. |
|
216 This is intended for internal sub-system use only. |
|
217 **/ |
|
218 typedef TPckgBuf<TNapConnectionResult> TNapConnectionResultPckg; |
|
219 |
|
220 #endif // BTEXTNOTIFIERS_H |