author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:37:10 +0300 | |
branch | RCL_3 |
changeset 61 | 269724087bed |
parent 56 | 9386f31cc85b |
child 72 | 4b59561a31c0 |
permissions | -rw-r--r-- |
56 | 1 |
/* |
2 |
* Copyright (c) 2007 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 PBAP PIN query notifier class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
// INCLUDE FILES |
|
20 |
#include <StringLoader.h> // Localisation stringloader |
|
21 |
#include <utf.h> // Unicode character conversion utilities |
|
22 |
||
23 |
#include <BTNotif.rsg> // own resources |
|
24 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
25 |
#include <btextnotifiers.h> |
|
26 |
#else |
|
27 |
#include <btextnotifiers.h> |
|
28 |
#include <btextnotifierspartner.h> |
|
29 |
#endif |
|
30 |
||
31 |
#include "btnpbappinnotifier.h" // own class definition |
|
32 |
#include "btNotifDebug.h" // debugging macros |
|
33 |
||
34 |
#include <SecondaryDisplay/BTnotifSecondaryDisplayAPI.h> |
|
35 |
||
36 |
// ================= MEMBER FUNCTIONS ======================= |
|
37 |
||
38 |
// ---------------------------------------------------------- |
|
39 |
// CBTObexPinNotifier::NewL |
|
40 |
// Two-phased constructor. |
|
41 |
// ---------------------------------------------------------- |
|
42 |
// |
|
43 |
CBTPBAPPinNotifier* CBTPBAPPinNotifier::NewL() |
|
44 |
{ |
|
45 |
CBTPBAPPinNotifier* self=new (ELeave) CBTPBAPPinNotifier(); |
|
46 |
CleanupStack::PushL(self); |
|
47 |
self->ConstructL(); |
|
48 |
CleanupStack::Pop(); |
|
49 |
return self; |
|
50 |
} |
|
51 |
||
52 |
// ---------------------------------------------------------- |
|
53 |
// CBTObexPinNotifier::CBTObexPinNotifier |
|
54 |
// C++ default constructor can NOT contain any code, that |
|
55 |
// might leave. |
|
56 |
// ---------------------------------------------------------- |
|
57 |
// |
|
58 |
CBTPBAPPinNotifier::CBTPBAPPinNotifier() |
|
59 |
{ |
|
60 |
} |
|
61 |
||
62 |
// ---------------------------------------------------------- |
|
63 |
// Destructor |
|
64 |
// ---------------------------------------------------------- |
|
65 |
// |
|
66 |
CBTPBAPPinNotifier::~CBTPBAPPinNotifier() |
|
67 |
{ |
|
68 |
} |
|
69 |
||
70 |
// ---------------------------------------------------------- |
|
71 |
// CBTPBAPPinNotifier::RegisterL |
|
72 |
// ---------------------------------------------------------- |
|
73 |
// |
|
74 |
CBTPBAPPinNotifier::TNotifierInfo CBTPBAPPinNotifier::RegisterL() |
|
75 |
{ |
|
76 |
iInfo.iUid=KPbapAuthNotifierUid; |
|
77 |
iInfo.iChannel=KBTObexPINChannel; |
|
78 |
iInfo.iPriority=ENotifierPriorityVHigh; |
|
79 |
return iInfo; |
|
80 |
} |
|
81 |
||
82 |
// ---------------------------------------------------------- |
|
61
269724087bed
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
83 |
// CBTPBAPPinNotifier::ProcessStartParamsL |
56 | 84 |
// Initialize parameters. Jump to RunL as soon as possible. |
85 |
// ---------------------------------------------------------- |
|
86 |
// |
|
61
269724087bed
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
87 |
void CBTPBAPPinNotifier::ProcessStartParamsL() |
56 | 88 |
{ |
61
269724087bed
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
89 |
FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ProcessStartParamsL()")); |
56 | 90 |
|
91 |
if ( AutoLockOnL() ) |
|
92 |
{ |
|
93 |
// The phone is locked, access denied. |
|
94 |
// |
|
95 |
CompleteMessage(KErrCancel); |
|
96 |
return; |
|
97 |
} |
|
98 |
||
99 |
ShowNoteCompleteMessageL(); |
|
100 |
||
61
269724087bed
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
101 |
FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ProcessStartParamsL() completed")); |
56 | 102 |
} |
103 |
||
104 |
// ---------------------------------------------------------- |
|
105 |
// CBTPBAPPinNotifier::ShowNoteCompleteMessageL |
|
106 |
// Ask user response and return it to caller. |
|
107 |
// ---------------------------------------------------------- |
|
108 |
// |
|
109 |
void CBTPBAPPinNotifier::ShowNoteCompleteMessageL() |
|
110 |
{ |
|
111 |
FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ShowNoteCompleteMessageL()")); |
|
112 |
||
113 |
TBuf<KBTObexPasskeyMaxLength> pbapPasskey; // Unicode buffer |
|
114 |
||
115 |
TInt keypress = iNotifUiUtil->ShowTextInputQueryL( pbapPasskey, |
|
116 |
R_BT_OBEX_PASSKEY_QUERY, ECmdShowBtOpenCoverNote ); |
|
117 |
||
118 |
if( keypress ) // OK pressed |
|
119 |
{ |
|
120 |
TPbapAuthNotifierResponsePckg pbapPasskeyResponse; |
|
121 |
pbapPasskeyResponse().SetPassword(pbapPasskey); |
|
122 |
CompleteMessage(pbapPasskeyResponse, KErrNone); |
|
123 |
} |
|
124 |
else // Cancel pressed |
|
125 |
{ |
|
126 |
CompleteMessage(KErrCancel); |
|
127 |
} |
|
128 |
||
129 |
FLOG(_L("[BTNOTIF]\t CBTPBAPPinNotifier::ShowNoteCompleteMessageL() completed")); |
|
130 |
} |
|
131 |
||
132 |
// End of File |