|
1 // Copyright (c) 2006-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 */ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <f32file.h> // RFs |
|
24 #include <barsc.h> // RResourceFile |
|
25 #include <bautils.h> // Bafl:: |
|
26 #include <msvutils.h> |
|
27 #include <imcvtext.h> |
|
28 #include "local_imutdll.h" |
|
29 |
|
30 #include <miuthdr.h> // resource file name |
|
31 |
|
32 _LIT(KMTFName,"Messaging Test Framework"); |
|
33 |
|
34 |
|
35 /** |
|
36 OpenResourceFileL() |
|
37 Opens a file using the file server session |
|
38 |
|
39 @param rFile |
|
40 @param anFs |
|
41 */ |
|
42 GLDEF_C void OpenResourceFileL(RResourceFile& rFile, RFs& anFs) |
|
43 { |
|
44 // open resource file |
|
45 TFileName fileName(KImEngineResourceFile); |
|
46 MsvUtils::AddPathAndExtensionToResFileL(fileName); |
|
47 BaflUtils::NearestLanguageFile( anFs, fileName ); |
|
48 if (BaflUtils::FileExists(anFs,fileName)) |
|
49 { |
|
50 rFile.OpenL( anFs, fileName ); |
|
51 return; |
|
52 } |
|
53 |
|
54 User::Leave(KErrNotFound); |
|
55 } |
|
56 |
|
57 |
|
58 /** |
|
59 gPanic() |
|
60 |
|
61 @param aReason |
|
62 @panic |
|
63 */ |
|
64 GLDEF_C void gPanic( TImutErrorReason aReason) |
|
65 { |
|
66 User::Panic( KMTFName,aReason); |
|
67 } |
|
68 |
|
69 |
|
70 /** |
|
71 CloseResourceFile() |
|
72 Closes a opened file |
|
73 |
|
74 @param file |
|
75 */ |
|
76 GLDEF_C void CloseResourceFile( TAny* file ) |
|
77 { |
|
78 ((RResourceFile*)file)->Close(); |
|
79 } |