|
1 /* |
|
2 * Copyright (c) 2006 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: Helper class for SDP database management. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BTENGSDPDBHANDLER_H |
|
20 #define BTENGSDPDBHANDLER_H |
|
21 |
|
22 #include <btsdp.h> |
|
23 |
|
24 class TResourceReader; |
|
25 |
|
26 |
|
27 /** |
|
28 * ?one_line_short_description |
|
29 * |
|
30 * ?more_complete_description |
|
31 * |
|
32 * @lib btengdiscovery.lib |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CBTEngSdpDbHandler ) : public CBase |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Two-phase constructor |
|
42 * |
|
43 * @since S60 v3.2 |
|
44 * @return Pointer to the constructed CBTEngSdpDbHandler object. |
|
45 */ |
|
46 static CBTEngSdpDbHandler* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 virtual ~CBTEngSdpDbHandler(); |
|
52 |
|
53 /** |
|
54 * ?description |
|
55 * |
|
56 * @since S60 v3.2 |
|
57 * @param aService ?description |
|
58 * @param aChannel RFCOMM channel to be filled in into the record. |
|
59 * @param aHandle ?description |
|
60 */ |
|
61 void RegisterSdpRecordL( const TUUID& aService, TInt aChannel, |
|
62 TSdpServRecordHandle& aHandle ); |
|
63 |
|
64 /** |
|
65 * ?description |
|
66 * |
|
67 * @since S60 v3.2 |
|
68 * @param aService ?description |
|
69 * @param aVendorId Vendor ID to be filled in into the DI record. |
|
70 * @param aProductId Product ID to be filled in into the DI record. |
|
71 * @param aHandle ?description |
|
72 */ |
|
73 void RegisterSdpRecordL( const TUUID& aService, TInt aVendorId, |
|
74 TInt aProductId, TSdpServRecordHandle& aHandle ); |
|
75 |
|
76 /** |
|
77 * ?description |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @param aService ?description |
|
81 * @param aHandle ?description |
|
82 */ |
|
83 void RegisterSdpRecordL( const TUUID& aService, |
|
84 TSdpServRecordHandle& aHandle ); |
|
85 |
|
86 /** |
|
87 * ?description |
|
88 * |
|
89 * @since S60 v3.2 |
|
90 * @param aHandle Handle to the SDP record to be deleted. Note that |
|
91 * this has to be a valid (existing) SDP record. |
|
92 */ |
|
93 void DeleteSdpRecordL( const TSdpServRecordHandle aHandle ); |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * C++ default constructor |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 */ |
|
102 CBTEngSdpDbHandler(); |
|
103 |
|
104 /** |
|
105 * Symbian 2nd-phase constructor |
|
106 * |
|
107 * @since S60 v3.2 |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 /** |
|
112 * ?description |
|
113 * |
|
114 * @since S60 v3.2 |
|
115 * @param aService ?description |
|
116 * @param aChannel ?description |
|
117 * @return ?description |
|
118 */ |
|
119 void BuildAttributeLC( CSdpAttrValue*& aAttrVal, TResourceReader& aReader, |
|
120 TInt aAttrId ); |
|
121 |
|
122 /** |
|
123 * ?description |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * @param aService ?description |
|
127 * @param aChannel ?description |
|
128 * @return ?description |
|
129 */ |
|
130 void BuildAttrValueLC( CSdpAttrValue*& aAttrVal, TResourceReader& aReader, |
|
131 TUint aAttrType, TInt aAttrId ); |
|
132 |
|
133 /** |
|
134 * ?description |
|
135 * |
|
136 * @since S60 v3.2 |
|
137 * @param aService ?description |
|
138 * @param aChannel ?description |
|
139 * @return ?description |
|
140 */ |
|
141 void BuildAttrDesLC( CSdpAttrValue*& aAttrVal, TResourceReader& aReader, |
|
142 TInt aAttrId ); |
|
143 |
|
144 /** |
|
145 * ?description |
|
146 * |
|
147 * @since S60 v3.2 |
|
148 * @param aService ?description |
|
149 * @param aChannel ?description |
|
150 * @return ?description |
|
151 */ |
|
152 void ReadRecordResourceL( const TDesC8& aService, TResourceReader& aReader, |
|
153 HBufC8*& aRecordBuf ); |
|
154 |
|
155 private: // data |
|
156 |
|
157 /** |
|
158 * RFComm channel number. |
|
159 * (to be replaced with a more flexible structure |
|
160 * so that e.g. DI profile values can be set too). |
|
161 */ |
|
162 TUint iChannel; |
|
163 |
|
164 /** |
|
165 * DI profile vendor ID. |
|
166 */ |
|
167 TUint iVendorId; |
|
168 |
|
169 /** |
|
170 * DI profile product ID. |
|
171 */ |
|
172 TUint iProductId; |
|
173 |
|
174 /** |
|
175 * Session to SDP database. |
|
176 */ |
|
177 RSdp iSdp; |
|
178 |
|
179 /** |
|
180 * Subsession to SDP database for managing SDP records. |
|
181 */ |
|
182 RSdpDatabase iDb; |
|
183 |
|
184 }; |
|
185 |
|
186 #endif // BTENGSDPDBHANDLER |