|
1 /* |
|
2 * Copyright (c) 2004-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 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "keytool_utils.h" |
|
20 #include "certtool_commands.h" |
|
21 #include "certtool_controller.h" |
|
22 |
|
23 |
|
24 /*static*/ CCertToolUsage* CCertToolUsage::NewLC(CCertToolController* aController) |
|
25 { |
|
26 CCertToolUsage* self = new (ELeave) CCertToolUsage(aController); |
|
27 CleanupStack::PushL(self); |
|
28 self->ConstructL(); |
|
29 return self; |
|
30 } |
|
31 |
|
32 /*static*/ CCertToolUsage* CCertToolUsage::NewL(CCertToolController* aController) |
|
33 { |
|
34 CCertToolUsage* self = CCertToolUsage::NewLC(aController); |
|
35 CleanupStack::Pop(self); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CCertToolUsage::CCertToolUsage(CCertToolController* aController) : CCertToolCommand(aController) |
|
40 { |
|
41 } |
|
42 |
|
43 void CCertToolUsage::ConstructL() |
|
44 { |
|
45 } |
|
46 |
|
47 CCertToolUsage::~CCertToolUsage() |
|
48 { |
|
49 } |
|
50 |
|
51 void CCertToolUsage::RunL() |
|
52 { |
|
53 |
|
54 } |
|
55 |
|
56 void CCertToolUsage::DoCancel() |
|
57 { |
|
58 |
|
59 } |
|
60 |
|
61 void CCertToolUsage::DoCommandL(CUnifiedCertStore& /*aCertStore*/, CKeyToolParameters* aParam) |
|
62 { |
|
63 // Depending on parameters show the help! |
|
64 if (!aParam->iDefault) |
|
65 { |
|
66 // Display general usage! |
|
67 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE); |
|
68 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE2); |
|
69 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE3); |
|
70 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE4); |
|
71 return; |
|
72 } |
|
73 |
|
74 if (!aParam->iDefault->Compare(_L("import")) ) |
|
75 { |
|
76 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_IMPORT); |
|
77 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_IMPORT2); |
|
78 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_IMPORT3); |
|
79 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_IMPORT4); |
|
80 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_IMPORT5); |
|
81 } |
|
82 else |
|
83 if (!aParam->iDefault->Compare(_L("list")) ) |
|
84 { |
|
85 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_LIST); |
|
86 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_LIST2); |
|
87 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_LIST3); |
|
88 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_LIST4); |
|
89 } |
|
90 else |
|
91 if (!aParam->iDefault->Compare(_L("liststores")) ) |
|
92 { |
|
93 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_LISTSTORES); |
|
94 } |
|
95 else |
|
96 if (!aParam->iDefault->Compare(_L("remove")) ) |
|
97 { |
|
98 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_REMOVE); |
|
99 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_REMOVE2); |
|
100 } |
|
101 else |
|
102 if (!aParam->iDefault->Compare(_L("setapps")) ) |
|
103 { |
|
104 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_SETAPPS); |
|
105 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_SETAPPS2); |
|
106 } |
|
107 else |
|
108 if (!aParam->iDefault->Compare(_L("addapps")) ) |
|
109 { |
|
110 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_ADDAPPS); |
|
111 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_ADDAPPS2); |
|
112 } |
|
113 else |
|
114 if (!aParam->iDefault->Compare(_L("removeapps")) ) |
|
115 { |
|
116 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_REMOVEAPPS); |
|
117 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_REMOVEAPPS2); |
|
118 } |
|
119 else |
|
120 if (!aParam->iDefault->Compare(_L("noninteractive")) ) |
|
121 { |
|
122 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_NONINTERACTIVE); |
|
123 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_NONINTERACTIVE1); |
|
124 } |
|
125 else |
|
126 if ( !aParam->iDefault->Compare( _L("expiry") ) ) |
|
127 { |
|
128 // iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_EXPIRY); |
|
129 } |
|
130 else |
|
131 if ( !aParam->iDefault->Compare( _L("page") ) ) |
|
132 { |
|
133 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_PAGE); |
|
134 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE_PAGE2); |
|
135 } |
|
136 else |
|
137 { |
|
138 // Display general usage! |
|
139 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE); |
|
140 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE2); |
|
141 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE3); |
|
142 iController->DisplayLocalisedMsgL(R_CERTTOOL_USAGE4); |
|
143 } |
|
144 } |