29
|
1 |
/*
|
|
2 |
* ============================================================================
|
|
3 |
* Name : btnotifdeviceselector.h
|
|
4 |
* Part of : BTProximity / BTProximity
|
|
5 |
* Description : Class for tracking Bluetooth settings, and also for
|
|
6 |
* handling notes unrelated to specific connection.
|
|
7 |
*
|
|
8 |
* Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
9 |
* All rights reserved.
|
|
10 |
* This component and the accompanying materials are made available
|
|
11 |
* under the terms of "Eclipse Public License v1.0"
|
|
12 |
* which accompanies this distribution, and is available
|
|
13 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
14 |
*
|
|
15 |
* Initial Contributors:
|
|
16 |
* Nokia Corporation - initial contribution.
|
|
17 |
*
|
|
18 |
* Contributors:
|
|
19 |
* Nokia Corporation
|
|
20 |
* ============================================================================
|
|
21 |
* Template version: 4.2
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef BTNOTIFDEVICESELECTOR_H
|
|
25 |
#define BTNOTIFDEVICESELECTOR_H
|
|
26 |
|
|
27 |
|
|
28 |
#include <e32base.h>
|
|
29 |
#include <btengsettings.h>
|
|
30 |
#include <btservices/devdiscoveryobserver.h>
|
|
31 |
#include "bluetoothnotification.h"
|
31
|
32 |
#include <btservices/btdevrepository.h>
|
29
|
33 |
|
|
34 |
class CBTNotifServer;
|
|
35 |
class CAdvanceDevDiscoverer;
|
|
36 |
class CBtDevExtension;
|
|
37 |
|
|
38 |
/**
|
|
39 |
* ?one_line_short_description
|
|
40 |
* ?more_complete_description
|
|
41 |
*
|
|
42 |
* @code
|
|
43 |
* ?good_class_usage_example(s)
|
|
44 |
* @endcode
|
|
45 |
*
|
|
46 |
* @lib ?library
|
|
47 |
* @since S60 ?S60_version *** for example, S60 v3.0
|
|
48 |
*/
|
|
49 |
NONSHARABLE_CLASS( CBTNotifDeviceSelector ) :
|
|
50 |
public CBase,
|
|
51 |
public MBTNotificationResult,
|
31
|
52 |
public MDevDiscoveryObserver,
|
|
53 |
public MBtDevRepositoryObserver
|
29
|
54 |
{
|
|
55 |
|
|
56 |
public:
|
|
57 |
|
|
58 |
/**
|
|
59 |
* Two-phased constructor.
|
|
60 |
* @param aServer Pointer to our parent
|
|
61 |
*/
|
|
62 |
static CBTNotifDeviceSelector* NewL( CBTNotifServer& aServer );
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Destructor.
|
|
66 |
*/
|
|
67 |
virtual ~CBTNotifDeviceSelector();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Processes a message from a notifier client related to settings.
|
|
71 |
*
|
|
72 |
* @since Symbian^4
|
|
73 |
* @param aMessage The message containing the details of the client request.
|
|
74 |
*/
|
|
75 |
void DispatchNotifierMessageL( const RMessage2& aMessage );
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Cancels an oustanding message from a notifier client related to settings.
|
|
79 |
*
|
|
80 |
* @since Symbian^4
|
|
81 |
* @param aMessage The message containing the details of the original client request.
|
|
82 |
*/
|
|
83 |
void CancelNotifierMessageL( const RMessage2& aMessage );
|
|
84 |
|
|
85 |
private:
|
|
86 |
// from base class MBTNotificationResult
|
|
87 |
|
|
88 |
/**
|
|
89 |
* From MBTNotificationResult.
|
|
90 |
* Handle an intermediate result from a user query.
|
|
91 |
* This ffunction is called if the user query passes information
|
|
92 |
* back before it has finished i.e. is dismissed. The final acceptance/
|
|
93 |
* denial of a query is passed back in MBRNotificationClosed.
|
|
94 |
*
|
|
95 |
* @since Symbian^4
|
|
96 |
* @param aData the returned data. The actual format
|
|
97 |
* is dependent on the actual notifier.
|
|
98 |
*/
|
|
99 |
virtual void MBRDataReceived( CHbSymbianVariantMap& aData );
|
|
100 |
|
|
101 |
/**
|
|
102 |
* From MBTNotificationResult.
|
|
103 |
* The notification is finished. The resulting data (e.g. user input or
|
|
104 |
* acceptance/denial of the query) is passed back here.
|
|
105 |
*
|
|
106 |
* @since Symbian^4
|
|
107 |
* @param aErr KErrNone or one of the system-wide error codes.
|
|
108 |
* @param aData the returned data. The actual format
|
|
109 |
* is dependent on the actual notifier.
|
|
110 |
*/
|
|
111 |
virtual void MBRNotificationClosed( TInt aError, const TDesC8& aData );
|
|
112 |
|
|
113 |
// From MDevDiscoveryObserver
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Callback to notify that a device has been found.
|
|
117 |
*
|
|
118 |
* @param aAddr the inquiry address that contains the inquiry information
|
|
119 |
* of the found device.
|
|
120 |
* @param aName the Bluetooth device name of the found device
|
|
121 |
*/
|
|
122 |
virtual void HandleNextDiscoveryResultL(
|
|
123 |
const TInquirySockAddr& aAddr, const TDesC& aName );
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Callback to notify that the device search has completed.
|
|
127 |
*
|
|
128 |
* @param aErr the error code of device search result.
|
|
129 |
*/
|
|
130 |
virtual void HandleDiscoveryCompleted( TInt aErr );
|
|
131 |
|
31
|
132 |
|
|
133 |
// From MBtDeviceRepositoryObserver
|
|
134 |
|
|
135 |
void RepositoryInitialized();
|
|
136 |
|
|
137 |
void DeletedFromRegistry( const TBTDevAddr& addr );
|
|
138 |
|
|
139 |
void AddedToRegistry( const CBtDevExtension& dev );
|
|
140 |
|
|
141 |
void ChangedInRegistry( const CBtDevExtension& dev, TUint similarity );
|
|
142 |
|
|
143 |
void ServiceConnectionChanged(
|
|
144 |
const CBtDevExtension& dev, TBool connected );
|
|
145 |
|
|
146 |
|
29
|
147 |
private:
|
|
148 |
|
|
149 |
CBTNotifDeviceSelector( CBTNotifServer& aServer );
|
|
150 |
|
|
151 |
void ConstructL();
|
|
152 |
|
|
153 |
void PrepareNotificationL(
|
|
154 |
TBluetoothDialogParams::TBTDialogType aType,
|
|
155 |
TBTDialogResourceId aResourceId );
|
31
|
156 |
|
|
157 |
void LoadUsedDevicesL();
|
29
|
158 |
|
|
159 |
private: // data
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Reference to our parent the server class.
|
|
163 |
* Not own.
|
|
164 |
*/
|
|
165 |
CBTNotifServer& iServer;
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Pointer to an outstanding user interaction.
|
|
169 |
* Not own.
|
|
170 |
*/
|
|
171 |
CBluetoothNotification* iNotification;
|
|
172 |
|
|
173 |
/**
|
|
174 |
* device inquiry handler:
|
|
175 |
*/
|
|
176 |
CAdvanceDevDiscoverer* iDiscoverer;
|
|
177 |
|
|
178 |
/**
|
|
179 |
* do not own the elements in the array.
|
|
180 |
*/
|
|
181 |
RPointerArray<CBtDevExtension> iDevices;
|
|
182 |
|
|
183 |
/**
|
|
184 |
* The message for a pending device selection request from a RNotifier client.
|
|
185 |
*/
|
|
186 |
RMessage2 iMessage;
|
|
187 |
|
31
|
188 |
TBool iRepositoryInitialized;
|
|
189 |
|
|
190 |
TBool iLoadDevices;
|
|
191 |
|
29
|
192 |
};
|
|
193 |
|
|
194 |
#endif // BTNOTIFDEVICESELECTOR_H
|