|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * loads widget manager resources and icons |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef WMRESOURCELOADER_H_ |
|
21 #define WMRESOURCELOADER_H_ |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CAknStylusPopUpMenu; |
|
28 class CEikonEnv; |
|
29 class CAknButton; |
|
30 class CAknInformationNote; |
|
31 |
|
32 /** |
|
33 * CWmResourceLoader |
|
34 */ |
|
35 NONSHARABLE_CLASS( CWmResourceLoader ) : public CBase |
|
36 { |
|
37 |
|
38 public: // construction/destruction |
|
39 /** |
|
40 * static constructor |
|
41 * |
|
42 * @param aCoeEnv Control environment. |
|
43 */ |
|
44 static CWmResourceLoader* NewL( |
|
45 CEikonEnv& aEnv ); |
|
46 |
|
47 /** destructor */ |
|
48 ~CWmResourceLoader(); |
|
49 |
|
50 public: // services |
|
51 |
|
52 /** |
|
53 * Loads a button from the widgetmanager resource file |
|
54 * using CAknButton::ConstructFromResourceL |
|
55 * |
|
56 * @param aResource handle to the empty button instance |
|
57 * @param aResourceId ID of the resource to use in loading |
|
58 */ |
|
59 void LoadButtonL( |
|
60 CAknButton& aResource, |
|
61 TInt aResourceId ); |
|
62 |
|
63 /** |
|
64 * shows a simple info popup with OK button |
|
65 * @param aResourceId the resource id of string to be shown |
|
66 * @param aString additional string to be replaced into %U |
|
67 */ |
|
68 void InfoPopupL( TInt aResourceId, const TDesC& aString ); |
|
69 |
|
70 /** |
|
71 * shows a standard error popup |
|
72 * @param aErrorCode a system-wide standard error code |
|
73 */ |
|
74 void ErrorPopup( TInt aErrorCode ); |
|
75 |
|
76 /** icon file path */ |
|
77 const TDesC& IconFilePath(); |
|
78 |
|
79 /** default no description text */ |
|
80 const TDesC& NoDescriptionText(); |
|
81 |
|
82 private: // internal methods |
|
83 |
|
84 /** constructor */ |
|
85 CWmResourceLoader( |
|
86 CEikonEnv& aEnv ); |
|
87 |
|
88 /** 2nd phase constructor */ |
|
89 void ConstructL(); |
|
90 |
|
91 /** load the resource */ |
|
92 void LoadResourcesL(); |
|
93 |
|
94 /** free resources */ |
|
95 void UnloadResources(); |
|
96 |
|
97 /** find icon file path */ |
|
98 void DetermineIconFilePath(); |
|
99 |
|
100 private: // members |
|
101 |
|
102 /** |
|
103 * the environment |
|
104 */ |
|
105 CEikonEnv& iEnv; |
|
106 |
|
107 /** |
|
108 * name of this DLL |
|
109 */ |
|
110 TFileName iDllName; |
|
111 |
|
112 /** |
|
113 * resource file offset |
|
114 */ |
|
115 TInt iResourceFileOffset; |
|
116 |
|
117 /** |
|
118 * ICON file |
|
119 */ |
|
120 TFileName iMifFile; |
|
121 |
|
122 /** |
|
123 * info note dialog |
|
124 */ |
|
125 CAknInformationNote *iNote; |
|
126 |
|
127 /** |
|
128 * Default description text |
|
129 */ |
|
130 HBufC* iDescription; |
|
131 }; |
|
132 |
|
133 #endif // WMRESOURCELOADER_H_ |