29
|
1 |
/*
|
|
2 |
* ============================================================================
|
|
3 |
* Name : btnotifclient.h
|
|
4 |
* Part of : bluetoothengine / btnotifclient
|
|
5 |
* Description : Session class for client-server interaction with btnotifserver.
|
|
6 |
*
|
|
7 |
* Copyright © 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
8 |
* All rights reserved.
|
|
9 |
* This component and the accompanying materials are made available
|
|
10 |
* under the terms of "Eclipse Public License v1.0"
|
|
11 |
* which accompanies this distribution, and is available
|
|
12 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
13 |
*
|
|
14 |
* Initial Contributors:
|
|
15 |
* Nokia Corporation - initial contribution.
|
|
16 |
*
|
|
17 |
* Contributors:
|
|
18 |
* Nokia Corporation
|
|
19 |
* ============================================================================
|
|
20 |
* Template version: 4.2
|
|
21 |
*/
|
|
22 |
|
|
23 |
#ifndef RBTNOTIFCLIENT_H
|
|
24 |
#define RBTNOTIFCLIENT_H
|
|
25 |
|
|
26 |
#include <e32base.h>
|
|
27 |
#include <btmanclient.h>
|
|
28 |
|
|
29 |
/**
|
|
30 |
* A handle to a session with the Bluetooth notifier server for showing
|
|
31 |
* Bluetooth-related notifications to the user.
|
|
32 |
*
|
|
33 |
* ?more_complete_description
|
|
34 |
* @code
|
|
35 |
* ?good_class_usage_example(s)
|
|
36 |
* @endcode
|
|
37 |
*
|
|
38 |
* @lib ?library
|
|
39 |
* @since Symbian^4
|
|
40 |
*/
|
|
41 |
NONSHARABLE_CLASS( RBTNotifier ) : public RSessionBase
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Constructor.
|
|
47 |
*
|
|
48 |
* @since Symbian^4
|
|
49 |
*/
|
|
50 |
IMPORT_C RBTNotifier();
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Connect to the Bluetooth notifier server.
|
|
54 |
*
|
|
55 |
* @since Symbian^4
|
|
56 |
* @return KErrNone, if successful. Otherwise one of
|
|
57 |
* the system-wide error codes.
|
|
58 |
*/
|
|
59 |
IMPORT_C TInt Connect();
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Get the version information about the client.
|
|
63 |
*
|
|
64 |
* @since Symbian^4
|
|
65 |
* @return The version of the client-server interface implemented by this client.
|
|
66 |
*/
|
|
67 |
IMPORT_C TVersion Version();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Requests the extended notifier server to start the notifier
|
|
71 |
* identified by the specified UID. The request is synchronous;
|
|
72 |
* the call returns when the request is complete.
|
|
73 |
*
|
|
74 |
* @since Symbian^4
|
|
75 |
* @param aNotifierUid The UID identifying the notifier. This is
|
|
76 |
* the same UID as used with RNotifier for the same purpose.
|
|
77 |
* @param aBuffer Data that can be passed to the notifier; the format and
|
|
78 |
* meaning of this depends on the notifier.
|
|
79 |
* @return KErrNone, if successful; KErrNotFound, if there
|
|
80 |
* is no notifier matching the specified UID; otherwise
|
|
81 |
* one of the other system-wide error codes.
|
|
82 |
*/
|
|
83 |
IMPORT_C TInt StartNotifier( TUid aNotifierUid, const TDesC8& aBuffer );
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Requests the extended notifier server to start the notifier
|
|
87 |
* identified by the specified UID. This is an asynchronous request.
|
|
88 |
*
|
|
89 |
* @since Symbian^4
|
|
90 |
* @param aRs The request status. On request completion, contains KErrNone,
|
|
91 |
* if successful; KErrNotFound, if there is no notifier matching the
|
|
92 |
* specified UID; KErrCancel, if the notifier was cancelled through
|
|
93 |
* RBTNotifier::CancelNotifier; otherwise, one of the other system
|
|
94 |
* wide error codes.
|
|
95 |
* @param aNotifierUid The UID identifying the notifier. This is
|
|
96 |
* the same UID as used with RNotifier for the same purpose.
|
|
97 |
* @param aBuffer Data that can be passed to the notifier; the format and
|
|
98 |
* meaning of this depends on the notifier.
|
|
99 |
* @param aResponse Response data from the notifier; the format and meaning
|
|
100 |
* of this depends on the notifier.
|
|
101 |
*/
|
|
102 |
IMPORT_C void StartNotifierAndGetResponse( TRequestStatus& aRs,
|
|
103 |
TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Requests the Bluetooth notifier server to cancel the notifier
|
|
107 |
* identified by the specified UID. The request is synchronous;
|
|
108 |
* the call returns when the request is complete.
|
|
109 |
*
|
|
110 |
* @since Symbian^4
|
|
111 |
* @param aNotifierUid The UID identifying the notifier. This is
|
|
112 |
* the same UID as used with RNotifier for the same purpose.
|
|
113 |
* @return KErrNone, if successful; KErrNotFound, if there
|
|
114 |
* is no notifier matching the specified UID; otherwise
|
|
115 |
* one of the other system-wide error codes.
|
|
116 |
*/
|
|
117 |
IMPORT_C TInt CancelNotifier( TUid aNotifierUid );
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Requests the Bluetooth notifier server to update the active
|
|
121 |
* notifier identified by the specified UID, with the data supplied.
|
|
122 |
* The request is synchronous; the call returns when the request is complete.
|
|
123 |
*
|
|
124 |
* @since Symbian^4
|
|
125 |
* @param aNotifierUid The UID identifying the notifier. This is
|
|
126 |
* the same UID as used with RNotifier for the same purpose.
|
|
127 |
* @param aBuffer Data that can be passed to the notifier; the format and
|
|
128 |
* meaning of this depends on the notifier.
|
|
129 |
* @param aResponse Response data from the notifier; the format and meaning
|
|
130 |
* of this depends on the notifier.
|
|
131 |
* @return KErrNone, if successful; KErrNotFound, if there
|
|
132 |
* is no notifier matching the specified UID; otherwise
|
|
133 |
* one of the other system-wide error codes.
|
|
134 |
*/
|
|
135 |
IMPORT_C TInt UpdateNotifier( TUid aNotifierUid,
|
|
136 |
const TDesC8& aBuffer, TDes8& aResponse );
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Requests the Bluetooth notifier server to pair with the device
|
|
140 |
* specified by the given Bluetooth device address.
|
|
141 |
* The request is asynchronous; Use CancelPairing() to cancel
|
|
142 |
* an outstanding pairing request.
|
|
143 |
*
|
|
144 |
* @since Symbian^4
|
|
145 |
* @param aAddr The address of the remote device to perform pairing with.
|
|
146 |
* @param aDeviceClass the CoD of the remote device.
|
|
147 |
* @param aStatus The request status. On request completion, contains KErrNone,
|
|
148 |
* if successful; KErrCancel, if the notifier was cancelled through
|
|
149 |
* RBTNotifier::CancelPair; otherwise, one of the other system
|
|
150 |
* wide error codes.
|
|
151 |
*/
|
|
152 |
IMPORT_C void PairDevice( const TBTDevAddrPckgBuf& aAddr, TInt32 aDeviceClass,
|
|
153 |
TRequestStatus& aStatus );
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Requests the Bluetooth notifier server to cancel the current pairing
|
|
157 |
* request. The request is synchronous;
|
|
158 |
* the call returns when the request is complete.
|
|
159 |
*
|
|
160 |
* If this request is issued when the Bluetooth
|
|
161 |
* notifier server has completed pairing with the device, the pairing
|
|
162 |
* will not be un-done. That is, the device will not be unpaired.
|
|
163 |
*
|
|
164 |
* @since Symbian^4
|
|
165 |
*/
|
|
166 |
IMPORT_C void CancelPairDevice();
|
|
167 |
|
|
168 |
private:
|
|
169 |
|
|
170 |
private: // data
|
|
171 |
|
|
172 |
/**
|
|
173 |
* ?description_of_member
|
|
174 |
*/
|
|
175 |
// ?type ?member_name;
|
|
176 |
|
|
177 |
};
|
|
178 |
|
|
179 |
#endif // RBTNOTIFCLIENT_H
|