|
1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 #ifndef CA_WIDGET_SCANNER_TEST_UTILS_H |
|
18 #define CA_WIDGET_SCANNER_TEST_UTILS_H |
|
19 //utility class for tests |
|
20 //all utility methods should be implemented here |
|
21 |
|
22 //#include "casrvengutils.h" |
|
23 #include "f32file.h" |
|
24 #include "casrvplugin.h" |
|
25 |
|
26 |
|
27 class CCaStorageProxy; |
|
28 class CCaInnerEntry; |
|
29 class CCaWidgetDescription; |
|
30 |
|
31 class CTestUtils: public CBase |
|
32 { |
|
33 public: |
|
34 |
|
35 /**/ |
|
36 virtual ~CTestUtils(); |
|
37 |
|
38 /**/ |
|
39 static CTestUtils* NewL(); |
|
40 |
|
41 /**/ |
|
42 static CTestUtils* NewLC(); |
|
43 |
|
44 TUint FindAppUidL( const TDesC& aName, CCaStorageProxy* aStorage ); |
|
45 |
|
46 /**/ |
|
47 /**/ |
|
48 TInt SimpleCloseTaskL(TInt aUid); |
|
49 void WaitL(TInt aMicroSec); |
|
50 /**/ |
|
51 void InstallFinishedL(); |
|
52 |
|
53 /** |
|
54 * Copys test Db |
|
55 */ |
|
56 TInt CopyDb(); |
|
57 |
|
58 /** |
|
59 * Checks if app exists in Db |
|
60 */ |
|
61 TInt WidgetsCountL( CCaStorageProxy* aStorage ); |
|
62 |
|
63 TBool WidgetExistsInStorageL( const TDesC& aName, const TDesC& aValue, CCaStorageProxy* aStorage); |
|
64 |
|
65 CCaInnerEntry* GetAppEntryL( TInt aUid, CCaStorageProxy* aStorage); |
|
66 |
|
67 CCaWidgetDescription* GetWidgetEntryL( const TDesC& aText, CCaStorageProxy* aStorage); |
|
68 |
|
69 TInt GetWidgetFlagsL(const TDesC& aText, CCaStorageProxy* aStorage); |
|
70 |
|
71 TInt AppsWithFlagsOffL( TInt aFlags, CCaStorageProxy* aStorage); |
|
72 |
|
73 TInt GetAppFlagsL( TInt aUid, CCaStorageProxy* aStorage); |
|
74 |
|
75 void RemoveAppL( TInt aUid, CCaStorageProxy* aStorage); |
|
76 |
|
77 CCaSrvPlugin* LoadPluginL( TUid aImplUid, TPluginParams* aPluginParams ); |
|
78 |
|
79 /** |
|
80 * Copys files |
|
81 */ |
|
82 TInt Copy( const TDesC& aSource, const TDesC& aDest ); |
|
83 |
|
84 TInt RemoveL( const TDesC& aFile ); |
|
85 |
|
86 private: |
|
87 |
|
88 |
|
89 CTestUtils(); |
|
90 |
|
91 void ConstructL(); |
|
92 |
|
93 RFs iFs; |
|
94 CFileMan* iFileManager; |
|
95 |
|
96 /** |
|
97 * Local Active Sheduler. |
|
98 * Own. |
|
99 */ |
|
100 CActiveSchedulerWait* iActiveWait; |
|
101 |
|
102 }; |
|
103 |
|
104 #endif |