|
1 /* |
|
2 * Copyright (c) 2009-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: External rendering plugin adapter |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef XNEXTRENDERINGPLUGINADAPTER_H |
|
19 #define XNEXTRENDERINGPLUGINADAPTER_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <ecom/ecom.h> |
|
24 #include <coecntrl.h> |
|
25 |
|
26 // User includes |
|
27 |
|
28 class MXnExtEventHandler; |
|
29 |
|
30 /** |
|
31 * Base class for the external rendering plug-ins. Widget developer |
|
32 * can implement own rendering plug-in if stock plug-ins do not |
|
33 * provide sufficient functionality. Baddly written plug-in can |
|
34 * ruin the Homescreen performance as it runs in the Homescreen |
|
35 * process. Power save mode must be obeyed in order to maximize |
|
36 * the standby times of the device. |
|
37 * |
|
38 * @code |
|
39 * // External rendering plug-in mandatory functions |
|
40 * T_RenderingPlugin* T_RenderingPlugin::NewL() |
|
41 * { |
|
42 * T_RenderingPlugin* self = T_RenderingPlugin::NewLC(); |
|
43 * CleanupStack::Pop( self ); |
|
44 * return self; |
|
45 * } |
|
46 * // |
|
47 * T_RenderingPlugin* T_RenderingPlugin::NewLC() |
|
48 * { |
|
49 * T_RenderingPlugin* self = new( ELeave ) T_RenderingPlugin(); |
|
50 * CleanupStack::PushL( self ); |
|
51 * self->ConstructL(); |
|
52 * return self; |
|
53 * } |
|
54 * // |
|
55 * T_RenderingPlugin::~T_RenderingPlugin() |
|
56 * { |
|
57 * } |
|
58 * // |
|
59 * T_RenderingPlugin::T_RenderingPlugin() |
|
60 * { |
|
61 * // Do nothing |
|
62 * } |
|
63 * // |
|
64 * void T_RenderingPlugin::ConstructL() |
|
65 * { |
|
66 * } |
|
67 * // |
|
68 * const TImplementationProxy KImplementationTable[] = |
|
69 * { |
|
70 * #ifdef __EABI__ |
|
71 * IMPLEMENTATION_PROXY_ENTRY( 0x22334455, T_RenderingPlugin::NewL ) |
|
72 * #else |
|
73 * { { 0x22334455 }, T_RenderingPlugin::NewL } |
|
74 * #endif |
|
75 * }; |
|
76 * // |
|
77 * EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
|
78 * TInt& aTableCount ) |
|
79 * { |
|
80 * aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); |
|
81 * return KImplementationTable; |
|
82 * } |
|
83 * |
|
84 * @endcode |
|
85 * |
|
86 * @lib extrenderingplugin.lib |
|
87 * @since S60 v5.2 |
|
88 */ |
|
89 class CXnExtRenderingPluginAdapter : public CCoeControl |
|
90 { |
|
91 public: // Constructor and destructor |
|
92 /** |
|
93 * Two-phased constructor. |
|
94 * |
|
95 * @since Series 60 5.2 |
|
96 */ |
|
97 IMPORT_C static CXnExtRenderingPluginAdapter* NewL( TUid aImplUid ); |
|
98 |
|
99 /** |
|
100 * Destructor. |
|
101 * |
|
102 * @since Series 60 5.2 |
|
103 */ |
|
104 IMPORT_C virtual ~CXnExtRenderingPluginAdapter(); |
|
105 |
|
106 public: // New functions, |
|
107 |
|
108 /** |
|
109 * Returns the ECOM implementation uid. |
|
110 * |
|
111 * @since Series 60 5.2 |
|
112 */ |
|
113 IMPORT_C TUid ImplUid() const; |
|
114 |
|
115 /** |
|
116 * Is called when Homescreen enters power save mode. |
|
117 * In power save mode all the timers, outstanding requests and animations |
|
118 * must be cancelled in order to save battery. |
|
119 * |
|
120 * @since Series 60 5.2 |
|
121 */ |
|
122 IMPORT_C virtual void EnterPowerSaveModeL(); |
|
123 |
|
124 /** |
|
125 * Is called when Homescreen exists power save mode. |
|
126 * |
|
127 * @since Series 60 5.2 |
|
128 */ |
|
129 IMPORT_C virtual void ExitPowerSaveModeL(); |
|
130 |
|
131 /** |
|
132 * Informs skin change. If plug-in is responsible of loading skin |
|
133 * graphics, all the graphics must be reloaded. |
|
134 * |
|
135 * @since Series 60 5.2 |
|
136 */ |
|
137 IMPORT_C virtual void SkinChanged(); |
|
138 |
|
139 /** |
|
140 * Informs that plug-in element has gained a focus and highlight must be |
|
141 * drawn if appropriate. |
|
142 * |
|
143 * @since Series 60 5.2 |
|
144 * @param aDrawNow whether plug-in should draw itself. |
|
145 */ |
|
146 IMPORT_C virtual void FocusChanged( TDrawNow aDrawNow ); |
|
147 |
|
148 /** |
|
149 * Informs that plug-in element size has changed. Size can change if the |
|
150 * plug-in element is declared relatively to parent element. |
|
151 * |
|
152 * @since Series 60 5.2 |
|
153 */ |
|
154 IMPORT_C virtual void SizeChanged(); |
|
155 |
|
156 /** |
|
157 * Sets the external event handler interface. |
|
158 * |
|
159 * @since Series 60 5.2 |
|
160 * @param aEventHandler Event handler interface. |
|
161 */ |
|
162 IMPORT_C virtual void SetEventHandler( MXnExtEventHandler* aEventHandler ); |
|
163 |
|
164 /** |
|
165 * Routes the data stream for the external rendering plugin. |
|
166 * |
|
167 * @since Series 60 5.2 |
|
168 * @param aData Data stream. |
|
169 * @param aType Type of the stream. |
|
170 * @param aIndex Index of the data. |
|
171 */ |
|
172 IMPORT_C virtual void SetDataL( const TDesC8& aData, const TDesC& aType, TInt aIndex ); |
|
173 |
|
174 private: // Data |
|
175 |
|
176 /** |
|
177 * Destruct key |
|
178 */ |
|
179 TUid iDestructKey; |
|
180 |
|
181 /** |
|
182 * Implementation UID |
|
183 */ |
|
184 TUid iImplUid; |
|
185 }; |
|
186 |
|
187 |
|
188 #endif // XNEXTRENDERINGPLUGINADAPTER_H |
|
189 |
|
190 // End of file |