|
1 /* |
|
2 * Copyright (c) 2003 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 CSecurityDialogBase that implements common functionality |
|
15 * for CTSecurityDialogs. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CSECURITYDIALOGBASE |
|
21 #define CSECURITYDIALOGBASE |
|
22 |
|
23 // INCLUDES |
|
24 #include "CTSecurityDialogRequestor.h" |
|
25 #include "CTSecurityDialogDefs.h" |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 |
|
33 // FUNCTION PROTOTYPES |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Base class of the CTSecurityDialogs |
|
41 * |
|
42 * @lib CTSecDlgs.lib |
|
43 * @since Series60_2.6 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CSecurityDialogBase ): |
|
46 public CBase, public MSecurityDialogResponse |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * C++ default constructor. |
|
52 */ |
|
53 CSecurityDialogBase(); |
|
54 |
|
55 /** |
|
56 * By default Symbian 2nd phase constructor is private. |
|
57 */ |
|
58 void ConstructL(); |
|
59 |
|
60 /** |
|
61 * Destructor. |
|
62 */ |
|
63 virtual ~CSecurityDialogBase(); |
|
64 |
|
65 public: // For Dialog Requester responses. |
|
66 |
|
67 /** |
|
68 * |
|
69 * @param aResult |
|
70 */ |
|
71 virtual void HandleResponse(TInt aResult); |
|
72 |
|
73 protected: // New functions |
|
74 |
|
75 /** |
|
76 * |
|
77 * @param aStatus |
|
78 */ |
|
79 void InitClientStatus(TRequestStatus& aStatus); |
|
80 |
|
81 /** |
|
82 * ShowNoteL shows a dialog/note using Notifier API. |
|
83 * |
|
84 * @param aStatus Signaled value for async operation. KErrNone if successful, otherwise system error. |
|
85 * @param aDlgType Dialog type |
|
86 * @param aReturnValue Return value of a dialog. If aStatus == KErrNone, then the user's response |
|
87 * is located here. ETrue means positive response (OK, continue etc.), |
|
88 * EFalse means negative response. |
|
89 * @param aDynamic Dynamic text for dialog. Effective only if %U is in the localisation resource. |
|
90 * |
|
91 * Leaves on: System error before showing the actual dialog |
|
92 * |
|
93 * Asserts on: If aDlgType is a PIN/PUK code query. |
|
94 */ |
|
95 void ShowNoteL(TRequestStatus& aStatus, |
|
96 TInt aNoteTypeaDlgType, |
|
97 const TDesC& aDynamic = KNullDesC); |
|
98 |
|
99 /** |
|
100 * Sends dialog request to CCTSecurityDialogRequestor |
|
101 * |
|
102 * @param aData Data needed to display dialog. |
|
103 */ |
|
104 void RequestDialog(const TDesC8& aData); |
|
105 |
|
106 /** |
|
107 * Checks error and if aError != KErrNone completes iClientStatus |
|
108 * with aError. |
|
109 * |
|
110 * @param aError Error to check |
|
111 * |
|
112 * @param aData Data needed to display dialog. |
|
113 */ |
|
114 void CheckError(TInt aError); |
|
115 |
|
116 CCTSecurityDialogRequestor& Requester(); |
|
117 |
|
118 |
|
119 private: // Data |
|
120 TRequestStatus* iClientStatus; // Pointer to client's request status |
|
121 // We must signal it when dialogrequestor |
|
122 // RunL is called to signal the completion of a dialog! |
|
123 |
|
124 CBufFlat* iSenderBuffer; // Stream buffer for outgoing streams. |
|
125 HBufC8* iBufferData; // iSenderBuffer help buffer |
|
126 |
|
127 CCTSecurityDialogRequestor* iRequester; // Owned |
|
128 |
|
129 TBuf8<10> iDlgResponseBuf; |
|
130 |
|
131 TAny* iReserved; |
|
132 }; |
|
133 |
|
134 #endif // CSECURITYDIALOGBASE |
|
135 |
|
136 // End of File |