|
1 /* |
|
2 * Copyright (c) 2006-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 the License "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: |
|
15 * CPinPluginDialog declaration |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #ifndef PIN_PLUGINDIALOG_H |
|
25 #define PIN_PLUGINDIALOG_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <pinplugindialogdefs.h> |
|
29 |
|
30 /** |
|
31 Definition of the pin plugin dialog interface |
|
32 */ |
|
33 class CPinPluginDialog : public CActive |
|
34 { |
|
35 public: |
|
36 /** |
|
37 Prompts the user to enter a pin. |
|
38 |
|
39 @param aMinLength The minimum length of the pin. |
|
40 @param aMaxLength The maximum length of the pin. |
|
41 @param aRetry Indicates whether the user is retrying. |
|
42 @param aPinValue On return, It holds the pin that the user entered. |
|
43 @param aResult On return, It holds output of the dialog |
|
44 @param aStatus An asynchronous request status object. |
|
45 */ |
|
46 void PinIdentify(const TInt aMinLength, const TInt aMaxLength, const TBool aRetry, TPinValue& aPinValue, |
|
47 TPinPluginDialogResult& aResult, TRequestStatus& aStatus); |
|
48 |
|
49 /** |
|
50 Prompts the user to select a pin from the list. |
|
51 |
|
52 @param aType Information about the pin to train/retrain |
|
53 @param aPinNumbers array of pin number to display |
|
54 @param aMinLength The minimum length of the pin. |
|
55 @param aMaxLength The maximum length of the pin. |
|
56 @param aIndex On return, It holds the index of the selected pin. |
|
57 @param aCurrentLength By default, It has the current length of the pin |
|
58 On return, It holds the new length of the pin if user changes. |
|
59 @param aResult On return, It holds output of the dialog. |
|
60 @param aStatus An asynchronous request status object. |
|
61 */ |
|
62 void PinTraining(const TPinPluginTrainingMessage aType, const RPointerArray<TPinValue>& aPinNumbers, |
|
63 const TInt aMinLength, const TInt aMaxLength, TInt& aIndex, TInt& aCurrentLength, |
|
64 TPinPluginDialogResult& aResult, TRequestStatus& aStatus); |
|
65 |
|
66 /** |
|
67 Display the message to the user. |
|
68 |
|
69 @param aMessage Information about the PIN to display. |
|
70 @param aStatus An asynchronous request status object. |
|
71 */ |
|
72 void PinInfo(const TPinPluginInfoMessage aMessage,TRequestStatus& aStatus); |
|
73 |
|
74 public: |
|
75 /** |
|
76 Destructor for the CPinPluginDialog class |
|
77 */ |
|
78 ~CPinPluginDialog(); |
|
79 /** static methods to constuct the object of the CPinPluginDialog */ |
|
80 static CPinPluginDialog* NewL(); |
|
81 static CPinPluginDialog* NewLC(); |
|
82 private: |
|
83 CPinPluginDialog(); |
|
84 void ConstructL(); |
|
85 /** |
|
86 Helper function to perform basic initialization |
|
87 */ |
|
88 void DoInitialize(const TPinPluginDialogOperation aOperation, TRequestStatus& aStatus); |
|
89 /** |
|
90 Helper function to Issue Notifier request for the Dialog. |
|
91 */ |
|
92 void RequestDialog(const TDesC8& aData, TDes8& aResponse); |
|
93 |
|
94 private: // from CActive |
|
95 void RunL(); |
|
96 void DoCancel(); |
|
97 TInt RunError(TInt aError); |
|
98 |
|
99 private: |
|
100 enum TState |
|
101 { |
|
102 KPinPluginInfo, |
|
103 KPinPluginTraining, |
|
104 KPinPluginIdentify |
|
105 }; |
|
106 |
|
107 TPinPluginDialogOperation iCurrentOperation; |
|
108 TRequestStatus* iClientStatus; |
|
109 RNotifier iNotifier; |
|
110 TState iState; |
|
111 |
|
112 TPinIdentifyInputBuf iPinIdentifyInputBuf; |
|
113 TPinTrainingInputBuf iPinTrainingInputBuf; |
|
114 TPinInfoInputBuf iPinInfoInputBuf; |
|
115 TPinDialogOutputBuf iPinDialogOutputBuf; |
|
116 TInt* iClientPinIndex; |
|
117 TPinValue* iClientPinValue; |
|
118 TInt* iClientNewPinLength; |
|
119 TPinPluginDialogResult* iClientPinDialogResult; |
|
120 }; |
|
121 |
|
122 |
|
123 #endif /* PIN_PLUGINDIALOG_H */ |
|
124 |