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