|
1 /* |
|
2 * Copyright (c) 2002,2003 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: Loads resources from file. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPSUIRESOURCELOADER_H |
|
20 #define CPSUIRESOURCELOADER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class RConeResourceLoader; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * A helper class for loading dll-specific resource files on demand. |
|
32 * Searches and loads the specified resource file to the CONE environment |
|
33 * (CCoeEnv) -object (accessible as iCoeEnv in CONE-related classes). |
|
34 * After calling NewL the user can access the resources directly via |
|
35 * the CONE environment. The resources in the file are accessible until |
|
36 * the CPsuiResourceLoader object is destroyed. The resource file must be |
|
37 * a well-formed UIKON resource file with NAME and RSS_SIGNATURE specified. |
|
38 * |
|
39 * @lib psui.lib |
|
40 * @since 1.0 |
|
41 */ |
|
42 class CPsuiResourceLoader : public CBase |
|
43 { |
|
44 public: // Constructors & destructor |
|
45 |
|
46 /** |
|
47 * Symbian OS 1st phase constructor. Creates and returns a new |
|
48 * resource loader object. |
|
49 * Loads resource from any drive. If this function is succesful |
|
50 * (doesn't leave) the resources in the file are usable through |
|
51 * CCoeEnv. |
|
52 * |
|
53 * @return new object of this class holding a reference to the |
|
54 * resource file. |
|
55 * |
|
56 * @exception KErrNotFound if the resource file is not found. |
|
57 * @exception KErrNoMemory if out of memory. |
|
58 * @exception error from CCoeEnv::AddResourceFileL. |
|
59 */ |
|
60 IMPORT_C static CPsuiResourceLoader* NewL(); |
|
61 |
|
62 /** |
|
63 * Same as NewL, but leaves the created object onto the cleanup stack. |
|
64 * @see NewL |
|
65 */ |
|
66 IMPORT_C static CPsuiResourceLoader* NewLC(); |
|
67 |
|
68 /* Destructor */ |
|
69 ~CPsuiResourceLoader(); |
|
70 |
|
71 protected: // private constructor |
|
72 |
|
73 void ConstructL(); |
|
74 |
|
75 private: // member variables |
|
76 |
|
77 // CONE resource loader |
|
78 RConeResourceLoader* iResourceLoader; |
|
79 }; |
|
80 |
|
81 #endif // CPSUIRESOURCELOADER_H |
|
82 |
|
83 // End of File |
|
84 |