|
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: CT Select Certificate Dialog |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CTSelectCertificateDialog.h" |
|
22 #include "CTSecurityDialogDefs.h" |
|
23 #include <CTSecDlgs.rsg> |
|
24 #include <uikon/eiksrvui.h> |
|
25 |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CCTSelectCertificateDialog::CCTSelectCertificateDialog |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 |
|
36 CCTSelectCertificateDialog::CCTSelectCertificateDialog( |
|
37 MDesCArray* /*aCertificates*/, |
|
38 RArray<TCTTokenObjectHandle>& aCertHandleList, |
|
39 TCTTokenObjectHandle& aSelectedCert, |
|
40 TRequestStatus& aClientStatus, |
|
41 TBool& aRetVal) |
|
42 : CAknListQueryDialog(&iSelectedIndex), |
|
43 iClientStatus(&aClientStatus), |
|
44 iRetVal(aRetVal), |
|
45 iSelectedIndex( 0 ), |
|
46 iCertHandleList( aCertHandleList ), |
|
47 iSelectedCert( aSelectedCert ) |
|
48 { |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CCTSelectCertificateDialog::~CCTSelectCertificateDialog() |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CCTSelectCertificateDialog::~CCTSelectCertificateDialog() |
|
56 { |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CCTSelectCertificateDialog::RunDlgLD() |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 void CCTSelectCertificateDialog::RunDlgLD( |
|
64 MDesCArray* aCertificates, |
|
65 RArray<TCTTokenObjectHandle>& aCertHandleList, |
|
66 TCTTokenObjectHandle& aSelectedCert, |
|
67 TRequestStatus& aClientStatus, |
|
68 TBool& aRetVal ) |
|
69 { |
|
70 CCTSelectCertificateDialog* self = |
|
71 new (ELeave) CCTSelectCertificateDialog( |
|
72 aCertificates, aCertHandleList, aSelectedCert, aClientStatus, aRetVal ); |
|
73 |
|
74 self->PrepareLC(R_WIM_SELECT_CERTIFICATE_DIALOG); |
|
75 self->SetItemTextArray(aCertificates); |
|
76 self->SetOwnershipType(ELbmOwnsItemArray); |
|
77 self->RunLD(); |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CCTSelectCertificateDialog::PostLayoutDynInitL() |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 void CCTSelectCertificateDialog::PostLayoutDynInitL() |
|
85 { |
|
86 ((CEikServAppUi*)(CEikonEnv::Static())->EikAppUi())->SuppressAppSwitching(ETrue); |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CCTSelectCertificateDialog::OkToExitL() |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 TInt CCTSelectCertificateDialog::OkToExitL(TInt aButtonId) |
|
94 { |
|
95 if ( aButtonId == EEikBidCancel ) |
|
96 { |
|
97 iRetVal = EFalse; |
|
98 User::RequestComplete(iClientStatus, KErrNone); |
|
99 } |
|
100 //Left softkey or Selection key was pressed |
|
101 else if ( aButtonId ==EAknSoftkeySelect || aButtonId == EAknSoftkeyOk) |
|
102 { |
|
103 iRetVal = ETrue; |
|
104 iSelectedIndex = ListBox()->CurrentItemIndex(); |
|
105 iSelectedCert = iCertHandleList[iSelectedIndex]; |
|
106 User::RequestComplete(iClientStatus, KErrNone); |
|
107 } |
|
108 ((CEikServAppUi*)(CEikonEnv::Static())->EikAppUi())->SuppressAppSwitching(EFalse); |
|
109 return ETrue; |
|
110 } |
|
111 |
|
112 // End of file |