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