author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:23:59 +0300 | |
branch | RCL_3 |
changeset 83 | 26b2b12093af |
parent 77 | 7cee158cb8cd |
permissions | -rw-r--r-- |
66 | 1 |
/* |
2 |
* Copyright (c) 1999 - 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: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef LCDUI_H |
|
20 |
#define LCDUI_H |
|
21 |
||
22 |
||
23 |
/** |
|
24 |
* @file |
|
25 |
* @publishedPartner |
|
26 |
* @released |
|
27 |
* |
|
28 |
* This header defines the interfaces that must be implemented for LCDUI. |
|
29 |
* It should be read in conjunction with the MIDP 2.0 specification which |
|
30 |
* will contain more information about the enumerations, for example. |
|
31 |
* |
|
32 |
* The MMIDComponentFactory interface, defined at the end of this file, is |
|
33 |
* the logical starting point to read this file. |
|
34 |
* |
|
35 |
* Most methods can be assumed to be invoked in the "server thread" where a |
|
36 |
* UI environment and its active scheduler will be present. Any method |
|
37 |
* marked as "client side" may also be invoked from a thread that does not have |
|
38 |
* a UI environment or activescheduler. These methods should ensure any shared |
|
39 |
* data strucutures that could be accessed by both the server thread and client |
|
40 |
* thread(s) are protected by suitable locking or atomic update strategies. |
|
41 |
* |
|
42 |
* "Framework" refers to the underlying Java Runtime Environment which invokes |
|
43 |
* the methods defined in these interfaces at the appropriate time and which the |
|
44 |
* the implementor of these interfaces need have no knowledge of. |
|
45 |
* "Implementation" refers to the implementation of these interfaces in the client DLL. |
|
46 |
*/ |
|
47 |
||
48 |
#include <e32def.h> |
|
49 |
#include <badesca.h> |
|
50 |
#include <gdi.h> |
|
51 |
#include <w32std.h> |
|
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
52 |
#include <AknsConstants.h> |
66 | 53 |
|
54 |
#ifdef RD_JAVA_NGA_ENABLED |
|
55 |
#include <EGL/egltypes.h> |
|
56 |
#include "monitor.h" |
|
57 |
#endif // RD_JAVA_NGA_ENABLED |
|
58 |
||
59 |
class MMIDDisplayable; |
|
60 |
class MMIDAlert; |
|
61 |
class MMIDForm; |
|
62 |
class MMIDList; |
|
63 |
class MMIDTextBox; |
|
64 |
||
65 |
class MMIDItem; |
|
66 |
class MMIDImageItem; |
|
67 |
class MMIDStringItem; |
|
68 |
class MMIDDateField; |
|
69 |
class MMIDGauge; |
|
70 |
class MMIDTextField; |
|
71 |
class MMIDChoiceGroup; |
|
72 |
||
73 |
class MMIDTicker; |
|
74 |
class MMIDCommand; |
|
75 |
||
76 |
class MMIDUtils; |
|
77 |
class MMIDEnv; |
|
78 |
class MMIDBufferProcessor; |
|
79 |
class MMIDFont; |
|
80 |
class MMIDImage; |
|
81 |
||
82 |
class CFont; |
|
83 |
class CCoeControl; |
|
84 |
||
85 |
class MMIDToLcduiObserver; |
|
86 |
class MDirectContainer; |
|
87 |
class MUiEventConsumer; |
|
88 |
||
89 |
class MMIDTextEditor; |
|
90 |
class MMIDCanvasGraphicsItem; |
|
91 |
class MMIDCanvasGraphicsItemPainter; |
|
92 |
class MMIDLcduiEventConsumer; |
|
93 |
||
94 |
/** |
|
95 |
* @internalComponent |
|
96 |
*/ |
|
97 |
typedef TAny* TJavaPeer; |
|
98 |
||
99 |
||
100 |
||
101 |
/** |
|
102 |
* Namespaces including constant definitions for MIDlet suite attribute names and attributes values. |
|
103 |
*/ |
|
104 |
namespace LcduiMidletAttributes |
|
105 |
{ |
|
106 |
_LIT(KAttribMIDletName, "MIDlet-Name"); |
|
107 |
_LIT(KAttribMIDletVersion, "MIDlet-Version"); |
|
108 |
_LIT(KAttribMIDletVendor, "MIDlet-Vendor"); |
|
109 |
_LIT(KAttribUIEnhancement, "Nokia-UI-Enhancement"); |
|
110 |
_LIT(KAttribOrigDisplaySize, "Nokia-MIDlet-Original-Display-Size"); |
|
111 |
_LIT(KAttribTargetDisplaySize, "Nokia-MIDlet-Target-Display-Size"); |
|
112 |
_LIT(KAttribNoExitKey, "Nokia-MIDlet-No-Exit"); |
|
113 |
_LIT(KAttribFlipClose, "Nokia-MIDlet-Flip-Close"); |
|
114 |
_LIT(KAttribBackgroundEvent, "Nokia-MIDlet-Background-Event"); |
|
115 |
_LIT(KAttribAllowScalingOnOrientationSwitch, "Nokia-MIDlet-Canvas-Scaling-Orientation-Switch"); |
|
116 |
_LIT(KAttribS60SelectionKeyCompatibility, "Nokia-MIDlet-S60-Selection-Key-Compatibility"); |
|
117 |
_LIT(KAttribAppOrientation, "Nokia-MIDlet-App-Orientation"); |
|
118 |
_LIT(KAttribPointerEventSuppressorValues, "Nokia-MIDlet-Tap-Detection-Options"); |
|
119 |
_LIT(KAttribOskSoftkeysInQwerty, "Nokia-MIDlet-On-Screen-Softkeys-Position"); |
|
120 |
} |
|
121 |
||
122 |
namespace LcduiMidletAttributeValues |
|
123 |
{ |
|
124 |
_LIT(KUIEnhMediaKeys, "musickeyssupported"); |
|
125 |
_LIT(KUIEnhCanvasBackground, "canvashasbackground"); |
|
126 |
_LIT(KUIEnhPopUpTextBox, "popuptextbox"); |
|
127 |
_LIT(KUIEnhFullScreenTextBox, "fullscreentextbox"); |
|
128 |
_LIT(KTrueValue, "true"); |
|
129 |
_LIT(KPauseValue, "pause"); |
|
130 |
_LIT(KRunValue, "run"); |
|
131 |
_LIT(KPortraitValue, "portrait"); |
|
132 |
_LIT(KLandscapeValue, "landscape"); |
|
133 |
_LIT(KPositionBottom, "bottom"); |
|
134 |
_LIT(KPositionRight, "right"); |
|
135 |
} |
|
136 |
||
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
77
diff
changeset
|
137 |
|
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
77
diff
changeset
|
138 |
#ifdef RD_JAVA_S60_RELEASE_9_2 |
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
77
diff
changeset
|
139 |
const TInt KHighlightedItemTextColor = EAknsCIQsnTextColorsCG6; |
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
77
diff
changeset
|
140 |
#else |
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
141 |
const TInt KHighlightedItemTextColor = EAknsCIQsnTextColorsCG8; |
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
77
diff
changeset
|
142 |
#endif // RD_JAVA_S60_RELEASE_9_2 |
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
143 |
const TInt KNonHighlightedItemTextColor = EAknsCIQsnTextColorsCG6; |
66 | 144 |
|
145 |
||
146 |
/** |
|
147 |
* |
|
148 |
* Base class of all LCDUI objects. Concrete classes always implement a |
|
149 |
* subclass of this interface. |
|
150 |
* |
|
151 |
*/ |
|
152 |
class MMIDComponent |
|
153 |
{ |
|
154 |
friend class CMIDToolkit; |
|
155 |
public: |
|
156 |
/** |
|
157 |
* Enumeration of the component type |
|
158 |
*/ |
|
159 |
enum TType |
|
160 |
{ |
|
161 |
EUnknown, |
|
162 |
EImageItem, |
|
163 |
EStringItem, |
|
164 |
EGauge, |
|
165 |
ETextField, |
|
166 |
EChoiceGroup, |
|
167 |
EDateField, |
|
168 |
ECustomItem, |
|
169 |
ESpacer, |
|
170 |
ECanvas, |
|
171 |
EGameCanvas, |
|
172 |
EGraphics, |
|
173 |
EAlert, |
|
174 |
EForm, |
|
175 |
EList, |
|
176 |
ETextBox, |
|
177 |
ETicker, |
|
178 |
EFont, |
|
179 |
ECmd, |
|
180 |
EDisplayableContainer, |
|
181 |
EImage, |
|
182 |
ESprite, |
|
183 |
ETiledLayer, |
|
184 |
EDefaultBackground, |
|
185 |
ECanvasTextEditor, |
|
186 |
ECanvasGraphicsItem, |
|
187 |
ECanvasGraphicsItemPainter, |
|
188 |
ENumTypes // Add types before ENumTypes |
|
189 |
}; |
|
190 |
||
191 |
public: |
|
192 |
/** |
|
193 |
* Invoked by the framework to clean up any resources used by the |
|
194 |
* implementation. Typically, the implementation will do "delete this" |
|
195 |
* but is clearly not restricted to this. |
|
196 |
*/ |
|
197 |
virtual void Dispose() = 0; |
|
198 |
||
199 |
/** |
|
200 |
* This is an aid to the implementation - it is not used by the framework. |
|
201 |
* Not particularly good O-O, but the example implementation makes |
|
202 |
* considerable use of this method to good simplification. |
|
203 |
*/ |
|
204 |
virtual TType Type() const |
|
205 |
{ |
|
206 |
return EUnknown; |
|
207 |
} |
|
208 |
||
209 |
/** |
|
210 |
* Returns buffer processor associated with this component (if any). |
|
211 |
*/ |
|
212 |
virtual MMIDBufferProcessor* Processor() |
|
213 |
{ |
|
214 |
return NULL; |
|
215 |
} |
|
216 |
||
217 |
private: |
|
218 |
/** |
|
219 |
* Inaccessible to the implementation, used by the framework for keeping |
|
220 |
* track of the associated Java object. |
|
221 |
*/ |
|
222 |
TJavaPeer iPeer; |
|
223 |
}; |
|
224 |
||
225 |
#ifdef RD_JAVA_NGA_ENABLED |
|
226 |
/** |
|
227 |
* NGA tension to the Component interface |
|
228 |
* @since S60 9.2 |
|
229 |
*/ |
|
230 |
class MMIDComponentNgaExtension : public MMIDComponent |
|
231 |
{ |
|
232 |
public: |
|
233 |
||
234 |
/** |
|
235 |
* Update EGL content. Called by M3G to request LCDUI canvas to update |
|
236 |
* EGL surface with 2D content. |
|
237 |
* @since S60 9.2 |
|
238 |
*/ |
|
239 |
virtual void UpdateEglContent() = 0; |
|
240 |
||
241 |
/** |
|
242 |
* Checks if EGL is available. |
|
243 |
* @return <code>ETrue</code> if EGL exists. |
|
244 |
* @since S60 9.2 |
|
245 |
*/ |
|
246 |
virtual TBool IsEglAvailable() const = 0; |
|
247 |
||
248 |
/** |
|
249 |
* Gets and binds EGL surface. |
|
250 |
* @return surface handle. <code>EGL_NO_SURFACE</code> is |
|
251 |
* returned if binding is not possible. |
|
252 |
* @since S60 9.2 |
|
253 |
* @see MMIDComponentNga#ReleaseEglSurface |
|
254 |
*/ |
|
255 |
virtual EGLSurface BindEglSurface() = 0; |
|
256 |
||
257 |
/** |
|
258 |
* Release EGL surface |
|
259 |
* @since S60 9.2 |
|
260 |
*/ |
|
261 |
virtual void ReleaseEglSurface() = 0; |
|
262 |
||
263 |
/** |
|
264 |
* Update offscreen bitmap i.e. canvas frame buffer |
|
265 |
* @param aForced If true, off-screen bitmap is updated without |
|
266 |
* checking Canvas type (Canvas/GameCanvas) |
|
267 |
* @since S60 9.2 |
|
268 |
*/ |
|
269 |
virtual void UpdateOffScreenBitmapL(TBool aForced) = 0; |
|
270 |
||
271 |
/** |
|
272 |
* Fills EGL surface |
|
273 |
* @param aRect The area to be filled |
|
274 |
* @param aColor The fill color |
|
275 |
* @since S60 9.2 |
|
276 |
*/ |
|
277 |
virtual TBool FillEglSurface(const TRect& aRect, const TRgb& aColor) = 0; |
|
278 |
||
279 |
}; |
|
280 |
#endif // RD_JAVA_NGA_ENABLED |
|
281 |
||
282 |
/** |
|
283 |
* |
|
284 |
* Interface to Command |
|
285 |
* |
|
286 |
*/ |
|
287 |
class MMIDCommand : public MMIDComponent |
|
288 |
{ |
|
289 |
public: |
|
290 |
/** |
|
291 |
* This is the type passed into the plugin factory CreateCommand method |
|
292 |
*/ |
|
293 |
enum TCommandType |
|
294 |
{ |
|
295 |
EScreen=1, |
|
296 |
EBack, |
|
297 |
ECancel, |
|
298 |
EOk, |
|
299 |
EHelp, |
|
300 |
EStop, |
|
301 |
EExit, |
|
302 |
EItem |
|
303 |
}; |
|
304 |
||
305 |
/** |
|
306 |
* Native command peer identifiers. |
|
307 |
*/ |
|
308 |
enum TCommandID |
|
309 |
{ |
|
310 |
ENullCommand=0, // null |
|
311 |
EAlertDismissCommand=1, // Alert.DISMISS_COMMAND |
|
312 |
EListSelectCommand=2, // List.SELECT_COMMAND |
|
313 |
EUserCommandBase=4 // Base id for application commands. |
|
314 |
}; |
|
315 |
public: |
|
316 |
/** |
|
317 |
* Returns the human readable displayable text associated with the command. |
|
318 |
* @return A descriptor containing the text. |
|
319 |
*/ |
|
320 |
virtual const TDesC& Label() const = 0; |
|
321 |
virtual TCommandType CommandType() const = 0; |
|
322 |
virtual TInt Priority() const = 0; |
|
323 |
virtual TInt Id() const = 0; |
|
324 |
||
325 |
public: |
|
326 |
/** |
|
327 |
* Returns the component type. |
|
328 |
* @return The component type as a MMIDComponent::TType enum. |
|
329 |
*/ |
|
330 |
TType Type() const |
|
331 |
{ |
|
332 |
return ECmd; |
|
333 |
} |
|
334 |
}; |
|
335 |
||
336 |
/** |
|
337 |
* |
|
338 |
* Base class of all Items. |
|
339 |
* |
|
340 |
* MMIDForm::RefreshItemL() is generally called following any method calls |
|
341 |
* which result in the item changing its appearance, e.g. size, label, layout or |
|
342 |
* content changed which may mean that the Item's min size has changed. Hence |
|
343 |
* the concrete implementation of Item does not need to refresh the Form's |
|
344 |
* appearance itself. |
|
345 |
* |
|
346 |
*/ |
|
347 |
class MMIDItem : public MMIDComponent |
|
348 |
{ |
|
349 |
public: |
|
350 |
/** |
|
351 |
* Used to describe the positioning of Item within the form. |
|
352 |
* Used by the form layout. |
|
353 |
*/ |
|
354 |
enum TLayout |
|
355 |
{ |
|
356 |
EDefault = 0, |
|
357 |
ELeft, |
|
358 |
ERight, |
|
359 |
ECenter, |
|
360 |
// |
|
361 |
ETop = 0x10, |
|
362 |
EBottom = 0x20, |
|
363 |
EVerticalCenter = 0x30, |
|
364 |
// |
|
365 |
ENewLineBefore = 0x100, |
|
366 |
ENewLineAfter = 0x200, |
|
367 |
// |
|
368 |
EShrink = 0x400, |
|
369 |
EExpand = 0x800, |
|
370 |
EVerticalShrink = 0x1000, |
|
371 |
EVerticalExpand = 0x2000, |
|
372 |
ELayout2 = 0x4000 |
|
373 |
}; |
|
374 |
/** |
|
375 |
* Used only in StringItem & ImageItem |
|
376 |
*/ |
|
377 |
enum TAppearance |
|
378 |
{ |
|
379 |
EPlain, /** Item has normal appearance */ |
|
380 |
EHyperLink, /** Item appears as a hyperlink */ |
|
381 |
EButton /** Item appears as a button */ |
|
382 |
}; |
|
383 |
public: |
|
384 |
/** |
|
385 |
* Since the following methods are followed by MMIDForm::RefreshItemL(), |
|
386 |
* a reasonable implementation strategy could be to just cache the values |
|
387 |
* and calculate/redisplay on the refresh. These methods are invoked server |
|
388 |
* side, nonetheless, so the alternative strategy can be followed. |
|
389 |
*/ |
|
390 |
||
391 |
/** |
|
392 |
* Sets the Item's label. |
|
393 |
* @param aLabel |
|
394 |
* A descriptor containing the label text. |
|
395 |
*/ |
|
396 |
virtual void SetLabelL(const TDesC& aLabel) = 0; |
|
397 |
||
398 |
/** |
|
399 |
* Sets the Item's layout. |
|
400 |
* @param aLayout |
|
401 |
* A TLayout enumeration describing the desired layout. |
|
402 |
*/ |
|
403 |
virtual void SetLayoutL(TLayout aLayout) = 0; |
|
404 |
||
405 |
/** |
|
406 |
* Commands are always referred to by their index. This is their position in |
|
407 |
* an array where 0 is the first command added and (number of commands -1) |
|
408 |
* is the last added. Removing commands has the obvious re-numbering of commands |
|
409 |
* which follow in order. In effect, the implementation should store them in a |
|
410 |
* similar structure regardless of how they are ordered on the display. |
|
411 |
* |
|
412 |
* If the item is actually visible on the display (e.g. CBA button), and |
|
413 |
* this call affects the set of visible commands, the implementation |
|
414 |
* should update the display as soon as it is feasible to do so. |
|
415 |
*/ |
|
416 |
||
417 |
/** |
|
418 |
* Adds a command to the list at the specified index. If aIndex is zero, |
|
419 |
* the command is added at the head of the list. |
|
420 |
* @param aIndex |
|
421 |
* The position at which to insert the command. |
|
422 |
* @param aCommand |
|
423 |
* The command to add. |
|
424 |
*/ |
|
425 |
virtual void AddCommandL(MMIDCommand* aCommand) = 0; |
|
426 |
||
427 |
/** |
|
428 |
* Removes the command specified by the given index. |
|
429 |
* @param aIndex |
|
430 |
* The position from which to remove the command. |
|
431 |
*/ |
|
432 |
virtual void RemoveCommand(MMIDCommand* aCommand) = 0; |
|
433 |
||
434 |
/** |
|
435 |
* Sets the default command to be aIndex, where aIndex is the index of a command |
|
436 |
* which has already been added via AddCommandL(). If aIndex = -1, then |
|
437 |
* there should be no default command set. |
|
438 |
* @param aIndex |
|
439 |
* The index of the command to set. |
|
440 |
*/ |
|
441 |
virtual void SetDefaultCommand(MMIDCommand*) = 0; |
|
442 |
||
443 |
/** |
|
444 |
* aSize could have either/both iWidth and iHeight = -1. |
|
445 |
* This means that the width/height should be computed based |
|
446 |
* on the item's contents . |
|
447 |
* @param aSize |
|
448 |
* Structure representing the preferred size. |
|
449 |
*/ |
|
450 |
virtual void SetPreferredSizeL(const TSize& aSize) = 0; |
|
451 |
||
452 |
/* |
|
453 |
* Return the sizes as per MIDP 2.0 spec |
|
454 |
*/ |
|
455 |
||
456 |
/** |
|
457 |
* Returns the Item's preferred size. |
|
458 |
* @return The preferred size. |
|
459 |
*/ |
|
460 |
virtual TSize PreferredSize() const = 0; |
|
461 |
||
462 |
/** |
|
463 |
* Returns the Item's minimum size. |
|
464 |
* @return The minimum size. |
|
465 |
*/ |
|
466 |
virtual TSize MinimumSize() const = 0; |
|
467 |
}; |
|
468 |
||
469 |
/** |
|
470 |
* Displayable container window created before the actual content (e.g. List/Canvas etc) |
|
471 |
* is called before CreateListL() in the factory). |
|
472 |
* |
|
473 |
* It is envisioned that the concrete implementation of MMIDDisplayable |
|
474 |
* is a container for the actual Displayable in which to hang commands, title bar |
|
475 |
* etc. |
|
476 |
* |
|
477 |
* Do not subclass from both MMIDDisplayable and one of the content types (e.g. MMIDList, MMIDForm) |
|
478 |
* in the same implementation class. |
|
479 |
* |
|
480 |
*/ |
|
481 |
class MMIDDisplayable : public MMIDComponent |
|
482 |
{ |
|
483 |
public: |
|
484 |
/** |
|
485 |
* Sets the Displayable's title. |
|
486 |
* @param aTitle |
|
487 |
* A descriptor containing the title text, may be NULL indicating |
|
488 |
* that the displayable should hide the titlebar. |
|
489 |
*/ |
|
490 |
virtual void SetTitleL(const TDesC* aTitle) = 0; |
|
491 |
||
492 |
/** |
|
493 |
* Sets the Displayable's ticker, replacing any previous ticker. |
|
494 |
* The Ticker could be null, in which case no ticker is displayed. |
|
495 |
* @param aTicker |
|
496 |
* The ticker to associate with the Displayable. |
|
497 |
*/ |
|
498 |
virtual void SetTickerL(MMIDTicker* aTicker) = 0; |
|
499 |
||
500 |
/** |
|
501 |
* Returns the current ticker, or null if there is none set |
|
502 |
* @return The ticker. |
|
503 |
*/ |
|
504 |
virtual MMIDTicker* Ticker() const = 0; |
|
505 |
||
506 |
/* |
|
507 |
* Commands are always referred to by their index. This is their position in |
|
508 |
* an array. The Commands will be inserted into the array in order of priority. |
|
509 |
* Removing commands has the obvious re-numbering of commands which follow in |
|
510 |
* order. In effect, the implementation should store them in a similar structure. |
|
511 |
* |
|
512 |
* If the item is actually visible on the display (e.g. CBA button), and |
|
513 |
* this call affects the set of visible commands, the implementation |
|
514 |
* should update the display as soon as it is feasible to do so. |
|
515 |
* |
|
516 |
* Adds a command to the list at the specified index. If aIndex is zero, |
|
517 |
* the command is added at the head of the list. |
|
518 |
* @param aIndex |
|
519 |
* The position at which to insert the command. |
|
520 |
* @param aCommand |
|
521 |
* The command to add. |
|
522 |
*/ |
|
523 |
virtual void AddCommandL(MMIDCommand* aCommand) = 0; |
|
524 |
||
525 |
/** |
|
526 |
* Removes the command specified by the given index. |
|
527 |
* @param aIndex |
|
528 |
* The position from which to remove the command. |
|
529 |
*/ |
|
530 |
virtual void RemoveCommand(MMIDCommand* aCommand) = 0; |
|
531 |
||
532 |
/** |
|
533 |
* Returns the size of the displayable content. |
|
534 |
* @return The size of the displayable content. |
|
535 |
*/ |
|
536 |
virtual TSize ContentSize() const = 0; |
|
537 |
||
538 |
/** |
|
539 |
* Called when the receiving object has either just become or just |
|
540 |
* ceased to be the current Displayable. The receiving object is |
|
541 |
* expected to do the following: |
|
542 |
* |
|
543 |
* @param aCurrent |
|
544 |
* If aCurrent is ETrue, the receiving object should allocate any |
|
545 |
* resources it needs to display its content and commands. It should |
|
546 |
* also enable event sources. |
|
547 |
* Enabling event sources may include adding a control to the control |
|
548 |
* stack, creating menus or toolbars to generate command events and |
|
549 |
* making a control visible. |
|
550 |
* If this method leaves the framework will abort making the |
|
551 |
* receiving object current. |
|
552 |
* If aCurrent is EFalse, the receiving object should disable events |
|
553 |
* and make itself invisible. Leaves are ignored by the framework when |
|
554 |
* aCurrent is EFalse. |
|
555 |
* Regardless of the value of aCurrent, the receiving object is responsible |
|
556 |
* for returning itself to a consistent state should this method leave. |
|
557 |
* |
|
558 |
*/ |
|
559 |
virtual void HandleCurrentL(TBool aCurrent) = 0; |
|
560 |
||
561 |
/** |
|
562 |
* Set the component that is the displayable content. |
|
563 |
* The component here is the actual displayable which resides within this |
|
564 |
* container. |
|
565 |
* @param aComponent |
|
566 |
* Reference to the component to set. |
|
567 |
*/ |
|
568 |
virtual void SetComponentL(MMIDComponent& aComponent) = 0; |
|
569 |
||
570 |
/** |
|
571 |
* Get the component that is the displayable content. |
|
572 |
* The component here is the actual displayable which resides within this |
|
573 |
* container. |
|
574 |
* @return A pointer to the returned component. |
|
575 |
*/ |
|
576 |
virtual MMIDComponent* Component() const = 0; |
|
577 |
||
578 |
/** |
|
579 |
* Controls whether the displayable should be in full-screen mode or in normal mode. |
|
580 |
* Only gets called for Canvases. Typically, the implementation would remove the |
|
581 |
* title bar in full screen mode. |
|
582 |
* @param aFullScreen |
|
583 |
* If ETrue, sets the Displayable to full screen mode, otherwise |
|
584 |
* sets it to normal mode. |
|
585 |
*/ |
|
586 |
virtual void SetFullScreenModeL(TBool aFullScreen) = 0; |
|
587 |
||
588 |
/** |
|
589 |
* Controls whether the displayable has or has no CommandListener. |
|
590 |
* Only gets called for Canvases. Typically, the implementation sets a bool. |
|
591 |
* @param aExistence |
|
592 |
* If ETrue, The CommandListener is set, otherwise there is no |
|
593 |
* CommandListener |
|
594 |
*/ |
|
595 |
virtual void SetCommandListenerExistence(TBool /*aExistence*/) |
|
596 |
{ |
|
597 |
; |
|
598 |
} |
|
599 |
||
600 |
/** |
|
601 |
* Gets a soft key label location and size for displayable, which does support it |
|
602 |
* @param aSoftKeyId - a constant identifying the softkey |
|
603 |
* @param aPosition - returned top left position of soft key label |
|
604 |
* @param aSize - returned size of soft ket label |
|
605 |
* @return false if soft key label is not available, otherwise true |
|
606 |
* @since S60 5.0 |
|
607 |
*/ |
|
608 |
virtual TBool SoftKeyLabelLocation(TInt aSoftKeyId, TPoint& aPosition, TSize& aSize) = 0; |
|
609 |
||
610 |
/** |
|
611 |
* Gets a soft key label anchor |
|
612 |
* @param aSoftKeyId - a constant identifying the softkey |
|
613 |
* @return sk label anchor, an existence of sk can be checked by SoftKeyLabelLocation() |
|
614 |
* @since S60 5.0 |
|
615 |
*/ |
|
616 |
virtual TInt SoftKeyLabelAnchor(TInt aSoftKeyId) = 0; |
|
617 |
||
618 |
/** Get a rect of a canvas without Keypad rect |
|
619 |
* @since S60 TB9.2 |
|
620 |
*/ |
|
621 |
virtual TRect GetCanvasRectFromLaf() = 0; |
|
622 |
||
623 |
/** |
|
624 |
* Returns the component type. |
|
625 |
* @return The component type as a MMIDComponent::TType enum. |
|
626 |
*/ |
|
627 |
TType Type() const |
|
628 |
{ |
|
629 |
return EDisplayableContainer; |
|
630 |
} |
|
631 |
||
632 |
/** |
|
633 |
* @ DEPRECATED |
|
634 |
*/ |
|
635 |
virtual void SetHasCommandListener(TBool /*aHasCommandListener*/) |
|
636 |
{ |
|
637 |
; |
|
638 |
} |
|
639 |
/** |
|
640 |
* Returns boolean value indicating whether this displayable is pop-up TextBox. |
|
641 |
* |
|
642 |
* @return TBool |
|
643 |
* |
|
644 |
* @since S60 5.0 |
|
645 |
*/ |
|
646 |
virtual TBool IsPopupTextBox() = 0; |
|
647 |
/* |
|
648 |
*@ DEPRECATED |
|
649 |
virtual CCoeControl& ContentWindow() = 0; |
|
650 |
*/ |
|
651 |
||
652 |
/** |
|
653 |
* Information about destroying old full screen Displayable. |
|
654 |
* @since Java 2.0 |
|
655 |
*/ |
|
656 |
virtual void DisplayableBehindPopupIsDestroyed() = 0; |
|
657 |
||
658 |
/** |
|
659 |
* Force sync draw. |
|
660 |
*/ |
|
661 |
virtual void DrawNow() = 0; |
|
662 |
||
663 |
/** |
|
664 |
* Changes osk background state |
|
665 |
* @param aOSKBackgroundState - osk background state |
|
666 |
*/ |
|
667 |
virtual void ChangeOSKBackgroundState(TBool aOSKBackgroundState) = 0; |
|
668 |
}; |
|
669 |
||
670 |
||
671 |
/** |
|
672 |
* |
|
673 |
* |
|
674 |
* Interface for Tactile Feedback Component |
|
675 |
* |
|
676 |
*/ |
|
677 |
#ifdef RD_TACTILE_FEEDBACK |
|
678 |
class MMIDTactileFeedbackComponent |
|
679 |
{ |
|
680 |
public: |
|
681 |
virtual void UpdateTactileFeedback() = 0; |
|
682 |
virtual void RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle) = 0; |
|
683 |
virtual void UnregisterFeedbackArea(TInt aId) = 0; |
|
684 |
virtual void UnregisterFeedbackForControl() = 0; |
|
685 |
virtual void MoveAreaToFirstPriority(TInt aId) = 0; |
|
686 |
}; |
|
687 |
#endif |
|
688 |
||
689 |
||
690 |
/** |
|
691 |
* Interface to Canvas |
|
692 |
*/ |
|
693 |
#ifdef RD_JAVA_NGA_ENABLED |
|
694 |
class MMIDCanvas : public MMIDComponentNgaExtension |
|
695 |
#else // !RD_JAVA_NGA_ENABLED |
|
696 |
class MMIDCanvas : public MMIDComponent |
|
697 |
#endif // RD_JAVA_NGA_ENABLED |
|
698 |
{ |
|
699 |
public: |
|
700 |
/** |
|
701 |
* Specifies how the drawing of the canvas will take place. |
|
702 |
*/ |
|
703 |
enum TDrawOp |
|
704 |
{ |
|
705 |
/** |
|
706 |
* Draw the entire canvas to the screen. |
|
707 |
* This command has no data. |
|
708 |
*/ |
|
709 |
EDrwOpcBitBlt = 0, |
|
710 |
||
711 |
#ifdef RD_JAVA_NGA_ENABLED |
|
712 |
/** |
|
713 |
* Draw a rectangular region of the canvas to the screen. The rectangle to be drawn |
|
714 |
* is provided with the command as (x1,y1)-(x2,y2) inclusive-exclusive integer |
|
715 |
* coordinates following the command header. |
|
716 |
*/ |
|
717 |
EDrwOpcBitBltRect = 1, |
|
718 |
||
719 |
/** |
|
720 |
* Marks m3g content start point. |
|
721 |
* @since S60 9.2 |
|
722 |
*/ |
|
723 |
EDrwOpcM3GContentStart = 2 |
|
724 |
#else // !RD_JAVA_NGA_ENABLED |
|
725 |
/** |
|
726 |
* Draw a rectangular region of the canvas to the screen. The rectangle to be drawn |
|
727 |
* is provided with the command as (x1,y1)-(x2,y2) inclusive-exclusive integer |
|
728 |
* coordinates following the command header. |
|
729 |
*/ |
|
730 |
EDrwOpcBitBltRect = 1 |
|
731 |
#endif // RD_JAVA_NGA_ENABLED |
|
732 |
}; |
|
733 |
public: |
|
734 |
/** |
|
735 |
* Returns the component type. |
|
736 |
* @return The component type as a MMIDComponent::TType enum. |
|
737 |
*/ |
|
738 |
virtual TType Type() const |
|
739 |
{ |
|
740 |
return ECanvas; |
|
741 |
} |
|
742 |
||
743 |
/** |
|
744 |
* Returns a reference to the CCoeControl corresponding to this canvas. |
|
745 |
* @return Reference to the CCoeControl corresponding to this canvas. |
|
746 |
*/ |
|
747 |
virtual CCoeControl& Control() = 0; |
|
748 |
||
749 |
/** |
|
750 |
* Returns the frame buffer. Double buffering must be supported so this method |
|
751 |
* must not return NULL. There is no ownership transfer. |
|
752 |
* @return A pointer to the frame buffer. |
|
753 |
*/ |
|
754 |
virtual CFbsBitmap* FrameBuffer() const = 0; |
|
755 |
||
756 |
/** |
|
757 |
* Returns the size of the canvas content. |
|
758 |
* @return The size of the displayable content. |
|
759 |
*/ |
|
760 |
virtual TSize ContentSize() const = 0; |
|
761 |
||
762 |
/** |
|
763 |
* Direct screen access support. |
|
764 |
* |
|
765 |
* This method should be called to disable direct screen access when |
|
766 |
* a popup menu is about to be displayed. This is a workaround for |
|
767 |
* menu's failing to correctly draw their shadows on Techview and |
|
768 |
* other UI's that have floating menubars. |
|
769 |
*/ |
|
770 |
virtual void PauseDirectAccess() = 0; |
|
771 |
||
772 |
/** |
|
773 |
* Re-enables direct access. To be called when the menu has disappeared. |
|
774 |
*/ |
|
775 |
virtual void ResumeDirectAccess() = 0; |
|
776 |
||
777 |
/** |
|
778 |
* Switch off key event posting. Game keys will still be tracked, but |
|
779 |
* keyPressed()/keyReleased() callbacks will not be called. |
|
780 |
*/ |
|
781 |
virtual void SuppressKeys() = 0; |
|
782 |
||
783 |
/** |
|
784 |
* Returns the latched state of the game action keys. |
|
785 |
* @return The latched state of the game action keys. |
|
786 |
*/ |
|
787 |
virtual TUint32 GameActions() = 0; |
|
788 |
||
789 |
public: |
|
790 |
/** |
|
791 |
*@return A container on which video can be rendered |
|
792 |
*/ |
|
793 |
virtual MDirectContainer& DirectContainer() = 0; |
|
794 |
||
795 |
/** |
|
796 |
* Draw a background image. |
|
797 |
* @param aGc Target context |
|
798 |
* @param aPosition Position |
|
799 |
* @param aSize Size |
|
800 |
* @since S60 5.0 |
|
801 |
*/ |
|
802 |
virtual void DrawBackground(CBitmapContext& aGc, const TPoint& aPosition, const TSize& aSize) = 0; |
|
803 |
||
804 |
/** |
|
805 |
* Returns the type of Canvas object |
|
806 |
* @return <code>ETrue</code> if the type is <code>MMIDComponent::EGameCanvas</code> and |
|
807 |
* <code>EFalse</code> when the type is <code>MMIDComponent::ECanvas</code>. |
|
808 |
* @since S60 5.0 |
|
809 |
*/ |
|
810 |
virtual TBool IsGameCanvas() const = 0; |
|
811 |
||
812 |
/** |
|
813 |
* Gets a network indicator location and size on fullscreen Canvas |
|
814 |
* @param aPosition - returned top left position of nw indicator |
|
815 |
* @param aSize - returned size of nw indicator |
|
816 |
* @return false if Canvas is not able to display nw indicator (not fullscreen), otherwise true |
|
817 |
* @since S60 5.0 |
|
818 |
*/ |
|
819 |
virtual TBool NetworkIndicatorLocation(TPoint& aPosition, TSize& aSize) const = 0; |
|
820 |
||
821 |
#ifdef RD_TACTILE_FEEDBACK |
|
822 |
virtual MMIDTactileFeedbackComponent* TactileFeedbackComponent() = 0; |
|
823 |
#endif |
|
824 |
||
825 |
#ifdef RD_JAVA_NGA_ENABLED |
|
826 |
/** |
|
827 |
* Notifies Canvas about areas that have been updated with 2D drawing. |
|
828 |
* Used for optimising texture upload to OpenGL when EGL surface is used. |
|
829 |
* @param aRect |
|
830 |
* - the area that has been updated in canvas coordinates. |
|
831 |
* @since S60 9.2 |
|
832 |
*/ |
|
833 |
virtual void UpdateRect(const TRect& aRect) = 0; |
|
834 |
||
835 |
/** |
|
836 |
* Notifies canvas about MIDlet exit. In exit Canvas must draw content to CWindowGc |
|
837 |
* to enable system transition effects. |
|
838 |
* @since S60 9.2 |
|
839 |
*/ |
|
840 |
virtual void MidletExiting() = 0; |
|
841 |
#endif // RD_JAVA_NGA_ENABLED |
|
842 |
||
843 |
virtual TBool ReadyToBlit() const = 0; |
|
844 |
}; |
|
845 |
||
846 |
/** |
|
847 |
* |
|
848 |
* Interface to Alert |
|
849 |
* |
|
850 |
*/ |
|
851 |
class MMIDAlert : public MMIDComponent |
|
852 |
{ |
|
853 |
public: |
|
854 |
/** |
|
855 |
* Enumeration of the different Alert behaviours. |
|
856 |
*/ |
|
857 |
enum TAlertType |
|
858 |
{ |
|
859 |
ENone = -1, |
|
860 |
EAlarm, |
|
861 |
EConfirmation, |
|
862 |
EError, |
|
863 |
EInfo, |
|
864 |
EWarning, |
|
865 |
}; |
|
866 |
||
867 |
/** |
|
868 |
* Enumeration used by SetTimeoutL()/DefaultTimeout(); |
|
869 |
* @see void SetTimeoutL(TInt aTime); |
|
870 |
* @see TInt DefaultTimeout(); |
|
871 |
*/ |
|
872 |
enum |
|
873 |
{ |
|
874 |
EForever = -2 |
|
875 |
}; |
|
876 |
public: |
|
877 |
||
878 |
/** |
|
879 |
* Sets the Alert's text. |
|
880 |
* Framework does not call SetModalL if there are now scrollbars. |
|
881 |
* @param aString |
|
882 |
* A descriptor containing the text. May be empty, to display no text. |
|
883 |
*/ |
|
884 |
virtual void SetStringL(const TDesC& aString) = 0; |
|
885 |
||
886 |
/** |
|
887 |
* Sets the Alert's image. |
|
888 |
* Framework does not call SetModalL if there are now scrollbars |
|
889 |
* @param aImage |
|
890 |
* A pointer to the image. May be NULL, to display no image. |
|
891 |
*/ |
|
892 |
virtual void SetImageL(MMIDImage* aImage) = 0; |
|
893 |
||
894 |
/** |
|
895 |
* Sets the Alert's gauge. |
|
896 |
* Framework does not call SetModalL if there are now scrollbars |
|
897 |
* @param aGauge |
|
898 |
* A pointer to the gauge. May be NULL, to display no gauge. |
|
899 |
*/ |
|
900 |
virtual void SetIndicatorL(MMIDGauge* aGauge) = 0; |
|
901 |
||
902 |
/** |
|
903 |
* Set the behavioural type of the Alert. |
|
904 |
* @param aType |
|
905 |
* Enumeration of the desired behaviour type |
|
906 |
*/ |
|
907 |
virtual void SetTypeL(TAlertType aType) = 0; |
|
908 |
||
909 |
/** |
|
910 |
* Return the default timeout. |
|
911 |
* @return The default timeout in milliseconds, or EForever. |
|
912 |
*/ |
|
913 |
virtual TInt DefaultTimeout() = 0; |
|
914 |
||
915 |
/** |
|
916 |
* Set the display timeout for the Alert. |
|
917 |
* If Alert is non-modal, the implementation is responsible for setting |
|
918 |
* a timer and should post an event when the timer completes. |
|
919 |
* @param aTime |
|
920 |
* The timeout in milliseconds, or EForever for modal alerts. |
|
921 |
*/ |
|
922 |
virtual void SetTimeoutL(TInt aTime) = 0; |
|
923 |
||
924 |
/** |
|
925 |
* Used to set the Alert's modal property. |
|
926 |
* Called by the framework when two or more Commands are added. |
|
927 |
*/ |
|
928 |
virtual void SetModalL() = 0; |
|
929 |
||
930 |
/** |
|
931 |
* Return if modal or not. |
|
932 |
* @return ETrue or EFalse. |
|
933 |
*/ |
|
934 |
virtual TBool IsModal() = 0; |
|
935 |
public: |
|
936 |
/** |
|
937 |
* Returns the component type. |
|
938 |
* @return The component type as a MMIDComponent::TType enum. |
|
939 |
*/ |
|
940 |
TType Type() const |
|
941 |
{ |
|
942 |
return EAlert; |
|
943 |
} |
|
944 |
}; |
|
945 |
||
946 |
/** |
|
947 |
* |
|
948 |
* Interface to Form |
|
949 |
* |
|
950 |
*/ |
|
951 |
class MMIDForm : public MMIDComponent |
|
952 |
{ |
|
953 |
public: |
|
954 |
/** |
|
955 |
* Adds a list of Items to the Form, replacing the previous contents. |
|
956 |
* @param aItems |
|
957 |
* Reference to an array containing the Items to add. |
|
958 |
*/ |
|
959 |
virtual void SetAllItemsL(const RArray<MMIDItem*>& aItems) = 0; |
|
960 |
||
961 |
/** |
|
962 |
* Sets the Form Item referenced by aIndex to the specified Item, |
|
963 |
* replacing the previous Item. |
|
964 |
* @param aItem |
|
965 |
* Reference to the new Item to add. |
|
966 |
* @param aIndex |
|
967 |
* The index representing the old Item on the Form. |
|
968 |
*/ |
|
969 |
virtual void SetItemL(MMIDItem& aItem,TInt aIndex) = 0; |
|
970 |
||
971 |
/** |
|
972 |
* Adds the given Item to the form before the specified index. |
|
973 |
* @param aItem |
|
974 |
* Reference to the Item to add. |
|
975 |
* @param aIndex |
|
976 |
* The index before which to insert the Item. |
|
977 |
*/ |
|
978 |
virtual void InsertItemL(MMIDItem& aItem,TInt aIndex) = 0; |
|
979 |
||
980 |
/** |
|
981 |
* Removes the Item with the given index from the Form. |
|
982 |
* @param aIndex |
|
983 |
* The index representing the Item to remove. |
|
984 |
*/ |
|
985 |
virtual void DeleteItemL(TInt aIndex) = 0; |
|
986 |
||
987 |
/** |
|
988 |
* Removes all the Items from the Form. |
|
989 |
*/ |
|
990 |
virtual void DeleteAllItemsL() = 0; |
|
991 |
||
992 |
/** |
|
993 |
* Called following any Item method calls which result in the item |
|
994 |
* changing its appearance in some way, e.g. size, label and content |
|
995 |
* changed which may mean that the Item's min size has changed. |
|
996 |
* @param aIndex |
|
997 |
* The index representing the item on the form. |
|
998 |
*/ |
|
999 |
virtual void RefreshItemL(TInt aIndex) = 0; |
|
1000 |
||
1001 |
/** |
|
1002 |
* Returns whether the item is actually visible to the user. Must therefore take into |
|
1003 |
* account the visibility of the entire form, and whether the specific item is scrolled |
|
1004 |
* in/out of the viewable area. |
|
1005 |
* @param aIndex |
|
1006 |
* The index representing the item on the form. |
|
1007 |
* @return ETrue or EFalse |
|
1008 |
*/ |
|
1009 |
virtual TBool IsItemVisible(TInt aIndex) = 0; |
|
1010 |
||
1011 |
/** |
|
1012 |
* This will be called prior to the Form itself being made the current Displayable. |
|
1013 |
* It provides an opportunity to prepare the Form such that this item will |
|
1014 |
* be visible and focused when the form is eventually made current. |
|
1015 |
* @param aIndex |
|
1016 |
* The index representing the item on the form. |
|
1017 |
*/ |
|
1018 |
virtual void SetCurrentItemL(TInt aIndex) = 0; |
|
1019 |
||
1020 |
/** |
|
1021 |
* Return width of displayable area available for items. |
|
1022 |
* @return Width of displayable area. |
|
1023 |
*/ |
|
1024 |
virtual TInt Width() = 0; |
|
1025 |
||
1026 |
/** |
|
1027 |
* Return height of displayable area available for items. |
|
1028 |
* @return Height of displayable area. |
|
1029 |
*/ |
|
1030 |
virtual TInt Height() = 0; |
|
1031 |
||
1032 |
public: |
|
1033 |
/** |
|
1034 |
* Returns the component type. |
|
1035 |
* @return The component type as a MMIDComponent::TType enum. |
|
1036 |
*/ |
|
1037 |
TType Type() const |
|
1038 |
{ |
|
1039 |
return EForm; |
|
1040 |
} |
|
1041 |
}; |
|
1042 |
||
1043 |
||
1044 |
/** |
|
1045 |
* |
|
1046 |
* Interface for List. |
|
1047 |
* |
|
1048 |
* Implicit lists should notify the java side when the select operation |
|
1049 |
* has been performed by calling MMIDEnv::PostJavaEvent with a reference |
|
1050 |
* to the MMIDList implementing class and TSourceType == EDisplayable. |
|
1051 |
*/ |
|
1052 |
class MMIDList : public MMIDComponent |
|
1053 |
{ |
|
1054 |
public: |
|
1055 |
/** |
|
1056 |
* Insert a List item before the specified index. |
|
1057 |
* @param aIndex |
|
1058 |
* The index representing insertion position. |
|
1059 |
* @param aText |
|
1060 |
* Desriptor reference containing the text. |
|
1061 |
* @param aImage |
|
1062 |
* A pointer to an associated image. NULL if there |
|
1063 |
* is no image associated with this list element. |
|
1064 |
*/ |
|
1065 |
virtual void InsertElementL(TInt aIndex,const TDesC& aText,MMIDImage* aImage) = 0; |
|
1066 |
||
1067 |
/** |
|
1068 |
* Replace the List item at the specified index with the new text. |
|
1069 |
* @param aIndex |
|
1070 |
* The index representing the item to replace. |
|
1071 |
* @param aText |
|
1072 |
* Desriptor reference containing the new text. |
|
1073 |
* @param aImage |
|
1074 |
* A pointer to the new associated image. NULL if there |
|
1075 |
* is no image associated with this list element. |
|
1076 |
*/ |
|
1077 |
virtual void SetElementL(TInt aIndex,const TDesC& aText,MMIDImage* aImage) = 0; |
|
1078 |
||
1079 |
/** |
|
1080 |
* Delete the List item at the specified index. |
|
1081 |
* @param aIndex |
|
1082 |
* The index representing the item to delete. |
|
1083 |
*/ |
|
1084 |
virtual void DeleteElementL(TInt aIndex) = 0; |
|
1085 |
||
1086 |
/** |
|
1087 |
* Delete the all the items in the List. |
|
1088 |
*/ |
|
1089 |
virtual void DeleteAllL() = 0; |
|
1090 |
||
1091 |
/** |
|
1092 |
* Set the List item at the specified index to selected or unselected. |
|
1093 |
* @param aIndex |
|
1094 |
* The index representing the item. |
|
1095 |
* @param aSelected |
|
1096 |
* ETrue to set the item selected, EFalse to deselect the item. |
|
1097 |
*/ |
|
1098 |
virtual void SelectElementL(TInt aIndex,TBool aSelected) = 0; |
|
1099 |
||
1100 |
/** |
|
1101 |
* Returns whether the item specified by index is selected or unselected. |
|
1102 |
* @param aIndex |
|
1103 |
* The index representing the item. |
|
1104 |
* @return ETrue if the item is selected, EFalse otherwise. |
|
1105 |
*/ |
|
1106 |
virtual TBool IsSelected(TInt aIndex) = 0; |
|
1107 |
||
1108 |
/** |
|
1109 |
* Set the font for the item represented by the given index. |
|
1110 |
* @param aIndex |
|
1111 |
* The index representing the item. |
|
1112 |
* @param aFont |
|
1113 |
* Pointer to the font to use. |
|
1114 |
*/ |
|
1115 |
virtual void SetFontL(TInt aIndex, MMIDFont* aFont) = 0; |
|
1116 |
||
1117 |
/** |
|
1118 |
* Sets the application's preferred policy for fitting element |
|
1119 |
* contents to the available screen space. |
|
1120 |
* @param aFitPolicy |
|
1121 |
* The fit policy to use. |
|
1122 |
*/ |
|
1123 |
virtual void SetFitPolicyL(TInt aFitPolicy) = 0; |
|
1124 |
||
1125 |
/** |
|
1126 |
* Notifies this MMIDList that the select command has changed. |
|
1127 |
* This is only called on IMPLICIT Lists. |
|
1128 |
* |
|
1129 |
* This is only relevant to MMIDList implementing classes that provide a |
|
1130 |
* visual means of invoking the select operation, e.g. a soft key. |
|
1131 |
* If this is the case, the visual means should be removed when the select |
|
1132 |
* command is set to null or to an application provided command. |
|
1133 |
* |
|
1134 |
* @param aCommandID |
|
1135 |
* One of: |
|
1136 |
* The ID of a command that has been added to the list via AddCommandL |
|
1137 |
* - in this case the List should look up the command in its collection |
|
1138 |
* and use the label for its selection mechanism. |
|
1139 |
* |
|
1140 |
* MMIDCommand::EListSelectCommand |
|
1141 |
* - in this case the List should use the default label for its |
|
1142 |
* selection mechanism. |
|
1143 |
* |
|
1144 |
* MMIDCommand::ENullCommand |
|
1145 |
* |
|
1146 |
* - in this case the list should not support selection. This value will |
|
1147 |
* be passed in response to the application calling: |
|
1148 |
* List.setSelectCommand(null); |
|
1149 |
* |
|
1150 |
*/ |
|
1151 |
virtual void SetSelectCommand(TInt aCommandID) = 0; |
|
1152 |
||
1153 |
public: |
|
1154 |
/** |
|
1155 |
* Returns the component type. |
|
1156 |
* @return The component type as a MMIDComponent::TType enum. |
|
1157 |
*/ |
|
1158 |
TType Type() const |
|
1159 |
{ |
|
1160 |
return EList; |
|
1161 |
} |
|
1162 |
}; |
|
1163 |
||
1164 |
/** |
|
1165 |
* |
|
1166 |
* Interface for TextBox |
|
1167 |
* |
|
1168 |
*/ |
|
1169 |
class MMIDTextBox : public MMIDComponent |
|
1170 |
{ |
|
1171 |
public: |
|
1172 |
/** |
|
1173 |
* Deletes the given number of characters starting at the specified offset. |
|
1174 |
* @param aOffset |
|
1175 |
* The offset from which to start the deletion. |
|
1176 |
* @param aLength |
|
1177 |
* The number of characters to delete. |
|
1178 |
*/ |
|
1179 |
virtual void DeleteTextL(TInt aOffset,TInt aLength) = 0; |
|
1180 |
||
1181 |
/** |
|
1182 |
* Sets the text to that supplied, replacing the previous contents. |
|
1183 |
* @param aText |
|
1184 |
* Reference to a descriptor containing the new text. |
|
1185 |
*/ |
|
1186 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1187 |
||
1188 |
/** |
|
1189 |
* Inserts the supplied text starting at the given position. |
|
1190 |
* @param aText |
|
1191 |
* Reference to a descriptor containing the new text. |
|
1192 |
* @param aPosition |
|
1193 |
* The positon at which to insert the new text. |
|
1194 |
*/ |
|
1195 |
virtual void InsertTextL(const TDesC& aText,TInt aPosition) = 0; |
|
1196 |
||
1197 |
/** |
|
1198 |
* Sets the input constraints of the TextBox. |
|
1199 |
* @param aConstraints |
|
1200 |
* The new constraints. |
|
1201 |
*/ |
|
1202 |
virtual void SetConstraintsL(TUint aConstraints) = 0; |
|
1203 |
||
1204 |
/** |
|
1205 |
* Sets the maximum number of characters that can be stored in |
|
1206 |
* this texbox. Returns assigned maximum capacity. |
|
1207 |
* The max size returned by this method will be used for exception checking |
|
1208 |
* on the java side. |
|
1209 |
* @param aMaxSize |
|
1210 |
* The maximum number of characters. |
|
1211 |
* @return The assigned maximum number of characters. |
|
1212 |
*/ |
|
1213 |
virtual TInt SetMaxSizeL(TInt aMaxSize) = 0; |
|
1214 |
||
1215 |
/** |
|
1216 |
* Returns the maximum number of characters that can be stored in |
|
1217 |
* this texbox. Called once by the framework after construction. |
|
1218 |
* The max size returned by this method will be used for exception checking |
|
1219 |
* on the java side. |
|
1220 |
* @return The maximum number of characters. |
|
1221 |
*/ |
|
1222 |
virtual TInt GetMaxSize() = 0; |
|
1223 |
||
1224 |
/** |
|
1225 |
* Gets the number of characters that are currently stored in this TextBox. |
|
1226 |
* @return The number of characters. |
|
1227 |
*/ |
|
1228 |
virtual TInt Size() = 0; |
|
1229 |
||
1230 |
/** |
|
1231 |
* Gets the current input position. |
|
1232 |
* @return The current input position. |
|
1233 |
*/ |
|
1234 |
virtual TInt GetCaretPosition() = 0; |
|
1235 |
||
1236 |
/** |
|
1237 |
* Gets the contents of the TextBox. |
|
1238 |
* @return The text is returned as a heap cell, and ownership is transferred. |
|
1239 |
*/ |
|
1240 |
virtual HBufC* GetTextL() = 0; |
|
1241 |
||
1242 |
/** |
|
1243 |
* Sets a hint to the implementation as to the input mode that should |
|
1244 |
* be used when the user initiates editing of this TextBox. |
|
1245 |
* @param aCharacterSubset |
|
1246 |
* The unicode character subset. |
|
1247 |
*/ |
|
1248 |
virtual void SetInitialInputModeL(const TDesC& aCharacterSubset) = 0; |
|
1249 |
||
1250 |
public: |
|
1251 |
/** |
|
1252 |
* Returns the component type. |
|
1253 |
* @return The component type as a MMIDComponent::TType enum. |
|
1254 |
*/ |
|
1255 |
TType Type() const |
|
1256 |
{ |
|
1257 |
return ETextBox; |
|
1258 |
} |
|
1259 |
}; |
|
1260 |
||
1261 |
||
1262 |
/** |
|
1263 |
* |
|
1264 |
* Interface to ImageItem |
|
1265 |
* |
|
1266 |
*/ |
|
1267 |
class MMIDImageItem : public MMIDItem |
|
1268 |
{ |
|
1269 |
public: |
|
1270 |
/** |
|
1271 |
* Sets the Image contained within the ImageItem. |
|
1272 |
* Snap shot of image has already been taken java side. |
|
1273 |
* @param aImage |
|
1274 |
* A pointer to the image to use. |
|
1275 |
*/ |
|
1276 |
virtual void SetImageL(MMIDImage* aImage) = 0; |
|
1277 |
||
1278 |
/** |
|
1279 |
* Sets the text string to be used if the image exceeds the device's |
|
1280 |
* capacity to display it. |
|
1281 |
* @param aAltText |
|
1282 |
* Descriptor reference containing the text. |
|
1283 |
*/ |
|
1284 |
virtual void SetAltTextL(const TDesC& aAltText) = 0; |
|
1285 |
public: |
|
1286 |
/** |
|
1287 |
* Returns the component type. |
|
1288 |
* @return The component type as a MMIDComponent::TType enum. |
|
1289 |
*/ |
|
1290 |
TType Type() const |
|
1291 |
{ |
|
1292 |
return EImageItem; |
|
1293 |
} |
|
1294 |
}; |
|
1295 |
||
1296 |
/** |
|
1297 |
* |
|
1298 |
* Interface to Spacer. |
|
1299 |
* |
|
1300 |
* The Item methods setLabel(String aLabel), addCommand(Command aCommand) |
|
1301 |
* and setDefaultCommand(Command aCommand) will never be called |
|
1302 |
* |
|
1303 |
*/ |
|
1304 |
class MMIDSpacer : public MMIDItem |
|
1305 |
{ |
|
1306 |
public: |
|
1307 |
/** |
|
1308 |
* Sets the minimum size for this spacer. |
|
1309 |
* @param aSize |
|
1310 |
* The size to use. |
|
1311 |
*/ |
|
1312 |
virtual void SetMinimumSizeL(const TSize& aSize) = 0; |
|
1313 |
public: |
|
1314 |
/** |
|
1315 |
* Returns the component type. |
|
1316 |
* @return The component type as a MMIDComponent::TType enum. |
|
1317 |
*/ |
|
1318 |
TType Type() const |
|
1319 |
{ |
|
1320 |
return ESpacer; |
|
1321 |
} |
|
1322 |
}; |
|
1323 |
||
1324 |
/** |
|
1325 |
* |
|
1326 |
* Interface to StringItem. The default font, i.e the one that should be used if |
|
1327 |
* no font is set, should be the one returned by Font.getDefaultFont(), i.e. with |
|
1328 |
* attributes ESystem,EPlain,EMedium |
|
1329 |
* |
|
1330 |
*/ |
|
1331 |
class MMIDStringItem : public MMIDItem |
|
1332 |
{ |
|
1333 |
public: |
|
1334 |
/** |
|
1335 |
* Sets the text contents of the StringItem. |
|
1336 |
* @param aText |
|
1337 |
* Descriptor reference containing the text. |
|
1338 |
*/ |
|
1339 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1340 |
||
1341 |
/** |
|
1342 |
* Sets the preferred font for rendering this StringItem. |
|
1343 |
* @param aFont |
|
1344 |
* A pointer to the font to use. |
|
1345 |
*/ |
|
1346 |
virtual void SetFontL(MMIDFont* aFont) = 0; |
|
1347 |
public: |
|
1348 |
/** |
|
1349 |
* Returns the component type. |
|
1350 |
* @return The component type as a MMIDComponent::TType enum. |
|
1351 |
*/ |
|
1352 |
TType Type() const |
|
1353 |
{ |
|
1354 |
return EStringItem; |
|
1355 |
} |
|
1356 |
}; |
|
1357 |
||
1358 |
/** |
|
1359 |
* |
|
1360 |
* Interface to DateField. This should be constructed in a "not initialized state" which |
|
1361 |
* should be clearly identifiable. Only after user interaction or programmatically with |
|
1362 |
* setDate() should it change. |
|
1363 |
* |
|
1364 |
*/ |
|
1365 |
class MMIDDateField : public MMIDItem |
|
1366 |
{ |
|
1367 |
public: |
|
1368 |
/** |
|
1369 |
* Enumeration to indicate whether the DataField object contains |
|
1370 |
* information about the time, the date, or both. |
|
1371 |
*/ |
|
1372 |
enum TInputMode |
|
1373 |
{ |
|
1374 |
EDate = 1, |
|
1375 |
ETime, |
|
1376 |
EDateTime |
|
1377 |
}; |
|
1378 |
||
1379 |
/** |
|
1380 |
* Compatability typedef. |
|
1381 |
* @deprecated |
|
1382 |
*/ |
|
1383 |
typedef TInputMode TFieldType; |
|
1384 |
public: |
|
1385 |
/** |
|
1386 |
* Returns the current value as a date or time or both. |
|
1387 |
* @return The date/time |
|
1388 |
*/ |
|
1389 |
virtual TTime Date() const = 0; |
|
1390 |
||
1391 |
/** |
|
1392 |
* Sets a new value for this field. |
|
1393 |
* @param aTime |
|
1394 |
* The new value. |
|
1395 |
*/ |
|
1396 |
virtual void SetDate(const TTime& aTime) = 0; |
|
1397 |
||
1398 |
/** |
|
1399 |
* This method is called in response to DateField.setDate(null). The implementation |
|
1400 |
* should respond by presenting the control as clearly being in a non-intialized state |
|
1401 |
*/ |
|
1402 |
virtual void SetUninitialized() = 0; |
|
1403 |
||
1404 |
/** |
|
1405 |
* Change the date field type |
|
1406 |
*/ |
|
1407 |
virtual void SetInputModeL(TInputMode aInputMode) = 0; |
|
1408 |
||
1409 |
public: |
|
1410 |
/** |
|
1411 |
* Returns the component type. |
|
1412 |
* @return The component type as a MMIDComponent::TType enum. |
|
1413 |
*/ |
|
1414 |
TType Type() const |
|
1415 |
{ |
|
1416 |
return EDateField; |
|
1417 |
} |
|
1418 |
}; |
|
1419 |
||
1420 |
/** |
|
1421 |
* |
|
1422 |
* Interface to Gauge. |
|
1423 |
* |
|
1424 |
*/ |
|
1425 |
class MMIDGauge : public MMIDItem |
|
1426 |
{ |
|
1427 |
public: |
|
1428 |
/** |
|
1429 |
* Enumeration of various gauge behaviour patterns. |
|
1430 |
*/ |
|
1431 |
enum |
|
1432 |
{ |
|
1433 |
EIndefinite = -1, |
|
1434 |
EContinuousIdle, |
|
1435 |
EIncrementalIdle, |
|
1436 |
EContinuousRunning, |
|
1437 |
EIncrementalUpdating |
|
1438 |
}; |
|
1439 |
public: |
|
1440 |
/** |
|
1441 |
* Sets the current value of this Gauge object. |
|
1442 |
* If the gauge is in the indefinite mode, then aValue will take one of the values |
|
1443 |
* EContinuousIdle, EIncrementalIdle, EContinuousRunning or EIncrementalUpdating. |
|
1444 |
* @param aValue |
|
1445 |
* The new value. |
|
1446 |
*/ |
|
1447 |
virtual void SetValueL(TInt aValue) = 0; |
|
1448 |
||
1449 |
/** |
|
1450 |
* Get the current value of this Gauge object. |
|
1451 |
* @return The current value. |
|
1452 |
*/ |
|
1453 |
virtual TInt GetValue() = 0; |
|
1454 |
||
1455 |
/** |
|
1456 |
* Sets the maximum value of this Gauge object. |
|
1457 |
* aValue could take the special value EIndefinite in order to indicate that the Gauge |
|
1458 |
* has indefinite range. |
|
1459 |
* @param aValue |
|
1460 |
* The maximum value. |
|
1461 |
*/ |
|
1462 |
virtual void SetMaxValueL(TInt aValue) = 0; |
|
1463 |
public: |
|
1464 |
/** |
|
1465 |
* Returns the component type. |
|
1466 |
* @return The component type as a MMIDComponent::TType enum. |
|
1467 |
*/ |
|
1468 |
TType Type() const |
|
1469 |
{ |
|
1470 |
return EGauge; |
|
1471 |
} |
|
1472 |
}; |
|
1473 |
||
1474 |
/** |
|
1475 |
* |
|
1476 |
* Interface for TextField |
|
1477 |
* |
|
1478 |
*/ |
|
1479 |
class MMIDTextField : public MMIDItem |
|
1480 |
{ |
|
1481 |
public: |
|
1482 |
enum |
|
1483 |
{ |
|
1484 |
/** |
|
1485 |
* Constraints |
|
1486 |
*/ |
|
1487 |
EAny, |
|
1488 |
EMailAddr, |
|
1489 |
ENumeric, |
|
1490 |
EPhoneNumber, |
|
1491 |
EUrl, |
|
1492 |
EDecimal, |
|
1493 |
/** |
|
1494 |
* Modifiers |
|
1495 |
*/ |
|
1496 |
EPassword=0x10000, |
|
1497 |
EUneditable=0x20000, |
|
1498 |
ESensitive=0x40000, |
|
1499 |
ENonPredictive=0x80000, |
|
1500 |
EInitialCapsWord=0x100000, |
|
1501 |
EInitialCapsWordSentence=0x200000, |
|
1502 |
EConstraintMask=0xFFFF |
|
1503 |
}; |
|
1504 |
public: |
|
1505 |
/** |
|
1506 |
* Deletes the given number of characters starting at the specified offset. |
|
1507 |
* @param aOffset |
|
1508 |
* The offset from which to start the deletion. |
|
1509 |
* @param aLength |
|
1510 |
* The number of characters to delete. |
|
1511 |
*/ |
|
1512 |
virtual void DeleteTextL(TInt aOffset,TInt aLength) = 0; |
|
1513 |
||
1514 |
/** |
|
1515 |
* Sets the text to that supplied, replacing the previous contents. |
|
1516 |
* @param aText |
|
1517 |
* Reference to a descriptor containing the new text. |
|
1518 |
*/ |
|
1519 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1520 |
||
1521 |
/** |
|
1522 |
* Inserts the supplied text starting at the given position. |
|
1523 |
* @param aText |
|
1524 |
* Reference to a descriptor containing the new text. |
|
1525 |
* @param aPosition |
|
1526 |
* The positon at which to insert the new text. |
|
1527 |
*/ |
|
1528 |
virtual void InsertTextL(const TDesC& aText,TInt aPosition) = 0; |
|
1529 |
||
1530 |
/** |
|
1531 |
* Sets the input constraints of the TextBox. |
|
1532 |
* @param aConstraints |
|
1533 |
* The new constraints. |
|
1534 |
*/ |
|
1535 |
virtual void SetConstraintsL(TUint aConstraints) = 0; |
|
1536 |
||
1537 |
/** |
|
1538 |
* Returns assigned maximum capacity. The max size returned by this |
|
1539 |
* method will be used for exception checking on the java side. |
|
1540 |
*/ |
|
1541 |
virtual TInt SetMaxSizeL(TInt aMaxSize) = 0; |
|
1542 |
||
1543 |
/** |
|
1544 |
* Returns the maximum number of characters that can be stored in |
|
1545 |
* this texbox. Called once by the framework after construction. |
|
1546 |
* The max size returned by this method will be used for exception checking |
|
1547 |
* on the java side. |
|
1548 |
* @return The maximum number of characters. |
|
1549 |
*/ |
|
1550 |
virtual TInt GetMaxSize() = 0; |
|
1551 |
||
1552 |
// client side method |
|
1553 |
||
1554 |
/** |
|
1555 |
* Gets the number of characters that are currently stored in this TextBox. |
|
1556 |
* @return The number of characters. |
|
1557 |
*/ |
|
1558 |
virtual TInt Size() = 0; |
|
1559 |
||
1560 |
/** |
|
1561 |
* Gets the current input position. |
|
1562 |
* @return The current input position. |
|
1563 |
*/ |
|
1564 |
virtual TInt GetCaretPosition() = 0; |
|
1565 |
||
1566 |
/** |
|
1567 |
* Gets the contents of the TextBox. |
|
1568 |
* @return The text is returned as a HBufC*, and ownership is transferred. |
|
1569 |
*/ |
|
1570 |
virtual HBufC* GetTextL() = 0; |
|
1571 |
||
1572 |
/** |
|
1573 |
* Sets a hint to the implementation as to the input mode that should |
|
1574 |
* be used when the user initiates editing of this TextBox. |
|
1575 |
* @param aCharacterSubset |
|
1576 |
* The unicode character subset. |
|
1577 |
*/ |
|
1578 |
virtual void SetInitialInputModeL(const TDesC& aCharacterSubset) = 0; |
|
1579 |
public: |
|
1580 |
/** |
|
1581 |
* Returns the component type. |
|
1582 |
* @return The component type as a MMIDComponent::TType enum. |
|
1583 |
*/ |
|
1584 |
TType Type() const |
|
1585 |
{ |
|
1586 |
return ETextField; |
|
1587 |
} |
|
1588 |
}; |
|
1589 |
||
1590 |
/** |
|
1591 |
* |
|
1592 |
* Interface for ChoiceGroup |
|
1593 |
* |
|
1594 |
*/ |
|
1595 |
class MMIDChoiceGroup : public MMIDItem |
|
1596 |
{ |
|
1597 |
public: |
|
1598 |
/** |
|
1599 |
* Enueration of selection behaviour types. |
|
1600 |
*/ |
|
1601 |
enum TChoiceType |
|
1602 |
{ |
|
1603 |
EExclusive=1, |
|
1604 |
EMultiple, |
|
1605 |
EImplicit, |
|
1606 |
EPopup |
|
1607 |
}; |
|
1608 |
/** |
|
1609 |
* Enueration of display behaviour types. |
|
1610 |
*/ |
|
1611 |
enum TFitPolicy |
|
1612 |
{ |
|
1613 |
EWrapDefault = 0, |
|
1614 |
EWrapOn, |
|
1615 |
EWrapOff |
|
1616 |
}; |
|
1617 |
public: |
|
1618 |
/** |
|
1619 |
* Insert a ChoiceGroup item before the specified index. |
|
1620 |
* @param aIndex |
|
1621 |
* The index representing insertion position. |
|
1622 |
* @param aText |
|
1623 |
* Desriptor reference containing the text. |
|
1624 |
* @param aImage |
|
1625 |
* A pointer to an associated image. NULL if there |
|
1626 |
* is no image associated with this element. |
|
1627 |
*/ |
|
1628 |
virtual void InsertElementL(TInt aIndex,const TDesC& aText,MMIDImage* aImage) = 0; |
|
1629 |
||
1630 |
/** |
|
1631 |
* Delete the ChoiceGroup item at the specified index. |
|
1632 |
* @param aIndex |
|
1633 |
* The index representing the item to delete. |
|
1634 |
*/ |
|
1635 |
virtual void DeleteElementL(TInt aIndex) = 0; |
|
1636 |
||
1637 |
/** |
|
1638 |
* Delete the all the items in the ChoiceGroup. |
|
1639 |
*/ |
|
1640 |
virtual void DeleteAllL() = 0; |
|
1641 |
||
1642 |
/** |
|
1643 |
* Replace the ChoiceGroup item at the specified index with the new text. |
|
1644 |
* @param aIndex |
|
1645 |
* The index representing the item to replace. |
|
1646 |
* @param aText |
|
1647 |
* Desriptor reference containing the new text. |
|
1648 |
* @param aImage |
|
1649 |
* A pointer to the new associated image. NULL if there |
|
1650 |
* is no image associated with this list element. |
|
1651 |
*/ |
|
1652 |
virtual void SetElementL(TInt aIndex,const TDesC& aText,MMIDImage* aImage) = 0; |
|
1653 |
||
1654 |
/** |
|
1655 |
* Set the ChoiceGroup item at the specified index to selected or unselected. |
|
1656 |
* @param aIndex |
|
1657 |
* The index representing the item. |
|
1658 |
* @param aSelected |
|
1659 |
* ETrue to set the item selected, EFalse to deselect the item. |
|
1660 |
*/ |
|
1661 |
virtual void SelectElementL(TInt aIndex,TBool aSelected) = 0; |
|
1662 |
||
1663 |
/** |
|
1664 |
* Returns whether the item specified by index is selected or unselected. |
|
1665 |
* @param aIndex |
|
1666 |
* The index representing the item. |
|
1667 |
* @return ETrue if the item is selected, EFalse otherwise. |
|
1668 |
*/ |
|
1669 |
virtual TBool IsSelected(TInt aIndex) = 0; |
|
1670 |
||
1671 |
/** |
|
1672 |
* Set the font for the item represented by the given index. |
|
1673 |
* @param aIndex |
|
1674 |
* The index representing the item. |
|
1675 |
* @param aFont |
|
1676 |
* Pointer to the font to use. |
|
1677 |
*/ |
|
1678 |
virtual void SetFontL(TInt aIndex, MMIDFont* aFont) = 0; |
|
1679 |
||
1680 |
/** |
|
1681 |
* Sets the application's preferred policy for fitting element |
|
1682 |
* contents to the available screen space. |
|
1683 |
* @param aFitPolicy |
|
1684 |
* The fit policy to use. One of the values of TFitPolicy. |
|
1685 |
*/ |
|
1686 |
virtual void SetFitPolicyL(TInt aFitPolicy) = 0; |
|
1687 |
public: |
|
1688 |
/** |
|
1689 |
* Returns the component type. |
|
1690 |
* @return The component type as a MMIDComponent::TType enum. |
|
1691 |
*/ |
|
1692 |
TType Type() const |
|
1693 |
{ |
|
1694 |
return EChoiceGroup; |
|
1695 |
} |
|
1696 |
}; |
|
1697 |
||
1698 |
||
1699 |
/** |
|
1700 |
* |
|
1701 |
* Interface for CustomItem |
|
1702 |
* |
|
1703 |
*/ |
|
1704 |
class MMIDCustomItem : public MMIDItem |
|
1705 |
{ |
|
1706 |
public: |
|
1707 |
/** |
|
1708 |
* Enumeration of various behaviour types relating to |
|
1709 |
* support for traversal, pointer events and keypresses. |
|
1710 |
*/ |
|
1711 |
enum TInteractionMode |
|
1712 |
{ |
|
1713 |
ENone, |
|
1714 |
ETraverseHorizontal, |
|
1715 |
ETraverseVertical, |
|
1716 |
EKeyPress=4, |
|
1717 |
EKeyRelease=8, |
|
1718 |
EKeyRepeat=0x10, |
|
1719 |
EPointerPress=0x20, |
|
1720 |
EPointerRelease=0x40, |
|
1721 |
EPointerDrag=0x80 |
|
1722 |
}; |
|
1723 |
public: |
|
1724 |
/** |
|
1725 |
* Gets the available interaction modes. |
|
1726 |
* Client side method returning combination of flags supported |
|
1727 |
* by device. |
|
1728 |
* This will be called by a java thread and as such it must |
|
1729 |
* not call any FS, FBS, CONE, UIKON or WSERV API's. |
|
1730 |
* @return The interaction modes. |
|
1731 |
*/ |
|
1732 |
virtual TInt InteractionModes() const = 0; |
|
1733 |
||
1734 |
/** |
|
1735 |
* Sets the focus as specified. |
|
1736 |
* @param aFocus |
|
1737 |
* @param aScroll |
|
1738 |
* @param aDirection |
|
1739 |
*/ |
|
1740 |
virtual void SetFocusAndScroll(TBool aFocus,const TRect* aScroll,TInt aDirection) = 0; |
|
1741 |
||
1742 |
/** |
|
1743 |
* Signals that the CustomItem's size and traversal location need to be updated. |
|
1744 |
* Updates CustomItem with new MinContentSize and PrefContentSize received |
|
1745 |
* from CustomItem. |
|
1746 |
* @param aMinSize |
|
1747 |
* The new minimum content size. |
|
1748 |
* @param aPrefSize |
|
1749 |
* The new preferred content size. |
|
1750 |
*/ |
|
1751 |
virtual void Invalidate(const TSize& aMinSize, const TSize& aPrefSize) = 0; |
|
1752 |
||
1753 |
/** |
|
1754 |
* Returns the backing bitmap onto which Graphics may draw. |
|
1755 |
* Does not transfer ownership. |
|
1756 |
* @returns A pointer to the bitmap. |
|
1757 |
*/ |
|
1758 |
virtual CFbsBitmap* FrameBuffer() const = 0; |
|
1759 |
||
1760 |
public: |
|
1761 |
/** |
|
1762 |
* Returns the component type. |
|
1763 |
* @return The component type as a MMIDComponent::TType enum. |
|
1764 |
*/ |
|
1765 |
TType Type() const |
|
1766 |
{ |
|
1767 |
return ECustomItem; |
|
1768 |
} |
|
1769 |
||
1770 |
/** |
|
1771 |
*@return A container on which video can be rendered |
|
1772 |
*/ |
|
1773 |
virtual MDirectContainer& DirectContainer() = 0; |
|
1774 |
||
1775 |
#ifdef RD_TACTILE_FEEDBACK |
|
1776 |
virtual MMIDTactileFeedbackComponent* TactileFeedbackComponent() = 0; |
|
1777 |
#endif |
|
1778 |
}; |
|
1779 |
||
1780 |
||
1781 |
/** |
|
1782 |
* |
|
1783 |
* Interface to Font. The font returned by Font.getDefaultFont() has attributes |
|
1784 |
* ESystem,EPlain,EMedium |
|
1785 |
* |
|
1786 |
*/ |
|
1787 |
class MMIDFont : public MMIDComponent |
|
1788 |
{ |
|
1789 |
public: |
|
1790 |
/** |
|
1791 |
* Font face |
|
1792 |
*/ |
|
1793 |
enum TFace |
|
1794 |
{ |
|
1795 |
ESystem=0, |
|
1796 |
EMonospaced=32, |
|
1797 |
EProportional=64 |
|
1798 |
}; |
|
1799 |
/** |
|
1800 |
* Font style |
|
1801 |
*/ |
|
1802 |
enum TStyle |
|
1803 |
{ |
|
1804 |
EPlain=0, |
|
1805 |
EBold=0x1, |
|
1806 |
EItalic=0x2, |
|
1807 |
EUnderlined=0x4, |
|
1808 |
}; |
|
1809 |
/** |
|
1810 |
* Font size |
|
1811 |
*/ |
|
1812 |
enum TSize |
|
1813 |
{ |
|
1814 |
ESmall=8, |
|
1815 |
EMedium=0, |
|
1816 |
ELarge=16 |
|
1817 |
}; |
|
1818 |
/** |
|
1819 |
* Font specifier |
|
1820 |
*/ |
|
1821 |
enum TFontSpecifier |
|
1822 |
{ |
|
1823 |
EStaticText, |
|
1824 |
EInputText |
|
1825 |
}; |
|
1826 |
public: |
|
1827 |
/** |
|
1828 |
* Returns a pointer to a font having the face, style, and size of this Font. |
|
1829 |
* |
|
1830 |
* Special note about Nokia scaling jad attribute: Nokia-MIDlet-Original-Display-Size |
|
1831 |
* Returns a pointer to a font which is scaled according to the jad attribute. |
|
1832 |
* When called with parameter ETrue scaling attribute is not taken into account. |
|
1833 |
* |
|
1834 |
* @return A pointer to the font. |
|
1835 |
*/ |
|
1836 |
virtual CFont* Font(TBool aHighLevelComponent = EFalse) = 0; |
|
1837 |
||
1838 |
/** |
|
1839 |
* Returns the height in pixels of text drawn with this Font. |
|
1840 |
* @return The height. |
|
1841 |
*/ |
|
1842 |
virtual TInt Height() = 0; |
|
1843 |
||
1844 |
/** |
|
1845 |
* Gets the distance in pixels from the top of the text to the text's baseline. |
|
1846 |
* @return The distance in pixels from the top of the text to the text's baseline. |
|
1847 |
*/ |
|
1848 |
virtual TInt Baseline() = 0; |
|
1849 |
||
1850 |
/** |
|
1851 |
* Gets the total advance width for showing the specified string using this Font. |
|
1852 |
* @param aString |
|
1853 |
* Reference to a descriptor containing the text. |
|
1854 |
* @return The display width. |
|
1855 |
*/ |
|
1856 |
virtual TInt Width(const TDesC& aString) = 0; |
|
1857 |
||
1858 |
/** |
|
1859 |
* Returns whether text draw using this Font is underlined. |
|
1860 |
* @return ETrue or EFalse |
|
1861 |
*/ |
|
1862 |
virtual TBool IsUnderlined() const = 0; |
|
1863 |
public: |
|
1864 |
/** |
|
1865 |
* Returns the component type. |
|
1866 |
* @return The component type as a MMIDComponent::TType enum. |
|
1867 |
*/ |
|
1868 |
TType Type() const |
|
1869 |
{ |
|
1870 |
return EFont; |
|
1871 |
} |
|
1872 |
}; |
|
1873 |
||
1874 |
/** |
|
1875 |
* Structure combining the various font attributes. |
|
1876 |
*/ |
|
1877 |
struct SFontSpec |
|
1878 |
{ |
|
1879 |
MMIDFont::TStyle iStyle; |
|
1880 |
MMIDFont::TFace iFace; |
|
1881 |
MMIDFont::TSize iSize; |
|
1882 |
}; |
|
1883 |
||
1884 |
/** |
|
1885 |
* |
|
1886 |
* Interface to Ticker |
|
1887 |
* |
|
1888 |
*/ |
|
1889 |
class MMIDTicker : public MMIDComponent |
|
1890 |
{ |
|
1891 |
public: |
|
1892 |
/** |
|
1893 |
* Sets the text to that supplied, replacing the previous contents. |
|
1894 |
* @param aText |
|
1895 |
* Reference to a descriptor containing the new text. |
|
1896 |
*/ |
|
1897 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1898 |
public: |
|
1899 |
/** |
|
1900 |
* Returns the component type. |
|
1901 |
* @return The component type as a MMIDComponent::TType enum. |
|
1902 |
*/ |
|
1903 |
TType Type() const |
|
1904 |
{ |
|
1905 |
return ETicker; |
|
1906 |
} |
|
1907 |
}; |
|
1908 |
||
1909 |
/** |
|
1910 |
* |
|
1911 |
* Class for general utilities. Gives the framework general query methods |
|
1912 |
* for querying the implementation |
|
1913 |
* |
|
1914 |
*/ |
|
1915 |
class MMIDUtils |
|
1916 |
{ |
|
1917 |
public: |
|
1918 |
enum |
|
1919 |
{ |
|
1920 |
EActionUp=1, |
|
1921 |
EActionDown=6, |
|
1922 |
EActionLeft=2, |
|
1923 |
EActionRight=5, |
|
1924 |
EActionFire=8, |
|
1925 |
EActionGameA=9, |
|
1926 |
EActionGameB=10, |
|
1927 |
EActionGameC=11, |
|
1928 |
EActionGameD=12 |
|
1929 |
}; |
|
1930 |
enum TImageType |
|
1931 |
{ |
|
1932 |
EListImage = 1, |
|
1933 |
EChoiceImage, |
|
1934 |
EAlertImage |
|
1935 |
}; |
|
1936 |
enum TColorType |
|
1937 |
{ |
|
1938 |
EColorBackground=0, |
|
1939 |
EColorForeground=1, |
|
1940 |
EColorHighlightedBackground=2, |
|
1941 |
EColorHighlightedForeground=3, |
|
1942 |
EColorBorder=4, |
|
1943 |
EColorHighlightedBorder=5 |
|
1944 |
}; |
|
1945 |
enum TGraphicsType |
|
1946 |
{ |
|
1947 |
ESolid=0, |
|
1948 |
EDotted=1 |
|
1949 |
}; |
|
1950 |
public: |
|
1951 |
||
1952 |
/** |
|
1953 |
* Alert the user by playing the sound for this AlertType. |
|
1954 |
* @param aType |
|
1955 |
* The alert type for which to play the sound. |
|
1956 |
* @return ETrue if the user was alerted, EFalse otherwise. |
|
1957 |
*/ |
|
1958 |
virtual TBool PlaySound(TInt aType) = 0; |
|
1959 |
||
1960 |
/** |
|
1961 |
* Return whether the framework should attempt to translate |
|
1962 |
* the scancode and post an event up to Java. |
|
1963 |
* This method may be unneccessary as the filtering |
|
1964 |
* can be done in MapScanCode(MapSpecialKey)below. |
|
1965 |
* @param aScanCode |
|
1966 |
* The scancode to be translated. |
|
1967 |
* @return ETrue or EFalse |
|
1968 |
*/ |
|
1969 |
virtual TBool IsJavaKey(TInt aScanCode) = 0; |
|
1970 |
||
1971 |
/** |
|
1972 |
* Translate scan code to MIDP key code. Only called for |
|
1973 |
* 'special' codes that could not be mapped to unicode |
|
1974 |
* characters. Must return a negative key code or zero |
|
1975 |
* if no key event should be sent to Java. |
|
1976 |
* @param aScanCode |
|
1977 |
* The scancode to be translated. |
|
1978 |
* @return The MIDP key code. |
|
1979 |
*/ |
|
1980 |
virtual TInt MapNonUnicodeKey(TUint aScanCode) = 0; |
|
1981 |
||
1982 |
/** |
|
1983 |
* Gets an informative key string for aKeyCode |
|
1984 |
* @param aText |
|
1985 |
* Descriptor references to receive the key string. |
|
1986 |
* @param aKeyCode |
|
1987 |
* The keycode to retrieve. |
|
1988 |
*/ |
|
1989 |
virtual void GetKeyName(TDes& aText,TInt aKeyCode) = 0; |
|
1990 |
||
1991 |
/** |
|
1992 |
* Return the MIDP Canvas game action corresponding to |
|
1993 |
* MIDP key code aKeyCode, or zero if no game action is |
|
1994 |
* associated with this key code. |
|
1995 |
* @param aKeyCode |
|
1996 |
* The keycode to retrieve. |
|
1997 |
* @return The MIDP Canvas game action. |
|
1998 |
*/ |
|
1999 |
virtual TInt GetGameAction(TInt aKeyCode) = 0; |
|
2000 |
||
2001 |
/** |
|
2002 |
* Return the cannonical key code corresponding to the |
|
2003 |
* Canvas game action aGameAction. |
|
2004 |
* Must provide a mapping for every game action. |
|
2005 |
* Return zero if aGameAction is not a valid game action. |
|
2006 |
* @param aGameAction |
|
2007 |
* The game action. |
|
2008 |
* @return The keycode corresponding to the game action. |
|
2009 |
*/ |
|
2010 |
virtual TInt GetKeyCode(TInt aGameAction) = 0; |
|
2011 |
||
2012 |
/** |
|
2013 |
* Map one of the standard font types INPUT/STATIC to a font specifier. |
|
2014 |
* This mapping is platform dependent. |
|
2015 |
* |
|
2016 |
* An INPUT Text Specifier will use:- |
|
2017 |
* Face: EMonospaced, Style: EBold, Size: EMedium |
|
2018 |
* A STATIC Text Specifier will use:- |
|
2019 |
* Face: EProportional, Style: EPlain, Size: ESmall |
|
2020 |
* Otherwise a default specifer will be chosen:- |
|
2021 |
* Face: ESystem, Style: EPlain, Size: ESmall |
|
2022 |
* @param aSpecifier |
|
2023 |
* The font type |
|
2024 |
* @return The font specifier |
|
2025 |
*/ |
|
2026 |
virtual SFontSpec FontSpecifierSpecs(MMIDFont::TFontSpecifier aSpecifier) = 0; |
|
2027 |
||
2028 |
/** |
|
2029 |
* Requests a flashing effect for the device's backlight. |
|
2030 |
* @param aDuration |
|
2031 |
* The length of time to flash. |
|
2032 |
* @return ETrue if the request was satisfied, EFalse otherwise. |
|
2033 |
*/ |
|
2034 |
virtual TBool FlashBacklightL(const TTimeIntervalMicroSeconds32& aDuration) = 0; |
|
2035 |
||
2036 |
/** |
|
2037 |
* Requests operation of the device's vibrator. |
|
2038 |
* @param aDuration |
|
2039 |
* The length of time to vibrate. |
|
2040 |
* @return ETrue if the request was satisfied, EFalse otherwise. |
|
2041 |
*/ |
|
2042 |
virtual TBool Vibrate(const TTimeIntervalMicroSeconds32& aDuration) = 0; |
|
2043 |
||
2044 |
/** |
|
2045 |
* Mapping Uikon TLogical Color to Java ColorSpecifier |
|
2046 |
* @param aColorSpecifier |
|
2047 |
* The Java colour specifier. |
|
2048 |
* @return The Uikon colour. |
|
2049 |
*/ |
|
2050 |
virtual TInt Color(TColorType aColorSpecifier) = 0; |
|
2051 |
||
2052 |
/** |
|
2053 |
* Returns if the platform supports pointer press and release events. |
|
2054 |
* @return ETrue or EFalse. |
|
2055 |
*/ |
|
2056 |
virtual TBool HasPointerEvents() = 0; |
|
2057 |
||
2058 |
/** |
|
2059 |
* Returns if the platform supports pointer motion events (pointer dragged). |
|
2060 |
* @return ETrue or EFalse. |
|
2061 |
*/ |
|
2062 |
virtual TBool HasPointerMotionEvents() = 0; |
|
2063 |
||
2064 |
/** |
|
2065 |
* Returns if the platform generates repeat events when key is kept down. |
|
2066 |
* @return ETrue or EFalse. |
|
2067 |
*/ |
|
2068 |
virtual TBool HasRepeatEvents() = 0; |
|
2069 |
||
2070 |
/** |
|
2071 |
* Returns the stroke style used for border drawing depending |
|
2072 |
* on the state of the component (highlighted/non-highlighted). |
|
2073 |
* @param aHighlighted |
|
2074 |
* If ETrue, return highlighted stroke style, otherwise non-highlighted. |
|
2075 |
* @return The bstroke style. |
|
2076 |
*/ |
|
2077 |
virtual TGraphicsType BorderStyle(TBool aHighlighted) = 0; |
|
2078 |
||
2079 |
/** |
|
2080 |
* Returns the Best image size for a given image type. |
|
2081 |
* @param aImageType |
|
2082 |
* The image type. |
|
2083 |
* @return The best image size. |
|
2084 |
*/ |
|
2085 |
virtual TSize BestImageSize(TImageType aImageType) const = 0; |
|
2086 |
||
2087 |
/** |
|
2088 |
* Method fills aText parameter with String value of actual keyboard layout. |
|
2089 |
* @param aText |
|
2090 |
* String value of actual keyboard layout. |
|
2091 |
*/ |
|
2092 |
virtual void GetKeyboardTypeName(TDes* aText) = 0; |
|
2093 |
||
2094 |
/** |
|
2095 |
* Method returns value of the scan code of the latest key event. |
|
2096 |
* @return Integer value of the scan code of the latest key event. |
|
2097 |
*/ |
|
2098 |
virtual TInt GetKeyScanCode() = 0; |
|
2099 |
||
2100 |
/** |
|
2101 |
* Update with last key event. |
|
2102 |
* @return Integer value of the scan code of the latest key event. |
|
2103 |
*/ |
|
2104 |
virtual void SetLastKeyEvent(const TKeyEvent& aEvent) = 0; |
|
2105 |
||
2106 |
/** |
|
2107 |
* Method returns value of the modifier keys state. |
|
2108 |
* @return Integer value of the scan code of the latest key event. |
|
2109 |
*/ |
|
2110 |
virtual TInt GetKeyModifier() = 0; |
|
2111 |
||
2112 |
/** |
|
2113 |
* Map key event data with ITI Engine. |
|
2114 |
*/ |
|
2115 |
virtual void MappingDataForKey(TKeyEvent& aEvent, TEventCode aType) = 0; |
|
2116 |
||
2117 |
/** |
|
2118 |
* Update Utils implementation with resoruce change. |
|
2119 |
*/ |
|
2120 |
virtual void HandleResourceChangedL() = 0; |
|
2121 |
||
2122 |
/** |
|
2123 |
* Update Utils implementation with foreground change. |
|
2124 |
*/ |
|
2125 |
virtual void HandleForegroundL(TBool aForeground) = 0; |
|
2126 |
||
2127 |
virtual void Dispose() = 0; |
|
2128 |
}; |
|
2129 |
||
2130 |
/** |
|
2131 |
* |
|
2132 |
* Definition of events which can be posted to Java |
|
2133 |
* |
|
2134 |
*/ |
|
2135 |
enum TSourceType |
|
2136 |
{ |
|
2137 |
EItem=3, |
|
2138 |
EDisplayable, |
|
2139 |
EMIDlet, |
|
2140 |
ECanvasGraphicsItemPainterEvent=7 //number 6 is used for deprecated item on Java side |
|
2141 |
}; |
|
2142 |
||
2143 |
/** |
|
2144 |
* Various event types used throught the VM. |
|
2145 |
*/ |
|
2146 |
enum TEventType |
|
2147 |
{ |
|
2148 |
ENoType=0, |
|
2149 |
// Canvas & CustomItem |
|
2150 |
EPaint=10, |
|
2151 |
EKeyPressed, |
|
2152 |
EKeyReleased, |
|
2153 |
EKeyRepeated, |
|
2154 |
EPointerPressed, |
|
2155 |
EPointerReleased, |
|
2156 |
EPointerDragged, |
|
2157 |
// Displayable |
|
2158 |
ESizeChanged, |
|
2159 |
// MIDlet |
|
2160 |
EExit=18, |
|
2161 |
//posted by the framework when the MIDlet switches to the foreground |
|
2162 |
EForeground, |
|
2163 |
//posted by the framework when the MIDlet switches to the background |
|
2164 |
EBackground, |
|
2165 |
EPause, |
|
2166 |
EStart, |
|
2167 |
EDestroy, |
|
2168 |
// Displayable |
|
2169 |
ECommand, |
|
2170 |
// CustomItem |
|
2171 |
EVisible, |
|
2172 |
EFocusTraversal, |
|
2173 |
ERefresh, // deprecated |
|
2174 |
// Display |
|
2175 |
EMakeItemCurrent, // deprecated |
|
2176 |
ESetCurrent, |
|
2177 |
ESerial, |
|
2178 |
//CanvsGraphicsItem events |
|
2179 |
ECanvasGraphicsItemRepaint, |
|
2180 |
// Alert |
|
2181 |
EDismiss = 0, // Futuredev: value |
|
2182 |
// Form/Item |
|
2183 |
EItemChanged = 0, // Futuredev: value |
|
2184 |
// EList |
|
2185 |
ESelect = 0, // Futuredev: value |
|
2186 |
EM3GDraw = 32, // M3G content is drowned on canvas |
|
2187 |
EForcedPaint = 33, |
|
2188 |
EFreeGraphicsMemory = 34 |
|
2189 |
}; |
|
2190 |
||
2191 |
/** |
|
2192 |
* Reusable notify priority event used to unblock a Java thread |
|
2193 |
* waiting for completion of a native async operation. |
|
2194 |
*/ |
|
2195 |
class MMIDNotifyEvent |
|
2196 |
{ |
|
2197 |
public: |
|
2198 |
/** |
|
2199 |
* Set the value passed into the VM as the async operation result/error code. |
|
2200 |
* @param aResult |
|
2201 |
* The result/error code. |
|
2202 |
*/ |
|
2203 |
virtual void SetResult(TInt aResult) = 0; |
|
2204 |
/** |
|
2205 |
* Destroy the event. Caller must guarantee that the event is not |
|
2206 |
* enqueued. |
|
2207 |
*/ |
|
2208 |
virtual void Dispose() = 0; |
|
2209 |
}; |
|
2210 |
||
2211 |
/** |
|
2212 |
* MIDP Key Event. |
|
2213 |
* |
|
2214 |
* Encapsulates key event information required to translate and post |
|
2215 |
* key events. |
|
2216 |
* |
|
2217 |
* Must be translated from a WSERV TKeyEvent via a call to |
|
2218 |
* MMIDEnv::TranslateKey() before calling MMIDEnv::PostKeyEvent() |
|
2219 |
* |
|
2220 |
*/ |
|
2221 |
struct TMIDKeyEvent |
|
2222 |
{ |
|
2223 |
enum TEvent |
|
2224 |
{ |
|
2225 |
EPressed =0x01, |
|
2226 |
EReleased=0x02, |
|
2227 |
ERepeated=0x04 |
|
2228 |
}; |
|
2229 |
||
2230 |
TUint32 iEvents; |
|
2231 |
TInt iKeyCode; |
|
2232 |
TInt iRepeats; |
|
2233 |
}; |
|
2234 |
||
2235 |
/** |
|
2236 |
* |
|
2237 |
* A MIDlet environment observer for receiving general events about the environment (i.e. that |
|
2238 |
* releate to the entire MIDlet as opposed to a particular Displayable etc.). Foreground/ |
|
2239 |
* SwitchOn events are useful, for example, for suspending animations which would otherwise keep |
|
2240 |
* the machine alive |
|
2241 |
* |
|
2242 |
*/ |
|
2243 |
class MMIDEnvObserver |
|
2244 |
{ |
|
2245 |
public: |
|
2246 |
/** |
|
2247 |
* HandleSwitchOnL(ETrue) is called in these circumstances: |
|
2248 |
* - When the device is switched on. |
|
2249 |
* - If the MIDlet has been paused due to a CSaveNotifier event, |
|
2250 |
* HandleSwitchOnL(ETrue) is called when the MIDlet is brought to the foreground. |
|
2251 |
* |
|
2252 |
* HandleSwitchOnL(EFalse) is called in these circumstances: |
|
2253 |
* - The framework uses the CSaveNotifier framework to provide MIDlet state changes. |
|
2254 |
* When the following events are received ESaveAll,ESaveQuick,ESaveData,EReleaseRAM |
|
2255 |
* the MIDlet is paused and HandleSwitchOnL(EFalse) is called. |
|
2256 |
*/ |
|
2257 |
virtual void HandleSwitchOnL(TBool aSwitchOn) = 0; |
|
2258 |
||
2259 |
/** |
|
2260 |
* Handles the case when the MIDlet is brought to the foreground. |
|
2261 |
*/ |
|
2262 |
virtual void HandleForegroundL(TBool aForeground) = 0; |
|
2263 |
||
2264 |
/** |
|
2265 |
* Handles a change to resources which are shared accross the environment. |
|
2266 |
*/ |
|
2267 |
virtual void HandleResourceChangeL(TInt aType) = 0; |
|
2268 |
||
2269 |
#ifdef RD_JAVA_NGA_ENABLED |
|
2270 |
/** |
|
2271 |
* Called when MIDlet gains or loses partial/full foreground. |
|
2272 |
* Application (CAknAppUi::HandleWsEventL()) gets AknFullOrPartialForegroundGained event |
|
2273 |
* when it becomes at least partially visible even if it would not be the foreground application. |
|
2274 |
* AknFullOrPartialForegroundLost is received when application is not all visible anymore. |
|
2275 |
*/ |
|
2276 |
virtual void HandleFullOrPartialForegroundL(TBool /*aFullOrPartialFg*/) {} |
|
2277 |
||
2278 |
/** |
|
2279 |
* Called when all graphics memory needs to be freed immediately. |
|
2280 |
*/ |
|
2281 |
virtual void HandleFreeGraphicsMemory() {} |
|
2282 |
#endif //RD_JAVA_NGA_ENABLED |
|
2283 |
}; |
|
2284 |
||
2285 |
/** |
|
2286 |
* |
|
2287 |
* A MIDlet environment, one per MIDlet, providing utility methods for the MIDP implementation. |
|
2288 |
* A concrete implementation is provided by the framework, passed in through |
|
2289 |
* MMIDComponentFactory::ConstructL() where the implementation can cache it and use it as |
|
2290 |
* necessary. |
|
2291 |
* |
|
2292 |
*/ |
|
2293 |
class MMIDEnv |
|
2294 |
{ |
|
2295 |
public: |
|
2296 |
/** |
|
2297 |
* Use these methods to disptach events back into Java |
|
2298 |
*/ |
|
2299 |
virtual TBool PostJavaEvent(MMIDComponent& aSource,TSourceType aSourceType,TEventType aEventType,TInt aEventData,TInt aEventData1,TInt aEventData2) = 0; |
|
2300 |
virtual TBool PostJavaEvent(MMIDComponent& aSource,TSourceType aSourceType,TEventType aEventType=ENoType,TInt aEventData=0) = 0; |
|
2301 |
virtual TBool PostJavaEvent(MMIDComponent& aSource,TSourceType aSourceType,TInt aEventData) = 0; |
|
2302 |
virtual TBool PostMidletEvent(TEventType aEventType) = 0; |
|
2303 |
||
2304 |
/** |
|
2305 |
* Create a notify priority event to send up to the java peer to |
|
2306 |
* aSource. |
|
2307 |
*/ |
|
2308 |
virtual MMIDNotifyEvent* NewNotifyL(MMIDComponent& aSource) = 0; |
|
2309 |
||
2310 |
/** |
|
2311 |
* Post a notify priority event to unblock a java thread. |
|
2312 |
* MMIDNotifyEvent instances are 'reusable' events. That is the event |
|
2313 |
* queue does not delete the instance after dispatch. Due to the intrusive |
|
2314 |
* queue structure used, a resuable event cannot be present on the queue |
|
2315 |
* twice. |
|
2316 |
* The client is responsible for ensuring that the event does not get |
|
2317 |
* posted on to the queue unless there are no pending dispatches for that |
|
2318 |
* event. i.e. unless the event is not already on the queue. |
|
2319 |
* |
|
2320 |
* This is usually acheived with an object monitor in java protecting the |
|
2321 |
* native method(s) that required an async notification. |
|
2322 |
*/ |
|
2323 |
virtual TBool PostJavaNotify(MMIDNotifyEvent* aEvent) = 0; |
|
2324 |
||
2325 |
/** |
|
2326 |
* Key translation. Maps OS key event to MIDP key event |
|
2327 |
* |
|
2328 |
* @param aEvent |
|
2329 |
* @param aKeyEvent |
|
2330 |
* @param aType |
|
2331 |
* @return |
|
2332 |
* |
|
2333 |
* @since S60 |
|
2334 |
*/ |
|
2335 |
virtual TBool TranslateKeyL(TMIDKeyEvent& aEvent, const TKeyEvent& aKeyEvent, TEventCode aType) = 0; |
|
2336 |
virtual TBool PostKeyEvent(MMIDComponent& aSource, TMIDKeyEvent& aEvent) = 0; |
|
2337 |
virtual void ResetKeys() = 0; |
|
2338 |
||
2339 |
/** |
|
2340 |
* Returns the Displayable which has last been made current, or null if none has |
|
2341 |
*/ |
|
2342 |
virtual MMIDDisplayable* Current() = 0; |
|
2343 |
/** |
|
2344 |
* MIDlet properties |
|
2345 |
*/ |
|
2346 |
virtual TPtrC MidletName() const = 0; |
|
2347 |
virtual TUid MidletUid() const = 0; |
|
2348 |
virtual TPtrC MidletHome() const = 0; |
|
2349 |
||
2350 |
#ifdef RD_SCALABLE_UI_V2 |
|
2351 |
// This function can be moved out from RD_SCALABLE_UI_V2 flag if needed. |
|
2352 |
// It is behind this flag because currently it is used only by Touch. |
|
2353 |
/** |
|
2354 |
* Returns MIDlet suite uid of this midlet. |
|
2355 |
* The midlet suite uid is same for all midlets inside one midlet suite. |
|
2356 |
* |
|
2357 |
* @return MIDlet suite uid |
|
2358 |
* @since S60 5.0 |
|
2359 |
*/ |
|
2360 |
virtual TUid MidletSuiteUid() = 0; |
|
2361 |
#endif //RD_SCALABLE_UI_V2 |
|
2362 |
||
2363 |
/** |
|
2364 |
*@return The number of colors available in the |
|
2365 |
* displaymode used for Images and Graphics. |
|
2366 |
*/ |
|
2367 |
virtual TInt NumColors() = 0; |
|
2368 |
||
2369 |
/** |
|
2370 |
*@return The SymbianOS display mode that the VM will use for |
|
2371 |
* Images, Canvases and CustomItems. |
|
2372 |
*/ |
|
2373 |
virtual TDisplayMode DisplayMode() = 0; |
|
2374 |
||
2375 |
/** |
|
2376 |
* Sets the zoomed size of the canvas. |
|
2377 |
* May be set to TSize(0,0) if no zooming. |
|
2378 |
*/ |
|
2379 |
virtual void SetCanvasZoomSize(const TSize& aSize) = 0; |
|
2380 |
||
2381 |
/** |
|
2382 |
* Returns the zoomed size of the canvas paintable area. |
|
2383 |
* May return TSize(0,0) if no zooming is in effect. |
|
2384 |
*/ |
|
2385 |
virtual TSize CanvasZoomSize() = 0; |
|
2386 |
||
2387 |
/** |
|
2388 |
* Returns assumed canvas size as specified in jad, or TSize(0,0) |
|
2389 |
* if none was specified. This determines the size of the canvas in |
|
2390 |
* pixels that is paintable by the java peer. Zooming may alter the |
|
2391 |
* apparent size on screen. |
|
2392 |
*/ |
|
2393 |
virtual TSize CanvasAssumedSize() = 0; |
|
2394 |
||
2395 |
/** |
|
2396 |
* Add/remove observers for receiving events about the environment. It is important that |
|
2397 |
* observers are removed before being deleted. |
|
2398 |
*/ |
|
2399 |
virtual void AddObserverL(MMIDEnvObserver& aObserver) = 0; |
|
2400 |
virtual void RemoveObserver(MMIDEnvObserver& aObserver) = 0; |
|
2401 |
||
2402 |
/** |
|
2403 |
* Gets a MIDlet Suite attribute value. MIDlet Suite attributes are specified in the |
|
2404 |
* MIDlet Suite manifest and jad. |
|
2405 |
* |
|
2406 |
* @param aAttributeName |
|
2407 |
* The name of the attribute to get. |
|
2408 |
* @param aAttributeValue |
|
2409 |
* On return, this will be set to the attribute value. |
|
2410 |
* @return KErrNone if aAttributeValue has successfully been set. |
|
2411 |
* KErrNotFound if there is no attribute whose name is aAttributeName. |
|
2412 |
*/ |
|
2413 |
virtual TInt MidletAttribute(const TDesC& aAttributeName, TPtrC& aAttributeValue) = 0; |
|
2414 |
||
2415 |
/** |
|
2416 |
* Checks if the MIDlet Suite attribute is set to certain value. |
|
2417 |
* |
|
2418 |
* @param aAttributeName |
|
2419 |
* The name of the attribute whose content is checked. |
|
2420 |
* @param aAttributeValue |
|
2421 |
* The value the of the attribute. Method checks whether the attribute |
|
2422 |
* specifed by aAttributeName is set to this value. Comparison is case |
|
2423 |
* insensitive but otherwise the string much match exactly (e.g. no spaces allowed) |
|
2424 |
* @return ETrue if aAttribute is set to value aAttributeValue, EFalse otherwise |
|
2425 |
* |
|
2426 |
* @see MMIDEnv::MidletAttribute() |
|
2427 |
*/ |
|
2428 |
virtual TBool MidletAttributeIsSetToVal(const TDesC& aAttributeName, const TDesC& aAttributeValue) = 0; |
|
2429 |
||
2430 |
/** |
|
2431 |
* Checks if the MIDlet Suite attribute contains a certain value. If a jad attribute contains several |
|
2432 |
* values, they must be separated with commas only, spaces between commas and value string are not allowed. |
|
2433 |
* |
|
2434 |
* @param aAttributeName |
|
2435 |
* The name of the attribute whose content is checked. |
|
2436 |
* @param aAttributeValue |
|
2437 |
* The value the of the attribute. Method checks whether the attribute |
|
2438 |
* specifed by aAttributeName contains this value. Comparison is case |
|
2439 |
* insensitive. |
|
2440 |
* @return ETrue if aAttribute contains value aAttributeValue and attribute syntax is correct, |
|
2441 |
* EFalse otherwise |
|
2442 |
* |
|
2443 |
* @see MMIDEnv::MidletAttribute() |
|
2444 |
*/ |
|
2445 |
virtual TBool MidletAttributeContainsVal(const TDesC& aAttributeName, const TDesC& aAttributeValue) = 0; |
|
2446 |
||
2447 |
/** |
|
2448 |
* Change the default screen size. |
|
2449 |
* |
|
2450 |
* @param aSize |
|
2451 |
* The size which the screen will become. |
|
2452 |
*/ |
|
2453 |
virtual void SetCanvasAssumedSize(const TSize& aSize) = 0; |
|
2454 |
||
2455 |
/** |
|
2456 |
* Reserve a native frame buffer for a <code>MMIDCanvas</code> object. |
|
2457 |
* MMIDCanvas's counterpart in java side could be <code>Canvas</code> or |
|
2458 |
* <code>GameCanvas</code>. A MIDlet's <code>Canvas</code> objects should share the |
|
2459 |
* same native side frame buffer but <code>GameCanvas</code> objects must use their |
|
2460 |
* own frame buffers. |
|
2461 |
* @param aCanvas Target Canvas |
|
2462 |
* @param aSz Frame buffer size |
|
2463 |
* @return Frame buffer. |
|
2464 |
* @since S60 5.0 |
|
2465 |
*/ |
|
2466 |
virtual CFbsBitmap* ReserveCanvasFrameBufferL(MMIDCanvas& aCanvas, const TSize& aSz) = 0; |
|
2467 |
||
2468 |
/** |
|
2469 |
* Release a frame buffer. |
|
2470 |
* @param aCanvas Target canvas |
|
2471 |
* @param aFrameBuffer If <code>aCanvas</code> object's counterpart in java side is |
|
2472 |
<code>GameCanvas</code> then the <code>aFrameBuffer</code> is just deleted. |
|
2473 |
However if the counterpart is <code>Canvas</code> then an internal reference |
|
2474 |
count is decreased. If the reference count goes to zero then the frame buffer |
|
2475 |
(that was shared shared by multiple <code>MMIDCanvas</code> objects) is going |
|
2476 |
to be deleted. |
|
2477 |
* @since S60 5.0 |
|
2478 |
*/ |
|
2479 |
virtual void ReleaseCanvasFrameBuffer(MMIDCanvas& aCanvas, CFbsBitmap*& aFrameBuffer) = 0; |
|
2480 |
||
2481 |
/** |
|
2482 |
* A Canvas object's background image (e.g image/theme) might be shown or not. |
|
2483 |
* A backgound image can be shown if the <code>Nokia-UI-Enhancement</code> attribute |
|
2484 |
* is <code>CanvasHasBackground</code>. The attribute may be placed in the JAD or the manifest. |
|
2485 |
* @param aCanvas Target canvas |
|
2486 |
* @param Return <code>ETrue</code> if a background image can be shown. |
|
2487 |
* @since S60 5.0 |
|
2488 |
*/ |
|
2489 |
virtual TBool CanvasHasBackground(const MMIDCanvas& aCanvas) const = 0; |
|
2490 |
||
2491 |
#ifdef RD_JAVA_NGA_ENABLED |
|
2492 |
||
2493 |
/** |
|
2494 |
* Hardware accelarator types |
|
2495 |
* @since S60 9.2 |
|
2496 |
*/ |
|
2497 |
typedef enum |
|
2498 |
{ |
|
2499 |
EHardware3D = (1 << 1), |
|
2500 |
EHardware2D = (1 << 2) |
|
2501 |
} THardwareType; |
|
2502 |
||
2503 |
/** |
|
2504 |
* Checks if hardware acceleration is available |
|
2505 |
* @param aHardwareType Defines the type |
|
2506 |
* @return True if specified hw exists. |
|
2507 |
* @since S60 9.2 |
|
2508 |
*/ |
|
2509 |
virtual TBool IsHardwareAcceleratedL( |
|
2510 |
MMIDEnv::THardwareType aHardwareType) = 0; |
|
2511 |
||
2512 |
/** |
|
2513 |
* Called when MIDlet's partial/full foreground status is changed. |
|
2514 |
* @since S60 9.2 |
|
2515 |
*/ |
|
2516 |
virtual void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg) = 0; |
|
2517 |
||
2518 |
/** |
|
2519 |
* Called when graphics memory needs to be freed immediately. |
|
2520 |
* @since S60 9.2 |
|
2521 |
*/ |
|
2522 |
virtual void HandleFreeGraphicsMemory() = 0; |
|
2523 |
||
2524 |
/** |
|
2525 |
* Checks if MIDlet is at least partially visible. |
|
2526 |
* @return ETrue if MIDlet has full or partial foreground. |
|
2527 |
* @since S60 9.2 |
|
2528 |
*/ |
|
2529 |
virtual TBool HasFullOrPartialForeground() const = 0; |
|
2530 |
#endif // RD_JAVA_NGA_ENABLED |
|
2531 |
||
2532 |
/** |
|
2533 |
* Maps low level key event |
|
2534 |
* @param aMidKeyEvent key event output data |
|
2535 |
* @param aEvent key event input data |
|
2536 |
* @since S60 3.2.3 |
|
2537 |
*/ |
|
2538 |
virtual void MappingDataForKey(TKeyEvent& aEvent, TEventCode aType) = 0; |
|
2539 |
||
2540 |
/** |
|
2541 |
* Update with last key event. |
|
2542 |
* @param aEvetn key event |
|
2543 |
* @since S60 3.2.3 |
|
2544 |
*/ |
|
2545 |
virtual void SetLastKeyEvent(const TKeyEvent& aEvent) = 0; |
|
2546 |
||
2547 |
/** |
|
2548 |
* Gets an instance of ToLcduiObserver. |
|
2549 |
* |
|
2550 |
* @since S60 5.0 |
|
2551 |
* @return Pointer to ToLcduiObserver instance |
|
2552 |
*/ |
|
2553 |
virtual MMIDToLcduiObserver& ToLcduiObserver() = 0; |
|
2554 |
||
2555 |
/** |
|
2556 |
* Inform CMIDEnv about deleting of object implementing MMIDDisplayable. |
|
2557 |
* |
|
2558 |
* @param displayable deleting displayble |
|
2559 |
* @since Java 2.0 |
|
2560 |
*/ |
|
2561 |
virtual void DisplayableIsDestructed(const MMIDDisplayable* aDisplayable) = 0; |
|
2562 |
||
2563 |
/** |
|
2564 |
* Returns pointer to last fullscreen Displayble. |
|
2565 |
* |
|
2566 |
* @return Last fullscreen Displayable |
|
2567 |
* @since Java 2.1 |
|
2568 |
*/ |
|
2569 |
virtual const MMIDDisplayable* LastFullscreenDisplayable() const = 0; |
|
2570 |
}; |
|
2571 |
||
2572 |
/** |
|
2573 |
* |
|
2574 |
* Interface class for provider of asynchronous calls to lcdui |
|
2575 |
* which may origin in non-lcdui thread. |
|
2576 |
* |
|
2577 |
* Some events may invoke a callback into specified callback interface. |
|
2578 |
* The receiver of this callback must not be deleted before the event |
|
2579 |
* containing it is processed. |
|
2580 |
* |
|
2581 |
* The callback receiver can be for example implemented |
|
2582 |
* its instance deletion via event using this observer, |
|
2583 |
* so this deletion event will be the last one for that receiver. |
|
2584 |
* |
|
2585 |
* @since S60 v5.0 |
|
2586 |
*/ |
|
2587 |
class MMIDToLcduiObserver |
|
2588 |
{ |
|
2589 |
public: |
|
2590 |
/** |
|
2591 |
* Allows a control to be used during event processing. |
|
2592 |
* |
|
2593 |
* @since S60 5.0 |
|
2594 |
* @param aControl Control to be registered. |
|
2595 |
* @param aCallbackContainer MDirectContainer that is nofied in LCDUI thread |
|
2596 |
* about added MDirectContent. NULL, if notification |
|
2597 |
* is not needed. |
|
2598 |
*/ |
|
2599 |
#ifdef RD_JAVA_NGA_ENABLED |
|
2600 |
virtual void RegisterControl(CCoeControl& aControl, |
|
2601 |
MDirectContainer* aCallbackContainer = NULL) = 0; |
|
2602 |
#else |
|
2603 |
virtual void RegisterControl(CCoeControl& aControl) = 0; |
|
2604 |
#endif |
|
2605 |
||
2606 |
/** |
|
2607 |
* Removes a control from the list of controls allowed |
|
2608 |
* to be used in event processing. |
|
2609 |
* Events which works with this control will be ignored. |
|
2610 |
* |
|
2611 |
* @since S60 5.0 |
|
2612 |
* @param aControl Control to be unregistered. |
|
2613 |
*/ |
|
2614 |
virtual void UnregisterControl(CCoeControl& aControl) = 0; |
|
2615 |
||
2616 |
/** |
|
2617 |
* Flushes the control's graphics content on screen. |
|
2618 |
* The call may origin in other than LCDUI ES thread. |
|
2619 |
* |
|
2620 |
* @since S60 5.0 |
|
2621 |
* @param aControl Control used to get DSA resources from. |
|
2622 |
* @param aRect An area of the control to flush. |
|
2623 |
*/ |
|
2624 |
virtual void FlushControl( |
|
2625 |
CCoeControl& aControl, |
|
2626 |
const TRect &aRect) = 0; |
|
2627 |
||
2628 |
/** |
|
2629 |
* Invokes aConsumer->MdcDSAResourcesCallback from LCDUI ES thread. |
|
2630 |
* The call may origin in other than LCDUI ES thread. |
|
2631 |
* |
|
2632 |
* @since S60 5.0 |
|
2633 |
* @param aControl Control used to get DSA resources from. |
|
2634 |
* @param aConsumer Consumer of the callback. The instance |
|
2635 |
* must not be deleted before the event processed. |
|
2636 |
*/ |
|
2637 |
virtual void InvokeDSAResourcesCallback( |
|
2638 |
CCoeControl& aControl, |
|
2639 |
MUiEventConsumer& aConsumer) = 0; |
|
2640 |
||
2641 |
/** |
|
2642 |
* Invokes aConsumer->MdcUICallback( aCallbackId ) from LCDUI ES thread. |
|
2643 |
* The call may origin in other than LCDUI ES thread. |
|
2644 |
* |
|
2645 |
* @since S60 5.0 |
|
2646 |
* @param aConsumer Consumer of the callback. The instance |
|
2647 |
* must not be deleted before the event processed. |
|
2648 |
* @param aCallbackId Id which is provided to the callback |
|
2649 |
*/ |
|
2650 |
virtual void InvokeUICallback( |
|
2651 |
MUiEventConsumer& aConsumer, |
|
2652 |
TInt aCallbackId) = 0; |
|
2653 |
||
2654 |
virtual void InvokeLcduiEvent(MMIDLcduiEventConsumer& aConsumer, TInt aCallbackId) = 0; |
|
2655 |
}; |
|
2656 |
||
2657 |
/** |
|
2658 |
* |
|
2659 |
* Interface class for constructing native peers to LCDUI objects |
|
2660 |
* |
|
2661 |
* Canvas and Graphics do not have create methods since they |
|
2662 |
* are platform independent. |
|
2663 |
* |
|
2664 |
*/ |
|
2665 |
class MMIDComponentFactory |
|
2666 |
{ |
|
2667 |
public: |
|
2668 |
virtual void ConstructL(MMIDEnv& aEnv) = 0; |
|
2669 |
||
2670 |
/** |
|
2671 |
* Classes derived from Displayable |
|
2672 |
*/ |
|
2673 |
virtual MMIDDisplayable* CreateDisplayableL() = 0; |
|
2674 |
||
2675 |
virtual MMIDCanvas* CreateCanvasL(MMIDDisplayable& aDisplayable, MMIDComponent::TType aCanvasType) = 0; |
|
2676 |
||
2677 |
virtual MMIDAlert* CreateAlertL(MMIDDisplayable& aDisplayable,MMIDAlert::TAlertType aType,const TDesC& aString,MMIDImage* aPicture) = 0; |
|
2678 |
virtual MMIDForm* CreateFormL(MMIDDisplayable& aDisplayable) = 0; |
|
2679 |
virtual MMIDList* CreateListL(TInt aType,MMIDDisplayable& aDisplayable,RArray<TPtrC>& aStringArray, RArray<MMIDImage*>& aImageArray) = 0; |
|
2680 |
virtual MMIDTextBox* CreateTextBoxL(TInt aConstraints,TInt aMaxSize,const TDesC& aText,MMIDDisplayable& aDisplayable) = 0; |
|
2681 |
||
2682 |
/** |
|
2683 |
* Classes derived from Item |
|
2684 |
*/ |
|
2685 |
virtual MMIDImageItem* CreateImageItemL(const TDesC& aLabel,MMIDImage* aImage,MMIDItem::TLayout aLayout,MMIDItem::TAppearance aAppearance,const TDesC& aAltText) = 0; |
|
2686 |
virtual MMIDStringItem* CreateStringItemL(const TDesC& aLabel,const TDesC& aText,MMIDItem::TAppearance aAppearance) = 0; |
|
2687 |
virtual MMIDDateField* CreateDateFieldL(const TDesC& aLabel, MMIDDateField::TInputMode aInputMode) = 0; |
|
2688 |
||
2689 |
/** |
|
2690 |
* aMaxValue could take the special value MMIDGauge::EIndefinite in order to indicate that the Gauge |
|
2691 |
* has indefinite range. If this is the case, then aInitialValue will take one of the values |
|
2692 |
* MMIDGauge::EContinousIdle,MMIDGauge::EContinousRunning, MMIDGauge::EIncrementalIdle or |
|
2693 |
* MMIDGauge::EIncrementalRunning |
|
2694 |
*/ |
|
2695 |
virtual MMIDGauge* CreateGaugeL(const TDesC& aLabel,TBool aInteractive,TInt aMaxValue,TInt aInitialValue) = 0; |
|
2696 |
||
2697 |
virtual MMIDTextField* CreateTextFieldL(const TDesC& aLabel,const TDesC& aText,TInt aConstraints,TInt aMaxSize) = 0; |
|
2698 |
virtual MMIDChoiceGroup* CreateChoiceGroupL(const TDesC& aLabel,TInt aType,RArray<TPtrC>& aStrings, RArray<MMIDImage*>& aImages) = 0; |
|
2699 |
virtual MMIDSpacer* CreateSpacerL(const TSize& aMinimumSize) = 0; |
|
2700 |
virtual MMIDCustomItem* CreateCustomItemL(const TDesC& aLabel) = 0; |
|
2701 |
||
2702 |
/** |
|
2703 |
* Other UI components |
|
2704 |
*/ |
|
2705 |
virtual MMIDFont* CreateFontL(TUint aStyle,TUint aSize,TInt aFace,TBool aIsFreeSizeFont) = 0; |
|
2706 |
virtual MMIDTicker* CreateTickerL(const TDesC& aText) = 0; |
|
2707 |
virtual MMIDCommand* CreateCommandL(const TDesC& aShortLabel,const TDesC& aLongLabel,MMIDCommand::TCommandType aCommandType,TInt aPriority,TInt aCommandID) = 0; |
|
2708 |
||
2709 |
/** |
|
2710 |
* Create a Utility Class object. |
|
2711 |
*/ |
|
2712 |
virtual MMIDUtils* CreateUtilsL() = 0; |
|
2713 |
||
2714 |
/** |
|
2715 |
* Destroy the component factory and free the resources. |
|
2716 |
*/ |
|
2717 |
virtual void Dispose() = 0; |
|
2718 |
||
2719 |
/** |
|
2720 |
* Creates a new text editor component. Note that text editor is current a custom |
|
2721 |
* component and not a standard LCDUI UI component. |
|
2722 |
* |
|
2723 |
* The implementation is part of nokialcdui component and s60lcdui plug-in. |
|
2724 |
* |
|
2725 |
* The ownership is transferred to the caller. |
|
2726 |
* |
|
2727 |
* @param aMaxSize The maximum size of the editor's content. |
|
2728 |
* @param aWidth The width of the editor in pixels. |
|
2729 |
* @param aHeight The height of the editor in pixels. |
|
2730 |
* @param aHeightInRows Defines whether the height of the editor should be |
|
2731 |
* represented as in rows or in pixels. |
|
2732 |
*/ |
|
2733 |
virtual MMIDTextEditor* CreateTextEditorL( |
|
2734 |
TInt aMaxSize, |
|
2735 |
TInt aWidth, |
|
2736 |
TInt aHeight, |
|
2737 |
TBool aHeightInRows) = 0; |
|
2738 |
||
2739 |
/** |
|
2740 |
* Creates a new canvas graphics item component. Note that canvas |
|
2741 |
* graphics item is currently a custom component and not a standard |
|
2742 |
* LCDUI UI component. |
|
2743 |
* |
|
2744 |
* The implementation is part of nokialcdui component and s60lcdui plug-in. |
|
2745 |
* |
|
2746 |
* The ownership is transferred to the caller. |
|
2747 |
* |
|
2748 |
* @param aItemPainter Pointer to its painter control. |
|
2749 |
* @since S60 5.0 |
|
2750 |
*/ |
|
2751 |
virtual MMIDCanvasGraphicsItem* CreateCanvasGraphicsItemL( |
|
2752 |
MMIDCanvasGraphicsItemPainter* aItemPainter) = 0; |
|
2753 |
||
2754 |
/** |
|
2755 |
* Creates a new canvas graphics item painter control. |
|
2756 |
* |
|
2757 |
* The implementation is part of nokialcdui component and s60lcdui plug-in. |
|
2758 |
* |
|
2759 |
* The ownership is transferred to the caller. |
|
2760 |
* |
|
2761 |
* @param aWidth The width of the editor in pixels. |
|
2762 |
* @param aHeight The height of the editor in pixels. |
|
2763 |
* @since S60 5.0 |
|
2764 |
*/ |
|
2765 |
virtual MMIDCanvasGraphicsItemPainter* CreateCanvasGraphicsItemPainterL( |
|
2766 |
TInt aWidth, |
|
2767 |
TInt aHeight) = 0; |
|
2768 |
}; |
|
2769 |
||
2770 |
||
2771 |
inline TInt MIDHandle(MMIDComponent* aComponent) |
|
2772 |
{ |
|
2773 |
return TInt(reinterpret_cast<TUint32>(aComponent) >> 2); |
|
2774 |
} |
|
2775 |
||
2776 |
inline MMIDComponent* MIDUnhandComponent(TInt aHandle) |
|
2777 |
{ |
|
2778 |
ASSERT(aHandle >= 0); |
|
2779 |
return reinterpret_cast<MMIDComponent*>(aHandle << 2); |
|
2780 |
} |
|
2781 |
||
2782 |
template <class T> |
|
2783 |
inline T* MIDUnhand(TInt aHandle) |
|
2784 |
{ |
|
2785 |
return static_cast<T*>(MIDUnhandComponent(aHandle)); |
|
2786 |
} |
|
2787 |
||
2788 |
#define MIDUnhandObject MIDUnhand |
|
2789 |
||
2790 |
/** |
|
2791 |
* Buffered operations passed to MMIDBufferProcessor interfaces |
|
2792 |
*/ |
|
2793 |
struct TMIDBufferOp |
|
2794 |
{ |
|
2795 |
public: |
|
2796 |
/** |
|
2797 |
*@return The opcode written into the buffer by the |
|
2798 |
* Java peer. Each buffer processor class has its own |
|
2799 |
* independent opcode space. |
|
2800 |
*/ |
|
2801 |
inline TInt OpCode() const |
|
2802 |
{ |
|
2803 |
ASSERT(!IsActivate()); |
|
2804 |
return TInt(Header() >> 16); |
|
2805 |
} |
|
2806 |
||
2807 |
/** |
|
2808 |
*@return size of operation in words including the header. |
|
2809 |
*/ |
|
2810 |
inline TInt Size() const |
|
2811 |
{ |
|
2812 |
return TInt(Header() & 0x0000FFFF); |
|
2813 |
} |
|
2814 |
||
2815 |
/** |
|
2816 |
* Debug builds will panic if this method is called on an opcode with no data. |
|
2817 |
* |
|
2818 |
*@return Pointer to start of opcode data. |
|
2819 |
*/ |
|
2820 |
inline const TAny* Data() const |
|
2821 |
{ |
|
2822 |
ASSERT(Size() > 1); |
|
2823 |
return (const TAny*)&(iHeader[1]); |
|
2824 |
} |
|
2825 |
||
2826 |
/** |
|
2827 |
* Used by framework to track changes of processor. Processors |
|
2828 |
* should never receive an TMIDBufferOp for which IsActivate |
|
2829 |
* returns ETrue. |
|
2830 |
* |
|
2831 |
*@return ETrue if this command is an activation command. |
|
2832 |
*/ |
|
2833 |
inline TBool IsActivate() const |
|
2834 |
{ |
|
2835 |
return (Header() >> 31); |
|
2836 |
} |
|
2837 |
||
2838 |
/** |
|
2839 |
* Used by framework. |
|
2840 |
* |
|
2841 |
*@return op header. |
|
2842 |
*/ |
|
2843 |
inline TUint32 Header() const |
|
2844 |
{ |
|
2845 |
return iHeader[0]; |
|
2846 |
} |
|
2847 |
||
2848 |
private: |
|
2849 |
TUint32 iHeader[1]; |
|
2850 |
}; |
|
2851 |
||
2852 |
/** |
|
2853 |
* Interface for buffered data processors. |
|
2854 |
* |
|
2855 |
* Any MMIDComponent that returns a non-NULL MMIDBufferProcessor pointer |
|
2856 |
* from MMIDComponent::Processor() may receive buffered data from its |
|
2857 |
* Java peer. |
|
2858 |
* |
|
2859 |
* Note: The MMIDComponent is considered to own the MMIDBufferProcessor it |
|
2860 |
* returns and is therefore responsible for cleaning up any resources used |
|
2861 |
* by the processor. |
|
2862 |
*/ |
|
2863 |
class MMIDBufferProcessor |
|
2864 |
{ |
|
2865 |
public: |
|
2866 |
enum |
|
2867 |
{ |
|
2868 |
KMinOpCycles = 1, |
|
2869 |
KMaxOpCycles = 1024 |
|
2870 |
}; |
|
2871 |
||
2872 |
/** |
|
2873 |
* Mask of valid opcode bits. Top 4 bits of each opcode must be clear. |
|
2874 |
*/ |
|
2875 |
enum |
|
2876 |
{ |
|
2877 |
KOpMask = 0x0FFF |
|
2878 |
}; |
|
2879 |
||
2880 |
/** |
|
2881 |
* Process a block of commands, updating read pointer as you go. |
|
2882 |
* |
|
2883 |
* aBegin is the address of the first command in the buffer for this processor. |
|
2884 |
* |
|
2885 |
* aEnd is the address of the command *after* the last command in the buffer for this processor, |
|
2886 |
* hence (aEnd-aBegin) is the total number of words of opcodes and data. |
|
2887 |
* Classes that implement this interface must not call any of the TMIDBufferOp |
|
2888 |
* methods on aEnd - it is merely a sentinel indicating the end of the valid |
|
2889 |
* range, and intended to be used in loops of the form: |
|
2890 |
* <CODE> |
|
2891 |
* TMIDBufferOp& op = aBegin; |
|
2892 |
* while( op < aEnd ) |
|
2893 |
* { |
|
2894 |
* DecodeOp(op); |
|
2895 |
* op += op->Size(); |
|
2896 |
* } |
|
2897 |
* </CODE> |
|
2898 |
* aCycles is the amount of 'compute effort' remaining in the current AO |
|
2899 |
* RunL. The processor should decrement this value by an amount that refelects |
|
2900 |
* the amount of work it expects each operation it performs to have consumed. |
|
2901 |
* The estimate need not be accurate - only give an indication, to improve |
|
2902 |
* concurrency. Failure to decrement aCycles by a sensible amount can lead to |
|
2903 |
* the VM threads being starved of events such as key presses. |
|
2904 |
* |
|
2905 |
* For example simple graphics primitives like DrawLine are fast so would decrement |
|
2906 |
* by a small amount, whilst complex graphics primitives, such as drawing a |
|
2907 |
* rotated image with an alpha channel, would decrement by a large amount. |
|
2908 |
* |
|
2909 |
* If before commencing an operation, aCycles is less than that required to |
|
2910 |
* complete the operation, the processor should defer, by returning immediately |
|
2911 |
* leaving aBegin pointing at the deferred operation. |
|
2912 |
* |
|
2913 |
* returns ETrue if processing will be async. |
|
2914 |
* |
|
2915 |
* @param aMonitor Monitor that needs to be notified by MMIDBufferProcessor |
|
2916 |
* after async processing is finished. |
|
2917 |
* |
|
2918 |
*/ |
|
2919 |
#ifdef RD_JAVA_NGA_ENABLED |
|
2920 |
virtual TBool ProcessL( |
|
2921 |
const TMIDBufferOp*& aBegin, const TMIDBufferOp* aEnd, |
|
2922 |
TInt& aCycles, java::util::Monitor* aMonitor) = 0; |
|
2923 |
#else |
|
2924 |
virtual TBool ProcessL( |
|
2925 |
const TMIDBufferOp*& aBegin, const TMIDBufferOp* aEnd, |
|
2926 |
TInt& aCycles, TRequestStatus* aStatus = NULL) = 0; |
|
2927 |
#endif |
|
2928 |
||
2929 |
/** |
|
2930 |
* Called by framework if the processor is doing some async operation |
|
2931 |
* when the MIDlet is closed down. Processor should cancel the async |
|
2932 |
* operation and clean up any resources. |
|
2933 |
*/ |
|
2934 |
virtual void AbortAsync() = 0; |
|
2935 |
}; |
|
2936 |
||
2937 |
class MMIDLcduiEventConsumer |
|
2938 |
{ |
|
2939 |
public: |
|
2940 |
virtual void HandleLcduiEvent(int aType) = 0; |
|
2941 |
}; |
|
2942 |
||
2943 |
#endif // LCDUI_H |