|
1 /* |
|
2 * Copyright (c) 2010 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: Library to handle resource loading when |
|
15 * CCoeEnv is not available. |
|
16 */ |
|
17 |
|
18 #ifndef __BASEPLUGINRESOURCELOADER_H__ |
|
19 #define __BASEPLUGINRESOURCELOADER_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 #include <barsc.h> |
|
25 |
|
26 /** |
|
27 * Library to handle resource loading when CCoeEnv is not available. |
|
28 */ |
|
29 class CResourceLoader : public CBase |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * A constructor. |
|
35 * @param aName a resource name |
|
36 * @return created object. |
|
37 */ |
|
38 IMPORT_C static CResourceLoader* NewL( const TDesC& aName ); |
|
39 |
|
40 /** |
|
41 * Destructor |
|
42 */ |
|
43 virtual ~CResourceLoader(); |
|
44 |
|
45 /** |
|
46 * @return reference to opened file session |
|
47 */ |
|
48 IMPORT_C RFs& Fs(); |
|
49 |
|
50 /** |
|
51 * @param aResourceId a resource key |
|
52 * @return resource value from resource, instance ownership is transferred |
|
53 */ |
|
54 IMPORT_C HBufC* LoadLC(TInt aResourceId ); |
|
55 |
|
56 /** |
|
57 * @param aReader a reader |
|
58 * @param aResourceId a resource key |
|
59 * @return pointer to resource buffer placed on leave stack |
|
60 */ |
|
61 IMPORT_C HBufC8* CreateResourceReaderLC( TResourceReader& aReader,TInt aResourceId ) const; |
|
62 |
|
63 private: |
|
64 |
|
65 /** |
|
66 * A constructor |
|
67 */ |
|
68 CResourceLoader(); |
|
69 |
|
70 /** |
|
71 * A 2nd phase constructor |
|
72 * @param aName a HTML macro, e.g. lt |
|
73 */ |
|
74 void ConstructL( const TDesC& aName ); |
|
75 |
|
76 private: |
|
77 |
|
78 RFs iFs; |
|
79 RResourceFile iResFile; |
|
80 }; |
|
81 |
|
82 |
|
83 #endif // __BASEPLUGINRESOURCELOADER_H__ |