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