|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 localixed resource file. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef RPBK2LOCALIZEDRESOURCEFILE_H |
|
20 #define RPBK2LOCALIZEDRESOURCEFILE_H |
|
21 |
|
22 #include <barsc.h> |
|
23 |
|
24 class CCoeEnv; |
|
25 |
|
26 /** |
|
27 * Phonebook 2 localixed resource file. |
|
28 */ |
|
29 class RPbk2LocalizedResourceFile : public RResourceFile |
|
30 { |
|
31 public: // Construction and destruction |
|
32 |
|
33 /** |
|
34 * Constructor. Using this constructor the resource file |
|
35 * is added to the CCoeEnv resource files when opened. |
|
36 * Use this from code that always run in process that |
|
37 * has a valid environment (CCoeEnv::Static). |
|
38 * |
|
39 * @param aCoeEnv Reference to Coe environment. |
|
40 */ |
|
41 IMPORT_C RPbk2LocalizedResourceFile( |
|
42 CCoeEnv& aCoeEnv ); |
|
43 |
|
44 /** |
|
45 * Constructor. Opens an own file system session |
|
46 * for reading the resource file. Prefer using |
|
47 * the constructors take the session as input. |
|
48 * |
|
49 * @param aFs an open file system session |
|
50 */ |
|
51 IMPORT_C RPbk2LocalizedResourceFile( RFs* aFs = NULL ); |
|
52 |
|
53 public: // Interface |
|
54 |
|
55 /** |
|
56 * Finds and opens the localized version of the given resource file |
|
57 * and leaves the file to the cleanup stack for closing |
|
58 * by using CleanupStack::PopAndDestroy. |
|
59 * |
|
60 * @param aDrive Drive letter for the resource file, |
|
61 * must also include the colon. |
|
62 * For example "z:". |
|
63 * @param aPath Path to the file name. |
|
64 * @param aFileName Resource file name. |
|
65 * @see BaflUtils::NearestLanguageFile |
|
66 */ |
|
67 IMPORT_C void OpenLC( |
|
68 const TDesC& aDrive, |
|
69 const TDesC& aPath, |
|
70 const TDesC& aFileName ); |
|
71 |
|
72 /** |
|
73 * Finds and opens the localized version of the given resource file. |
|
74 * |
|
75 * @param aDrive Drive letter for the resource file, must also |
|
76 include the colon. For example "z:". |
|
77 * @param aPath Path to the file name. |
|
78 * @param aFileName Resource file name. |
|
79 * @see BaflUtils::NearestLanguageFile |
|
80 */ |
|
81 IMPORT_C void OpenL( |
|
82 const TDesC& aDrive, |
|
83 const TDesC& aPath, |
|
84 const TDesC& aFileName ); |
|
85 |
|
86 /** |
|
87 * Finds and opens the localized version of the given resource file. |
|
88 * |
|
89 * @param aFullPath Full path to the resource file. |
|
90 * @see BaflUtils::NearestLanguageFile |
|
91 */ |
|
92 IMPORT_C void OpenL( |
|
93 const TDesC& aFullPath ); |
|
94 |
|
95 /** |
|
96 * Closes the resource file. |
|
97 */ |
|
98 IMPORT_C void Close(); |
|
99 |
|
100 /** |
|
101 * Returns the offset for this resource file. |
|
102 * |
|
103 * @return Offset for this resource file. |
|
104 */ |
|
105 IMPORT_C TInt Offset(); |
|
106 |
|
107 private: // implementation |
|
108 void EnsureOpenFileSystemSessionL(); |
|
109 |
|
110 private: // Data |
|
111 /// Ref: An open file server session |
|
112 RFs* iFs; |
|
113 /// Own: a file system session in case the client didn't gave one. |
|
114 RFs iOwnFs; |
|
115 /// Ref: Control environment |
|
116 CCoeEnv* iCoeEnv; |
|
117 /// Own: Offset |
|
118 TInt iOffset; |
|
119 }; |
|
120 |
|
121 #endif // RPBK2LOCALIZEDRESOURCEFILE_H |
|
122 |
|
123 // End of File |