42
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: class for prompting user to authorize a service
|
|
15 |
* connection request.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef BTNOTIFSERVICEAUTHORIZER_H
|
|
20 |
#define BTNOTIFSERVICEAUTHORIZER_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include "btnotificationresult.h"
|
|
24 |
#include "bluetoothdevicedialogs.h"
|
|
25 |
|
|
26 |
class CBTNotifSecurityManager;
|
|
27 |
class CBluetoothNotification;
|
|
28 |
|
|
29 |
|
|
30 |
NONSHARABLE_CLASS(CBTNotifServiceAuthorizer)
|
|
31 |
: public CBase, public MBTNotificationResult
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
static CBTNotifServiceAuthorizer* NewL(CBTNotifSecurityManager& aParent);
|
|
35 |
~CBTNotifServiceAuthorizer();
|
|
36 |
|
|
37 |
private:
|
|
38 |
CBTNotifServiceAuthorizer(CBTNotifSecurityManager& aParent);
|
|
39 |
void ConstructL();
|
|
40 |
|
|
41 |
public:
|
|
42 |
void StartNotifierL(const RMessage2& aMessage);
|
|
43 |
|
|
44 |
private: // From MBTNotificationResult
|
|
45 |
void MBRDataReceived(CHbSymbianVariantMap& aData);
|
|
46 |
void MBRNotificationClosed(TInt aError, const TDesC8& aData);
|
|
47 |
|
|
48 |
private:
|
|
49 |
void PrepareNotificationL(TBool& aAutoAuthorize,
|
|
50 |
TBluetoothDialogParams::TBTDialogType aType,
|
|
51 |
TBTDialogResourceId aResourceId, TBool aPaired);
|
|
52 |
TBool IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr);
|
|
53 |
|
|
54 |
private:
|
|
55 |
CBTNotifSecurityManager& iParent;
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Buffer containing the parameters of the client message.
|
|
59 |
* Own.
|
|
60 |
*/
|
|
61 |
RBuf8 iParams;
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Pointer to an outstanding user interaction.
|
|
65 |
* Not owned.
|
|
66 |
*/
|
|
67 |
CBluetoothNotification* iNotification;
|
|
68 |
|
|
69 |
// Contains the device name provided in params
|
|
70 |
TBTDeviceName iCurrentDeviceName;
|
|
71 |
|
|
72 |
// The client request.
|
|
73 |
RMessage2 iNotifierMessage;
|
|
74 |
|
|
75 |
// The bluetooth SDP Id of the connecting device.
|
|
76 |
TUint iServiceId;
|
|
77 |
|
|
78 |
// Variable that defines if the connecting device is to be trusted or not.
|
|
79 |
TBool iSetTrusted;
|
|
80 |
|
|
81 |
// Defines if the check box in the dialog is checked or not.
|
|
82 |
TBool iCheckBoxState;
|
|
83 |
|
|
84 |
// Defines if the connecting device is paired or not.
|
|
85 |
TBool iPairedDevice;
|
|
86 |
|
|
87 |
// Defines the class of the connecting device.
|
|
88 |
TInt iDeviceClass;
|
|
89 |
};
|
|
90 |
|
|
91 |
#endif /* BTNOTIFSERVICEAUTHORIZER_H_ */
|