|
1 /* |
|
2 * Copyright (c) 2009 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: Declares pair base notifier. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BTNPAIRNOTIFIER_H_ |
|
19 #define BTNPAIRNOTIFIER_H_ |
|
20 |
|
21 #include "btnotifier.h" // base class |
|
22 |
|
23 // CLASS DECLARATION |
|
24 /** |
|
25 * This class is used as base class for all pairing purpose notifiers |
|
26 */ |
|
27 NONSHARABLE_CLASS(CBTNPairNotifierBase) : public CBTNotifierBase |
|
28 { |
|
29 public: // Constructors and destructor |
|
30 |
|
31 /** |
|
32 * Two-phased constructor. |
|
33 */ |
|
34 static CBTNPairNotifierBase* NewL(); // Constructor (public) |
|
35 |
|
36 /** |
|
37 * Destructor. |
|
38 */ |
|
39 virtual ~CBTNPairNotifierBase(); // Destructor |
|
40 |
|
41 protected: // From base class |
|
42 |
|
43 /** |
|
44 * From CBTNotifierBase |
|
45 */ |
|
46 virtual TNotifierInfo RegisterL(); |
|
47 |
|
48 /** |
|
49 * From CBTNotifierBase Used in asynchronous notifier launch to |
|
50 * store received parameters into members variables and |
|
51 * make needed initializations. |
|
52 * @param aBuffer A buffer containing received parameters |
|
53 * @param aReturnVal The return value to be passed back. |
|
54 * @param aMessage Should be completed when the notifier is deactivated. |
|
55 * @return None. |
|
56 */ |
|
57 virtual void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
|
58 |
|
59 virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
|
60 |
|
61 /** |
|
62 * From CBTNotifierBase Updates a currently active notifier. |
|
63 * @param aBuffer The updated data. |
|
64 * @return A pointer to return value. |
|
65 */ |
|
66 virtual TPtrC8 UpdateL(const TDesC8& aBuffer); |
|
67 |
|
68 protected: // New functions |
|
69 |
|
70 void ProcessParamsGetDeviceL( const TBTDevAddr& aAddr, const TBTDeviceName& aName ); |
|
71 |
|
72 /** |
|
73 * Check not to allow pairing attempt from banned devices, |
|
74 */ |
|
75 TBool CheckBlockedDeviceL(); |
|
76 |
|
77 /** |
|
78 * Query user to accept/reject when the pairing request is initiated |
|
79 * from remote device. |
|
80 * @param None. |
|
81 * @return ETrue if User accepted. |
|
82 */ |
|
83 TBool AuthoriseIncomingPairingL(); |
|
84 |
|
85 /** |
|
86 * Generate prompt based on subclass's own needs. |
|
87 */ |
|
88 virtual HBufC* GenerateQueryPromoptLC(); |
|
89 |
|
90 private: |
|
91 /** |
|
92 * From CBTNotifierBase Called when a notifier is first loaded |
|
93 * to allow any initial construction that is required. |
|
94 * @param None. |
|
95 * @return A structure containing priority and channel info. |
|
96 */ |
|
97 //TNotifierInfo RegisterL(); |
|
98 |
|
99 protected: |
|
100 /** |
|
101 * C++ default constructor. |
|
102 */ |
|
103 CBTNPairNotifierBase(); |
|
104 |
|
105 protected: // Data |
|
106 TBool iLocallyInitiated; |
|
107 }; |
|
108 |
|
109 #endif /* BTNPAIRNOTIFIER_H */ |
|
110 |