|
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 "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 * ctlbsinstallui.h |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __CTLBS_INSTALL_UI_H__ |
|
21 #define __CTLBS_INSTALL_UI_H__ |
|
22 |
|
23 |
|
24 #include <swi/msisuihandlers.h> |
|
25 #include <test/testexecutelogger.h> |
|
26 |
|
27 using namespace Swi; |
|
28 |
|
29 const TInt KBufSize = 5; |
|
30 |
|
31 enum TFunctions{ |
|
32 EScript = 0, |
|
33 EDisplayInstall, |
|
34 EDisplayGrantCapabilities, |
|
35 EDisplayLanguage, |
|
36 EDisplayDrive, |
|
37 EDisplayUpgrade, |
|
38 EDisplayOptions, |
|
39 EHandleInstallEvent, |
|
40 EHandleCancellableInstallEvent, |
|
41 EDisplaySecurityWarning, |
|
42 EDisplayOcspResult, |
|
43 EDisplayCannotOverwriteFile, |
|
44 EDisplayUninstall, |
|
45 EDisplayText, |
|
46 EDisplayError, |
|
47 EDisplayDependencyBreak, |
|
48 EDisplayApplicationsInUse, |
|
49 EDisplayQuestion, |
|
50 EDisplayMissingDependency, |
|
51 }; |
|
52 |
|
53 enum TLeveltags{ |
|
54 EItemIndex =1, |
|
55 EReturn |
|
56 }; |
|
57 |
|
58 |
|
59 class CUISisAdaptor : public CBase, public MUiHandler |
|
60 { |
|
61 public: |
|
62 ~CUISisAdaptor(); |
|
63 static CUISisAdaptor* NewL(CTestExecuteLogger& aLogger); |
|
64 static CUISisAdaptor* NewLC(CTestExecuteLogger& aLogger); |
|
65 |
|
66 /// Displays install dialog, logging all incoming information. |
|
67 TBool DisplayInstallL(const CAppInfo& aAppInfo, |
|
68 const CApaMaskedBitmap* aLogo, |
|
69 const RPointerArray<CCertificateInfo>& aCertificates); |
|
70 |
|
71 TBool DisplayGrantCapabilitiesL(const CAppInfo& aAppInfo, |
|
72 const TCapabilitySet& aCapabilitySet); |
|
73 |
|
74 TInt DisplayLanguageL(const CAppInfo& aAppInfo, |
|
75 const RArray<TLanguage>& aLanguages); |
|
76 |
|
77 TInt DisplayDriveL(const CAppInfo& aAppInfo,TInt64 aSize, |
|
78 const RArray<TChar>& aDriveLetters, |
|
79 const RArray<TInt64>& aDriveSpaces); |
|
80 |
|
81 TBool DisplayUpgradeL(const CAppInfo& aAppInfo, |
|
82 const CAppInfo& aExistingAppInfo); |
|
83 |
|
84 TBool DisplayOptionsL(const CAppInfo& aAppInfo, |
|
85 const RPointerArray<TDesC>& aOptions, |
|
86 RArray<TBool>& aSelections); |
|
87 |
|
88 TBool HandleInstallEventL(const CAppInfo& aAppInfo, |
|
89 TInstallEvent aEvent, TInt aValue=0, |
|
90 const TDesC& aDes=KNullDesC); |
|
91 |
|
92 void HandleCancellableInstallEventL(const CAppInfo& aAppInfo, |
|
93 TInstallCancellableEvent aEvent, |
|
94 MCancelHandler& aCancelHandler,TInt aValue=0, |
|
95 const TDesC& aDes=KNullDesC); |
|
96 |
|
97 TBool DisplaySecurityWarningL(const CAppInfo& aAppInfo, |
|
98 TSignatureValidationResult aSigValidationResult, |
|
99 RPointerArray<CPKIXValidationResultBase>& aPkixResults, |
|
100 RPointerArray<CCertificateInfo>& aCertificates, |
|
101 TBool aInstallAnyway); |
|
102 |
|
103 TBool DisplayOcspResultL(const CAppInfo& aAppInfo, |
|
104 TRevocationDialogMessage aMessage, |
|
105 RPointerArray<TOCSPOutcome>& aOutcomes, |
|
106 RPointerArray<CCertificateInfo>& aCertificates, |
|
107 TBool aWarningOnly); |
|
108 |
|
109 void DisplayCannotOverwriteFileL(const CAppInfo& aAppInfo, |
|
110 const CAppInfo& aInstalledAppInfo, |
|
111 const TDesC& aFileName); |
|
112 |
|
113 TBool DisplayUninstallL(const CAppInfo& aAppInfo); |
|
114 |
|
115 TBool DisplayTextL(const CAppInfo& aAppInfo, |
|
116 TFileTextOption aOption, |
|
117 const TDesC& aText); |
|
118 |
|
119 void DisplayErrorL(const CAppInfo& aAppInfo, |
|
120 TErrorDialog aType, |
|
121 const TDesC& aParam); |
|
122 |
|
123 TBool DisplayDependencyBreakL(const CAppInfo& aAppInfo, |
|
124 const RPointerArray<TDesC>& aComponents); |
|
125 |
|
126 TBool DisplayApplicationsInUseL(const CAppInfo& aAppInfo, |
|
127 const RPointerArray<TDesC>& aAppNames); |
|
128 |
|
129 TBool DisplayQuestionL(const CAppInfo& aAppInfo, |
|
130 TQuestionDialog aQuestion, const TDesC& aDes=KNullDesC); |
|
131 |
|
132 TBool DisplayMissingDependencyL(const CAppInfo& aAppInfo, |
|
133 const TDesC& aDependencyName,TVersion aWantedVersionFrom, |
|
134 TVersion aWantedVersionTo,TVersion aInstalledVersion); |
|
135 |
|
136 // functions to handle displaying info to file |
|
137 void DisplayAppInfo(const TDesC& aPreText, const CAppInfo& aAppInfo); |
|
138 void DisplayBoolReturn(TBool aReturn); |
|
139 void DisplayIntReturn(TInt aReturn); |
|
140 |
|
141 // function to check progress bar |
|
142 void CheckFinalProgressBarL(); |
|
143 |
|
144 // Function that aborts a test case when the expected |
|
145 // installation size does not match the calculated size. |
|
146 void CheckExpectedAndCalculatedInstallSizesL(const TDesC& aAppInfoName, TInt64 aSize); |
|
147 |
|
148 // function to check if certain dialogs have been called |
|
149 TBool GrantUserCapsDialogCalled() const; |
|
150 |
|
151 /// Use to enable and disable cancel testing inside dialogs |
|
152 void SetCancelDialogTesting(TBool aCancelTesting = ETrue); |
|
153 |
|
154 // Set the dialog number to cancel on |
|
155 void SetCancelDialogNumber(TInt aDialogNumber); |
|
156 |
|
157 /// Use to enable and disable dialog delays (for async cancel testing) |
|
158 void SetDialogDelay(TTimeIntervalMicroSeconds32 aUsec); |
|
159 |
|
160 // Reset the current dialog number, and set iInstallationCancelled to False |
|
161 void ResetCurrentDialogNumber(TInt aDialogNumber = 0); |
|
162 TBool InstallationCancelled() const; |
|
163 |
|
164 // Use the same log macro than testexecute |
|
165 inline CTestExecuteLogger& Logger() {return iLogger;}; |
|
166 |
|
167 private: |
|
168 CUISisAdaptor(); |
|
169 void ConstructL(CTestExecuteLogger& aLogger); |
|
170 void ScriptParseL(); |
|
171 TInt iFinalProgress; |
|
172 TInt iCumulativeProgress; |
|
173 CTestExecuteLogger iLogger; |
|
174 }; |
|
175 |
|
176 #endif // __CTLBS_INSTALL_UI_H__ |