|
1 // Copyright (c) 2005-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 |
|
25 #ifndef __APPFWK_TEST_UTILS_H__ |
|
26 #define __APPFWK_TEST_UTILS_H__ |
|
27 |
|
28 #include <e32std.h> |
|
29 |
|
30 typedef TUint8 TWipeItems; |
|
31 TInt E32Main(); |
|
32 |
|
33 _LIT(KTestServerName,"!appfwk_test_utils_server"); |
|
34 _LIT(KTestServerImg,"appfwk_test_utils_server"); |
|
35 |
|
36 |
|
37 enum TSmlProfileTransportType |
|
38 { |
|
39 ELocalTransport, |
|
40 ENetworkTransport, |
|
41 }; |
|
42 |
|
43 class RSmlTestUtils : public RSessionBase |
|
44 { |
|
45 public: |
|
46 IMPORT_C TInt Connect(); |
|
47 IMPORT_C void SetDevIdL(const TDesC8& aDevId); |
|
48 IMPORT_C void GetDevIdL(TDes8& aDevId); |
|
49 IMPORT_C TInt WipeDataStoreL(TWipeItems aItemsToClean); |
|
50 IMPORT_C TInt RenameDirectoryL(const TDesC16& aSrc,const TDesC16& aDest); |
|
51 IMPORT_C TInt CreateDirectoryL(const TDesC& aPath); |
|
52 IMPORT_C TInt DeleteDirectoryL(const TDesC& aPath); |
|
53 IMPORT_C TInt CreateFileL(const TDesC& aPath); |
|
54 IMPORT_C TInt DeleteFileUsingWildcardL(const TDesC& aPath); |
|
55 IMPORT_C TInt DeleteFileL(const TDesC& aPath); |
|
56 IMPORT_C TInt CopyFileL(const TDesC& aSrc,const TDesC& aDest); |
|
57 IMPORT_C TInt ReplaceFileL(const TDesC& aName,TUint aFileMode); |
|
58 IMPORT_C TInt IsFilePresent(const TDesC& aName, TBool &aPresent); |
|
59 IMPORT_C TInt GetAtt( const TDesC &aName, TUint &aAttValue ); |
|
60 IMPORT_C TInt SetAtt( const TDesC &aName, TUint aSetAttMask, TUint aClearAttMask ); |
|
61 IMPORT_C void SetHomeTimeL(const TTime aTime); |
|
62 IMPORT_C TInt SetReadOnly(const TDesC& aName,TUint aSetAttMask); |
|
63 IMPORT_C TInt CopyDirectoryL(const TDesC& aSource,const TDesC& aTarget); |
|
64 IMPORT_C TInt ChangeFilePermissionL(const TDesC& aPath); |
|
65 }; |
|
66 |
|
67 enum TSmlTestUtilsService //Services provided by the SmlTestUtils server |
|
68 { |
|
69 EChangeDevId, |
|
70 EGetDevId, |
|
71 EWipeDataStore, |
|
72 ECreateDir, |
|
73 ERenameDir, |
|
74 EDeleteDir, |
|
75 ECreateFile, |
|
76 EDeleteFile, |
|
77 EDeleteFileUsingWildcard, |
|
78 ECreateDSJob, |
|
79 EStopDSJob, |
|
80 ECreateDSProfile, |
|
81 ESetHomeTime, |
|
82 ECopyFile, |
|
83 EReplaceFile, |
|
84 EIsFilePresent, |
|
85 ESetReadOnly, |
|
86 EGetAttributes, |
|
87 ESetAttributes, |
|
88 ECopyDirectory, |
|
89 EChangeFilePermission |
|
90 }; |
|
91 |
|
92 enum TStoreType //Types of store that can be deleted using WipeDataStoreL() |
|
93 { |
|
94 ECenRep = 0x01, |
|
95 ELocalSDS = 0x02, |
|
96 EDMTree = 0x04, |
|
97 ECenRepFiles = 0x08,// Deletes all the cen rep data files. This is a lengthy and volatile operation |
|
98 // and should be used with caution. Note that this is not covered by "EAll" |
|
99 // and should be called explicitly |
|
100 ESDS = ELocalSDS | ECenRep, |
|
101 EAll = 0xff |
|
102 }; |
|
103 |
|
104 #endif // __APPFWK_TEST_UTILS_SERVER_H__ |