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 66 | 2455ef1f5bbc |
permissions | -rw-r--r-- |
66 | 1 |
/******************************************************************************* |
2 |
* Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. This program and the accompanying materials |
|
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
|
5 |
* which accompanies this distribution, and is available at |
|
6 |
* http://www.eclipse.org/legal/epl-v10.html |
|
7 |
* |
|
8 |
* Contributors: |
|
9 |
* Nokia Corporation - S60 implementation |
|
10 |
*******************************************************************************/ |
|
11 |
||
12 |
||
13 |
#ifndef ESWTWIDGETSCORE_H |
|
14 |
#define ESWTWIDGETSCORE_H |
|
15 |
||
16 |
||
17 |
#include <eikmenup.h> |
|
18 |
#include <eikmenub.h> |
|
19 |
#include <eikmobs.h> |
|
20 |
#include <eikspane.h> |
|
21 |
#include "eswtgraphics.h" |
|
22 |
||
23 |
||
24 |
class CEikScrollBar; |
|
25 |
#ifdef RD_SCALABLE_UI_V2 |
|
26 |
class CAknStylusPopUpMenu; |
|
27 |
#endif //RD_SCALABLE_UI_V2 |
|
28 |
class MSwtButton; |
|
29 |
class MSwtCaptionedControl; |
|
30 |
class MSwtCommand; |
|
31 |
class MSwtComposite; |
|
32 |
class MSwtControl; |
|
33 |
class MSwtMenu; |
|
34 |
class MSwtMenuItem; |
|
35 |
class MSwtShell; |
|
36 |
class MSwtMobileShell; |
|
37 |
class MSwtDecorations; |
|
38 |
class MAknsControlContext; |
|
39 |
class MSwtBrowser; |
|
40 |
class MSwtListBase; |
|
41 |
class MSwtColor; |
|
42 |
class CSwtFontData; |
|
43 |
class CGraphicsContext; |
|
44 |
class MSwtInput; |
|
45 |
class MSwtScreen; |
|
46 |
class MSwtMultiPagePager; |
|
47 |
class MSwtMultiPageTabGroup; |
|
48 |
class MSwtMultiPageDialog; |
|
49 |
class MSwtDateEditor; |
|
50 |
class MSwtConstrainedText; |
|
51 |
class MSwtLink; |
|
52 |
class MSwtListBox; |
|
53 |
class MSwtListView; |
|
54 |
class MSwtSortedList; |
|
55 |
class MSwtTextExtension; |
|
56 |
class MSwtClipboard; |
|
57 |
class MSwtTableColumn; |
|
58 |
class MSwtTableItem; |
|
59 |
class MSwtTable; |
|
60 |
class MSwtTree; |
|
61 |
class MSwtFontDialog; |
|
62 |
class MSwtDirectoryDialog; |
|
63 |
class MSwtHyperLink; |
|
64 |
class MSwtScrollable; |
|
65 |
||
66 |
static const TInt KSwtCommandBaseId = 0x1000; |
|
67 |
||
68 |
||
69 |
/** |
|
70 |
* Interface class for the org.eclipse.swt.widgets.ScrollBar class |
|
71 |
*/ |
|
72 |
class MSwtScrollBar |
|
73 |
{ |
|
74 |
protected: |
|
75 |
virtual ~MSwtScrollBar() {} // Made protected to prevent destruction through the interface |
|
76 |
||
77 |
public: |
|
78 |
/** |
|
79 |
* Disposes of (i.e. destroys) the scroll-bar |
|
80 |
* @return The Java peer associated with this object |
|
81 |
*/ |
|
82 |
virtual TSwtPeer Dispose() =0; |
|
83 |
||
84 |
/** |
|
85 |
* Returns the scroll-bar'size |
|
86 |
*/ |
|
87 |
virtual TSize GetSize() const =0; |
|
88 |
||
89 |
/** |
|
90 |
* Enables or disables the scrollbar |
|
91 |
*/ |
|
92 |
virtual void SetEnabled(TBool aEnabled) =0; |
|
93 |
||
94 |
/** |
|
95 |
* Enables or disables the scrollbar visibility |
|
96 |
*/ |
|
97 |
virtual void SetVisible(TBool aVisible) =0; |
|
98 |
||
99 |
/** |
|
100 |
* Returns the thumb's position |
|
101 |
*/ |
|
102 |
virtual TInt GetThumbPosition() const =0; |
|
103 |
||
104 |
/** |
|
105 |
* Sets the thumb's position |
|
106 |
* @param aPosition The thumb's new position, if the provided value is out |
|
107 |
* of range, it must be adjusted to fit. |
|
108 |
*/ |
|
109 |
virtual void SetThumbPositionL(TInt aPosition) =0; |
|
110 |
||
111 |
/** |
|
112 |
* Returns the thumb's span |
|
113 |
*/ |
|
114 |
virtual TInt GetThumbSpan() const =0; |
|
115 |
||
116 |
/** |
|
117 |
* Sets the thumb's span |
|
118 |
* @param aThumbSpan The thumb's new span, will be >= 1. If the provided value |
|
119 |
* is larger than (maximum-minimum) it must be ignored. |
|
120 |
*/ |
|
121 |
virtual void SetThumbSpanL(TInt aThumbSpan) =0; |
|
122 |
||
123 |
/** |
|
124 |
* Returns the minimum value |
|
125 |
*/ |
|
126 |
virtual TInt GetMinimum() const =0; |
|
127 |
||
128 |
/** |
|
129 |
* Sets the minimum value of the scroll span |
|
130 |
* @param aMinimum The new minimum, will be >= 0. If the provided value is |
|
131 |
* greater than or equal to the maximum, it must be ignored. |
|
132 |
*/ |
|
133 |
virtual void SetMinimumL(TInt aMinimum) =0; |
|
134 |
||
135 |
/** |
|
136 |
* Returns the maximum value |
|
137 |
*/ |
|
138 |
virtual TInt GetMaximum() const =0; |
|
139 |
||
140 |
/** |
|
141 |
* Sets the maximum value of the scroll span |
|
142 |
* @param aMaximum The new maximum, wil be >= 0. If the provided value is |
|
143 |
* less than or equal to the minimum, it must be ignored. |
|
144 |
*/ |
|
145 |
virtual void SetMaximumL(TInt aMaximum) =0; |
|
146 |
||
147 |
/** |
|
148 |
* Returns the increment |
|
149 |
*/ |
|
150 |
virtual TInt GetIncrement() const =0; |
|
151 |
||
152 |
/** |
|
153 |
* Sets the increment |
|
154 |
* @param aIncrement The new increment, will be >= 1. |
|
155 |
*/ |
|
156 |
virtual void SetIncrement(TInt aIncrement) =0; |
|
157 |
||
158 |
/** |
|
159 |
* Returns the page increment. |
|
160 |
*/ |
|
161 |
virtual TInt GetPageIncrement() const =0; |
|
162 |
||
163 |
/** |
|
164 |
* Sets the page increment |
|
165 |
* @param aPageIncrement The new page increment, will be >= 1. |
|
166 |
*/ |
|
167 |
virtual void SetPageIncrement(TInt aPageIncrement) =0; |
|
168 |
||
169 |
/** |
|
170 |
* Sets all parameters in once |
|
171 |
*/ |
|
172 |
virtual void SetValuesL(TInt aPosition, TInt aMinimum, TInt aMaximum, |
|
173 |
TInt aThumbSpan, TInt aIncrement, TInt aPageIncrement) =0; |
|
174 |
}; |
|
175 |
||
176 |
||
177 |
/** |
|
178 |
* Type for an array of controls |
|
179 |
*/ |
|
180 |
typedef RPointerArray<MSwtControl> RSwtControlArray; |
|
181 |
||
182 |
||
183 |
/** |
|
184 |
* Interface class for the org.eclipse.swt.widgets.Control class |
|
185 |
*/ |
|
186 |
class MSwtControl : public MSwtWindowDrawable |
|
187 |
{ |
|
188 |
protected: |
|
189 |
virtual ~MSwtControl() {} // Made protected to prevent destruction through the interface |
|
190 |
||
191 |
public: |
|
192 |
/** |
|
193 |
* Mask values for the utility flags |
|
194 |
* Flags are such that the default value is 0 |
|
195 |
*/ |
|
196 |
enum TFlagMask |
|
197 |
{ |
|
198 |
EFlagDoNotDraw = 0x01, // The control must not be drawn |
|
199 |
EFlagInvisible = 0x02, // The control is invisible |
|
200 |
EFlagDisabled = 0x04, // The control is disabled (grayed, dimmed) |
|
201 |
EFreeFlagStart = 0x08 // The first flag available for custom use |
|
202 |
}; |
|
203 |
||
204 |
enum TFocusBackgroundPolicy |
|
205 |
{ |
|
206 |
// Composite use case, no visual indication of focus |
|
207 |
ENoFocusBackground = 0, |
|
208 |
||
209 |
// Normal use case, draw focus background if the Control has focus |
|
210 |
// and there is at least another focusable Control in same Shell. |
|
211 |
EDefaultFocusBackground, |
|
212 |
||
213 |
// Button use case, the Control's focus background is owned by Avkon |
|
214 |
EEmbeddedFocusBackground, |
|
215 |
||
216 |
// Captioned Controls use case, default focus background policy |
|
217 |
// applies to itself and children |
|
218 |
ECaptionedCtrlFocusBackground, |
|
219 |
||
220 |
// This policy is similar to EEmbeddedFocusBackground. |
|
221 |
// Its use case is for lists, listviews, tables, trees and listboxes. |
|
222 |
// They don't have focus background at all even when placed |
|
223 |
// to captioned control (only captioned control has highlight) |
|
224 |
ENoFocusBackgroundInCaptionedControl |
|
225 |
}; |
|
226 |
||
227 |
enum TPressBackgroundPolicy |
|
228 |
{ |
|
229 |
// No need for pressed highlight. |
|
230 |
ENoPressBackground = 0, |
|
231 |
||
232 |
// Highlight is applied whenever the control is pressed. |
|
233 |
EPressBackground = 1, |
|
234 |
||
235 |
// The control has it's own pressed highlight. |
|
236 |
EEmbeddedPressBackground = 2 |
|
237 |
}; |
|
238 |
||
239 |
public: |
|
240 |
/** |
|
241 |
* Disposes of (i.e. destroys) the control |
|
242 |
* @return The Java peer associated with this object |
|
243 |
*/ |
|
244 |
virtual TSwtPeer Dispose() =0; |
|
245 |
||
246 |
/** |
|
247 |
* Returns the Java peer associated with this object |
|
248 |
*/ |
|
249 |
virtual TSwtPeer JavaPeer() const =0; |
|
250 |
||
251 |
/** |
|
252 |
* Returns a pointer to the underlying Cone control used for the |
|
253 |
* actual implementation. |
|
254 |
*/ |
|
255 |
virtual CCoeControl& CoeControl() =0; |
|
256 |
||
257 |
/** |
|
258 |
* Returns a const pointer to the underlying Cone control used for the |
|
259 |
* actual implementation. |
|
260 |
*/ |
|
261 |
virtual const CCoeControl& CoeControl() const =0; |
|
262 |
||
263 |
/** |
|
264 |
* Returns the control's utility flags |
|
265 |
* <b>Note</b>: this method is a convenience aimed to be used for the |
|
266 |
* implementation of MSwtComposite. If the implementation on a |
|
267 |
* given platform does use utility flags, this method can return any value. |
|
268 |
*/ |
|
269 |
virtual TUint Flags() const =0; |
|
270 |
||
271 |
/** |
|
272 |
* Indicate if the control has the flag EFlagDoNotDraw. |
|
273 |
* @return True if the Control has the EFlagDoNotDraw flag, else EFalse. |
|
274 |
*/ |
|
275 |
virtual TBool HasDoNotDrawFlag() const =0; |
|
276 |
||
277 |
/** |
|
278 |
* Instructs the control to paint itself |
|
279 |
* |
|
280 |
* @param aRect The rectangle to draw, in screen coordinates. |
|
281 |
* @param aPaintNatively Whether the native CCoeControl::Draw should be called before flushing |
|
282 |
* the buffered operations |
|
283 |
* @param aGc The GC that was passed into the paint listener |
|
284 |
* @param aIntParam An array of buffered opcodes and integer parameters from gc operations |
|
285 |
* done in the paint listener |
|
286 |
* @param aIntCount The Number of items in aIntParams array |
|
287 |
* @param aStrParam Buffered string parameters from gc operations done in the paint listener |
|
288 |
*/ |
|
289 |
virtual void Paint(const TRect& aRect, |
|
290 |
TBool aPaintNatively = ETrue, |
|
291 |
MSwtGc* aGc = NULL, |
|
292 |
TInt* aIntParams = NULL, |
|
293 |
TInt aIntCount = 0, |
|
294 |
HBufC* aStrParams = NULL) const =0; |
|
295 |
||
296 |
/** |
|
297 |
* Emergency native paint. Ignores Java GCs. |
|
298 |
* Window redraw must be started before calling this and stopped after. |
|
299 |
* |
|
300 |
* @param aRect The rectangle to draw, in window coordinates. |
|
301 |
*/ |
|
302 |
virtual void PaintUrgently(const TRect& aRect, TBool aInitDraw = ETrue) const =0; |
|
303 |
||
304 |
/** |
|
305 |
* Ignoring the Java paint requests and draws directly for the time being. |
|
306 |
*/ |
|
307 |
virtual TBool IsPaintingUrgently() const = 0; |
|
308 |
||
309 |
/** |
|
310 |
* Processes a key event |
|
311 |
*/ |
|
312 |
virtual void ProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) =0; |
|
313 |
||
314 |
/** |
|
315 |
* Handles the pointer events. |
|
316 |
* @param aPointerEvent pointer event to process |
|
317 |
*/ |
|
318 |
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent)=0; |
|
319 |
||
320 |
/** |
|
321 |
* Determines if a control is suitable for receiving focus. |
|
322 |
* Invisible or disabled controls can never be focused, not even with |
|
323 |
* KSwtFocusByForce. Shells cannot be focused just activated. |
|
324 |
*/ |
|
325 |
virtual TBool IsFocusable(TInt aReason = KSwtFocusByApi) const =0; |
|
326 |
||
327 |
/** |
|
328 |
* Attempts to make this control the one that receives focus. |
|
329 |
* If this control or a descendant takes focus, true is returned. Composites |
|
330 |
* attempt to assign focus to their children before taking focus themselves. |
|
331 |
* Some controls, such as labels, do not normally take focus. A control will |
|
332 |
* not take focus if it is disabled or hidden or when input is blocked due to |
|
333 |
* modality. |
|
334 |
* In case of KSwtFocusByForce, forces the control to receive keyboard events. |
|
335 |
* Controls that do not normally accept keyboard input will take focus |
|
336 |
* using this KSwtFocusByForce. |
|
337 |
* @return Whether this control has focus upon method exit. |
|
338 |
*/ |
|
339 |
virtual TBool SetSwtFocus(TInt aReason = KSwtFocusByApi) =0; |
|
340 |
||
341 |
/** |
|
342 |
* Returns the policy of the focus background. |
|
343 |
* See TFocusBackgroundPolicy. |
|
344 |
*/ |
|
345 |
virtual TInt FocusBackgroundPolicy() const =0; |
|
346 |
||
347 |
/** |
|
348 |
* Returns the policy of the pressed background. |
|
349 |
* See TPressBackgroundPolicy. |
|
350 |
*/ |
|
351 |
virtual TInt PressBackgroundPolicy() const =0; |
|
352 |
||
353 |
/** |
|
354 |
* Returns true if the control is selectable by the user and is not dimmed |
|
355 |
*/ |
|
356 |
virtual TBool GetEnabled() const =0; |
|
357 |
||
358 |
/** |
|
359 |
* If this function returns true it does not mean that the control should |
|
360 |
* be visible for the user. The parent migh be invisible in which case this |
|
361 |
* control should not be visible to the user or draw itself. So this function |
|
362 |
* returns only the internal visibility state of this controll without paying |
|
363 |
* attention to the combined visibility of its ancestors. |
|
364 |
* Use GetVisibleRecursively() to determine if the control is really visible. |
|
365 |
*/ |
|
366 |
virtual TBool GetVisible() const =0; |
|
367 |
||
368 |
/** |
|
369 |
* Except Shells, controls are shown if themeselves and their parent are visible. |
|
370 |
*/ |
|
371 |
virtual TBool GetVisibleRecursively() const =0; |
|
372 |
||
373 |
/** |
|
374 |
* Indicate if the default system colour was use for the background. |
|
375 |
* @return Returns Etrue if the default system colour was use for the background, |
|
376 |
* otherwise EFalse if a color background setted. |
|
377 |
*/ |
|
378 |
virtual TBool IsDefaultBackgroundUse() const = 0; |
|
379 |
||
380 |
/** |
|
381 |
* Returns the control context of the Control. |
|
382 |
* @return Returns the control context of the Control define by the control |
|
383 |
* or NULL or there is no specific control context.. |
|
384 |
*/ |
|
385 |
virtual MAknsControlContext* GetControlContext() const =0; |
|
386 |
||
387 |
/** |
|
388 |
* Returns the control background color |
|
389 |
* @return The control background color |
|
390 |
*/ |
|
391 |
virtual TRgb GetBackground() const = 0; |
|
392 |
||
393 |
/** |
|
394 |
* Returns the control foreground color |
|
395 |
* @return The control foreground color |
|
396 |
*/ |
|
397 |
virtual TRgb GetForeground() const = 0; |
|
398 |
||
399 |
/** |
|
400 |
* Sets the color of the control's background. |
|
401 |
* @param aColor The colour to set the background to, if NULL |
|
402 |
* the default colour will be used. |
|
403 |
*/ |
|
404 |
virtual void SetBackgroundL(const MSwtColor* aColor) =0; |
|
405 |
||
406 |
/** |
|
407 |
* Sets the color of the control's text. |
|
408 |
* @param aColor The colour to set the foreground to, if NULL |
|
409 |
* the default colour will be used. |
|
410 |
*/ |
|
411 |
virtual void SetForegroundL(const MSwtColor* aColor) =0; |
|
412 |
||
413 |
/** |
|
414 |
* Returns the control font used for writing text |
|
415 |
* @return The control's font, cannot be NULL |
|
416 |
*/ |
|
417 |
virtual const MSwtFont* GetFont() const =0; |
|
418 |
||
419 |
/** |
|
420 |
* Gets the control's border width |
|
421 |
* @return The control's border width |
|
422 |
*/ |
|
423 |
virtual TInt GetBorderWidth() const =0; |
|
424 |
||
425 |
/** |
|
426 |
* Returns the client rectangle (i.e. the part without scroll-bars, borders |
|
427 |
* and other decorations) of this Control |
|
428 |
* The client area returned is in window coordinates. |
|
429 |
*/ |
|
430 |
virtual TRect ClientRect() const =0; |
|
431 |
||
432 |
/** |
|
433 |
* Gets the control's bounding rectangle |
|
434 |
* @return The control's coordinates relative to its parent, or in screen |
|
435 |
* coordinates if it has no parent. Shells always return screen |
|
436 |
* coordinates. |
|
437 |
*/ |
|
438 |
virtual TRect GetBounds() const =0; |
|
439 |
||
440 |
/** |
|
441 |
* Gets the control's position. |
|
442 |
* @return The control's position relative to its parent, or in screen |
|
443 |
* coordinates if it has no parent. Shells always return screen |
|
444 |
* coordinates. |
|
445 |
*/ |
|
446 |
virtual TPoint GetLocation() const =0; |
|
447 |
||
448 |
/** |
|
449 |
* Returns the control's popup menu |
|
450 |
*/ |
|
451 |
virtual const MSwtMenu* GetPopupMenu() const =0; |
|
452 |
||
453 |
/** |
|
454 |
* Returns the control's native menu |
|
455 |
*/ |
|
456 |
virtual const MSwtMenu* GetControlMenu() const =0; |
|
457 |
||
458 |
/** |
|
459 |
* Returns the control parent |
|
460 |
*/ |
|
461 |
virtual MSwtComposite* GetParent() const =0; |
|
462 |
||
463 |
/** |
|
464 |
* Check if aParent is in the parent hierarchy. |
|
465 |
*/ |
|
466 |
virtual TBool IsDescentOf(const MSwtControl& aParent) const =0; |
|
467 |
||
468 |
/** |
|
469 |
* Get the closest parent Shell of the Control |
|
470 |
*/ |
|
471 |
virtual MSwtShell& GetShell() const =0; |
|
472 |
||
473 |
/** |
|
474 |
* Get the top Shell of the Control |
|
475 |
*/ |
|
476 |
virtual MSwtShell& GetTopShell() const =0; |
|
477 |
||
478 |
/** |
|
479 |
* Get the top CaptionedControl of the Control, if any |
|
480 |
*/ |
|
481 |
virtual MSwtCaptionedControl* GetNearestCaptionedControl(TBool aIncludeSelf = ETrue) const =0; |
|
482 |
||
483 |
/** |
|
484 |
* Gets the control's width and height; |
|
485 |
*/ |
|
486 |
virtual TSize GetWidgetSize() const =0; |
|
487 |
||
488 |
/** |
|
489 |
* Returns true if we have UI focus, false otherwise |
|
490 |
*/ |
|
491 |
virtual TBool IsFocusControl() =0; |
|
492 |
||
493 |
/** |
|
494 |
* Moves this control above aControl in the drawing order |
|
495 |
*/ |
|
496 |
virtual void MoveAbove(const MSwtControl* aControl) =0; |
|
497 |
||
498 |
/** |
|
499 |
* Moves this control below aControl in the drawing order |
|
500 |
*/ |
|
501 |
virtual void MoveBelow(const MSwtControl* aControl) =0; |
|
502 |
||
503 |
/** |
|
504 |
* Redraws the entire control |
|
505 |
*/ |
|
506 |
virtual void Redraw() =0; |
|
507 |
||
508 |
/** |
|
509 |
* Updates DoNotDraw flag after a call to setRedraw |
|
510 |
*/ |
|
511 |
virtual void UpdateDoNotDrawFlag() =0; |
|
512 |
||
513 |
/** |
|
514 |
* Redraws the specified area of the control |
|
515 |
* @param aRect The rectangle to redraw, in client area coordinates. |
|
516 |
*/ |
|
517 |
virtual void RedrawRegion(const TRect& aRect) =0; |
|
518 |
||
519 |
/** |
|
520 |
* Enables or disables future redraw requests |
|
521 |
*/ |
|
522 |
virtual void SetRedraw(TBool aRedraw) =0; |
|
523 |
||
524 |
/** |
|
525 |
* Sets the font of the control. |
|
526 |
* @param aFont The font to use, if NULL a default font is to be used. |
|
527 |
*/ |
|
528 |
virtual void SetFontL(const MSwtFont* aFont) =0; |
|
529 |
||
530 |
/** |
|
531 |
* Sets the visibility status of the control |
|
532 |
*/ |
|
533 |
virtual void SetVisible(TBool aVisible) =0; |
|
534 |
||
535 |
/** |
|
536 |
* Sets the Control's location |
|
537 |
* @param aPoint The new location; in the parent's coordinates, in screen |
|
538 |
* coordinates for Shells. |
|
539 |
*/ |
|
540 |
virtual void SetLocation(const TPoint& aPoint) =0; |
|
541 |
||
542 |
/** |
|
543 |
* Sets the Control's size |
|
544 |
* |
|
545 |
* @param aSize The new size. |
|
546 |
*/ |
|
547 |
virtual void SetWidgetSize(const TSize& aSize) =0; |
|
548 |
||
549 |
/** |
|
550 |
* Compute the preferred size. |
|
551 |
*/ |
|
552 |
virtual TSize ComputeSizeL(TInt aWHint, TInt aHHint) = 0; |
|
553 |
||
554 |
/** |
|
555 |
* Sets the control as selectable by the user |
|
556 |
*/ |
|
557 |
virtual void SetEnabled(TBool aEnabled) =0; |
|
558 |
||
559 |
/** |
|
560 |
* Sets the Control's location and size |
|
561 |
* @param aRect The new rectangle; in the parent's coordinates, in screen |
|
562 |
* coordinates for Shells. |
|
563 |
*/ |
|
564 |
virtual void SetBounds(const TRect& aRect) =0; |
|
565 |
||
566 |
/** |
|
567 |
* Sets the Control's popup menu |
|
568 |
* @param aMenu The popup menu. |
|
569 |
*/ |
|
570 |
virtual void SetPopupMenuL(const MSwtMenu* aMenu) =0; |
|
571 |
||
572 |
/** |
|
573 |
* Enable or disable pointer capture for this control |
|
574 |
*/ |
|
575 |
virtual void SetCapture(TBool aCapture) =0; |
|
576 |
||
577 |
/** |
|
578 |
* Returns the style of the control. |
|
579 |
*/ |
|
580 |
virtual TInt Style() const =0; |
|
581 |
||
582 |
/** |
|
583 |
* Updates the control by forcing an immediate draw |
|
584 |
* on itself and flushes all paint events on this Control. |
|
585 |
*/ |
|
586 |
virtual void Update() const =0; |
|
587 |
||
588 |
/** |
|
589 |
* Returns a pointer to the MSwtButton interface of this |
|
590 |
* Control if it is a Button. |
|
591 |
* Only actual Button will return a non-null pointer |
|
592 |
* @return The Control's MSwtButton interface, or NULL |
|
593 |
*/ |
|
594 |
virtual MSwtButton* ButtonInterface() |
|
595 |
{ |
|
596 |
return NULL; |
|
597 |
} |
|
598 |
||
599 |
/** |
|
600 |
* Returns a pointer to the MSwtCaptionedControl interface of this |
|
601 |
* Control if it is a CaptionedControl. |
|
602 |
* Only actual CaptionedControl will return a non-null pointer |
|
603 |
* @return The Control's MSwtCaptionedControl interface, or NULL |
|
604 |
*/ |
|
605 |
virtual MSwtCaptionedControl* CaptionedControlInterface() const |
|
606 |
{ |
|
607 |
return NULL; |
|
608 |
} |
|
609 |
||
610 |
/** |
|
611 |
* Returns a pointer to the MSwtShell interface of this Control. |
|
612 |
* Only actual Shells will return a non-null pointer |
|
613 |
* @return The Control's MSwtShell interface, or NULL |
|
614 |
*/ |
|
615 |
virtual MSwtShell* ShellInterface() |
|
616 |
{ |
|
617 |
return NULL; |
|
618 |
} |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
619 |
|
66 | 620 |
virtual const MSwtShell* ShellInterface() const |
621 |
{ |
|
622 |
return NULL; |
|
623 |
} |
|
624 |
||
625 |
/** |
|
626 |
* Tests if this control is a shell |
|
627 |
*/ |
|
628 |
inline TBool IsShell() const |
|
629 |
{ |
|
630 |
return (const_cast<MSwtControl*>(this)->ShellInterface()!=NULL); |
|
631 |
} |
|
632 |
||
633 |
/** |
|
634 |
* Returns a pointer to the MSwtDecorations interface of this Control. |
|
635 |
* Only actual Decorations (or Shells) will return a non-null pointer |
|
636 |
* @return The Control's MSwtDecorations interface, or NULL |
|
637 |
*/ |
|
638 |
virtual MSwtDecorations* DecorationsInterface() |
|
639 |
{ |
|
640 |
return NULL; |
|
641 |
} |
|
642 |
||
643 |
/** |
|
644 |
* Tests if this control is a decorations |
|
645 |
*/ |
|
646 |
inline TBool IsDecorations() const |
|
647 |
{ |
|
648 |
return (const_cast<MSwtControl*>(this)->DecorationsInterface()!=NULL); |
|
649 |
} |
|
650 |
||
651 |
/** |
|
652 |
* Returns a pointer to the MSwtComposite interface of this Control. |
|
653 |
* Only controls actually implementing MSwtComposite will return a non-null pointer |
|
654 |
* @return The Control's MSwtComposite interface, or NULL |
|
655 |
*/ |
|
656 |
virtual MSwtComposite* CompositeInterface() const |
|
657 |
{ |
|
658 |
return NULL; |
|
659 |
} |
|
660 |
||
661 |
/** |
|
662 |
* Returns a pointer to the MSwtBrowser interface of this Control. |
|
663 |
* Only actual Browser will return a non-null pointer |
|
664 |
* @return The Control's MSwtBrowser interface, or NULL |
|
665 |
*/ |
|
666 |
virtual MSwtBrowser* BrowserInterface() |
|
667 |
{ |
|
668 |
return NULL; |
|
669 |
} |
|
670 |
||
671 |
/** |
|
672 |
* Recursively adds to the provided list all the controls that can |
|
673 |
* be traversed using the "Tab" key. |
|
674 |
* Controls must be appended to the list in the same order as specified in |
|
675 |
* the control's own tab list. All controls are to be put in the list, even |
|
676 |
* non-focusable ones. |
|
677 |
* @param aList The list to add the controls to |
|
678 |
*/ |
|
679 |
virtual void ComputeTabListL(RSwtControlArray& aList) =0; |
|
680 |
||
681 |
/** |
|
682 |
* Converts screen coordinates to control coordinates (client area coordinates). |
|
683 |
* @return Control relative point |
|
684 |
*/ |
|
685 |
virtual TPoint ToControl(const TPoint& aPoint) const =0; |
|
686 |
||
687 |
/** |
|
688 |
* Converts control coordinates (client area coordinates) to screen coordinates. |
|
689 |
* @return Screen relative point |
|
690 |
*/ |
|
691 |
virtual TPoint ToDisplay(const TPoint& aPoint) const =0; |
|
692 |
||
693 |
/** |
|
694 |
* Indicates if control uses CBA button or if CBA button is available to user commands. |
|
695 |
* @param aCbaButtonIndex Index of the CBA button |
|
696 |
* @return ETrue if control uses CBA button, EFalse otherwise |
|
697 |
*/ |
|
698 |
virtual TBool CbaButtonIsUsed(TInt aCbaButtonIndex) const =0; |
|
699 |
||
700 |
/** |
|
701 |
* Indicates if control uses the key passed in argument. |
|
702 |
* @param aKeyCode Key code |
|
703 |
* @return ETrue if control uses the key, EFalse otherwise |
|
704 |
*/ |
|
705 |
virtual TBool IsKeyUsed(TUint aKeyCode) const =0; |
|
706 |
||
707 |
/** |
|
708 |
* Returns the MSK label to be displayed. This is used in correlation |
|
709 |
* with the IsKeyUsed to determine the label for the MSK. |
|
710 |
* @return descriptor to be displayed. |
|
711 |
*/ |
|
712 |
virtual HBufC* MSKLabelL() const=0; |
|
713 |
||
714 |
/** |
|
715 |
* Indicates if external selection command can replace |
|
716 |
* internal selection operation when pressing MSK. |
|
717 |
* @return ETrue if external selection command is allowed, EFalse otherwise |
|
718 |
*/ |
|
719 |
virtual TBool MSKSelCmdEnabled() const = 0; |
|
720 |
||
721 |
/** |
|
722 |
* Posts an asynchronous traverse event without taking into account any key event. |
|
723 |
* @param aDetail The traversal detail |
|
724 |
* @param aDoIt Initial value for the doit field |
|
725 |
* @return ETrue if the post is succesfull. |
|
726 |
*/ |
|
727 |
virtual TBool ForceTraverseEvent(TSwtTraversal aDetail, TBool aDoIt) =0; |
|
728 |
||
729 |
/** |
|
730 |
* Add this control to the Control Stack of the Eikon AppUi |
|
731 |
* @param aPriority The control’s stack priority. |
|
732 |
*/ |
|
733 |
virtual void AddToControlStackL(TInt aPriority) =0; |
|
734 |
||
735 |
/** |
|
736 |
* Remove this control from the Control Stack of the Eikon AppUi |
|
737 |
* @param aPriority The control’s stack priority. |
|
738 |
*/ |
|
739 |
virtual void RemoveFromControlStack() =0; |
|
740 |
||
741 |
/** |
|
742 |
* Says if this control is on Control Stack of the Eikon AppUi |
|
743 |
* @return ETrue if control is on Control Stack of the Eikon AppUi. |
|
744 |
*/ |
|
745 |
virtual TBool IsOnControlStack() const =0; |
|
746 |
||
747 |
/** |
|
748 |
* Says if the control is allowed to draw outside its own extent. |
|
749 |
* @return ETrue if control is allowed to draw outside its own extent. |
|
750 |
*/ |
|
751 |
virtual TBool CanDrawOutsideRect() const |
|
752 |
{ |
|
753 |
return EFalse; |
|
754 |
} |
|
755 |
||
756 |
#ifdef RD_SCALABLE_UI_V2 |
|
757 |
/** |
|
758 |
* Returns the control's native menu for stylus popup menu. It may contain |
|
759 |
* different commands than the control menu opened with MSK. |
|
760 |
*/ |
|
761 |
virtual const MSwtMenu* GetStylusPopupControlMenu() const |
|
762 |
{ |
|
763 |
return NULL; |
|
764 |
} |
|
765 |
#endif //RD_SCALABLE_UI_V2 |
|
766 |
||
767 |
/** |
|
768 |
* Destructor wrapper. Use cautiously. |
|
769 |
*/ |
|
770 |
virtual void Destroy() |
|
771 |
{ |
|
772 |
delete this; |
|
773 |
}; |
|
774 |
||
775 |
/** |
|
776 |
* Hide / send to background the CoeControl directly without notifications. |
|
777 |
* For instance a Shell can be hidden without changing its focusability. |
|
778 |
* Does not redraw. |
|
779 |
*/ |
|
780 |
virtual void HideSilently() = 0; |
|
781 |
virtual void ShowSilently() = 0; |
|
782 |
virtual TBool HiddenSilently() const = 0; |
|
783 |
||
784 |
/** |
|
785 |
* Allows the Control to decide which pointer events are good for long tap animation. |
|
786 |
*/ |
|
787 |
virtual TBool IsLongTapAnimationCandidate(const TPointerEvent& aPointerEvent) const =0; |
|
788 |
||
789 |
virtual void DoControlSpecificFeedback(const TBool& aFirstTap, |
|
790 |
const TBool& aTappedToChildRect, |
|
791 |
const TPointerEvent& aPointerEvent) const = 0; |
|
792 |
||
793 |
virtual void PostMouseEventL(const TPointerEvent& aPointerEvent) = 0; |
|
794 |
||
795 |
/** |
|
796 |
* Enables or disables focus highlight for controls |
|
797 |
* Used only for list controls (Lists, ListView, ListBox and Table) |
|
798 |
* Only for 9.2 |
|
799 |
*/ |
|
800 |
virtual void EnableFocusHighlight(TBool aEnable) = 0; |
|
801 |
||
802 |
/** |
|
803 |
* Get the visible rectangle of this control. |
|
804 |
* Window coordinates. |
|
805 |
* The clipping take in account the parent, but not the brother. |
|
806 |
* To take in account the sibblings use VisibleRegion() method. |
|
807 |
* @param aVisibleBounds If true return the visible rectangle of the control, |
|
808 |
* else return visible client rectangle of the control. |
|
809 |
*/ |
|
810 |
virtual TRect VisibleRect(TBool aVisibleBounds = EFalse) const = 0; |
|
811 |
||
812 |
/** |
|
83
26b2b12093af
Revision: v2.2.17
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
813 |
* Get the scrollable interface of control. |
66 | 814 |
* If control is not scrollable method returns null |
815 |
*/ |
|
816 |
virtual MSwtScrollable* ScrollableInterface() const |
|
817 |
{ |
|
818 |
return NULL; |
|
819 |
} |
|
820 |
||
821 |
/** |
|
822 |
* True if the control owns a focus / pressed highlighted background. |
|
823 |
* @param aIncludingParents - if true, the parent tree is checked also. |
|
824 |
*/ |
|
825 |
virtual TBool HasHighlight(TBool aIncludingParents = ETrue) const = 0; |
|
826 |
||
827 |
/** |
|
828 |
* Instructs the control to create and display a highlighted background. |
|
829 |
* This is *not* supposed to repaint! |
|
830 |
*/ |
|
831 |
virtual void SetHighlight(TBool aEnabled) = 0; |
|
832 |
||
833 |
/** |
|
834 |
* React to highlight changes in itself or in the parent tree. |
|
835 |
* This is *not* supposed to repaint! |
|
836 |
*/ |
|
837 |
virtual void HandleHighlightChange() = 0; |
|
838 |
||
839 |
/** |
|
840 |
* True if pressed by pointer. |
|
841 |
*/ |
|
842 |
virtual TInt Pressed() const = 0; |
|
843 |
}; |
|
844 |
||
845 |
||
846 |
/** |
|
847 |
* Interface class for the org.eclipse.swt.widgets.Scrollable class |
|
848 |
* A class that implements MSwtScrollable must also implement MSwtControl. |
|
849 |
*/ |
|
850 |
class MSwtScrollable |
|
851 |
{ |
|
852 |
protected: |
|
853 |
virtual ~MSwtScrollable() {} // Made protected to prevent destruction through the interface |
|
854 |
||
855 |
public: |
|
856 |
/** |
|
857 |
* Returns the MSwtControl interface. |
|
858 |
*/ |
|
859 |
virtual MSwtControl* Control() =0; |
|
860 |
||
861 |
/** |
|
862 |
* Computes the size needed to obtain the specified client area |
|
863 |
* @param aRect Must contain the client area to be obtained, this will be |
|
864 |
* modified to be the needed area. |
|
865 |
*/ |
|
866 |
virtual void ComputeTrim(TRect& aRect) const =0; |
|
867 |
||
868 |
/** |
|
869 |
* Creates a ScrollBar object that represents this Scrollable's scroll-bar. |
|
870 |
* @param aPeer The Java peer of the scroll-bar to be created |
|
871 |
* @param aStyle Can be KSwtHScroll or KSwtVScroll. |
|
872 |
*/ |
|
873 |
virtual MSwtScrollBar* CreateScrollBarL(TSwtPeer aPeer, TInt aStyle) =0; |
|
874 |
||
875 |
/** |
|
876 |
* Hides the specified scroll-bar |
|
877 |
* @param aStyle The scroll-bar whose visibility to alter, must be one of |
|
878 |
* KSwtStyleHScroll and KSwtStyleVScroll. |
|
879 |
* @param aVisible Whether to make the specified scroll-bar visible or invisible |
|
880 |
*/ |
|
881 |
virtual void SetVisibleScrollBar(TInt aStyle, TBool aVisible) =0; |
|
882 |
||
883 |
/** |
|
884 |
* Notifies this Scrollable that one of its scroll-bars has been destroyed. |
|
885 |
*/ |
|
886 |
virtual void ScrollBarDestroyed(const MSwtScrollBar* aScrollBar) =0; |
|
887 |
||
888 |
/** |
|
889 |
* Tells if control has scrollbars |
|
890 |
*/ |
|
891 |
virtual TBool HasScrollBars() const |
|
892 |
{ |
|
893 |
return EFalse; |
|
894 |
}; |
|
895 |
}; |
|
896 |
||
897 |
||
898 |
/** |
|
899 |
* Interface class for the org.eclipse.swt.widgets.Composite class |
|
900 |
* A class that implements MSwtComposite must also implement MSwtScrollable. |
|
901 |
*/ |
|
902 |
class MSwtComposite |
|
903 |
{ |
|
904 |
protected: |
|
905 |
virtual ~MSwtComposite() {} // Made protected to prevent destruction through the interface |
|
906 |
||
907 |
public: |
|
908 |
/** |
|
909 |
* Returns the MSwtScrollable interface |
|
910 |
*/ |
|
911 |
virtual MSwtScrollable* Scrollable() =0; |
|
912 |
||
913 |
/** |
|
914 |
* Returns the MSwtControl interface |
|
915 |
*/ |
|
916 |
inline MSwtControl* Control() |
|
917 |
{ |
|
918 |
return Scrollable()->Control(); |
|
919 |
} |
|
920 |
||
921 |
/** |
|
922 |
* Registers a new child with this Composite |
|
923 |
* A Control may register itself only once it has been |
|
924 |
* <b>fully</b> constructed. Additionally, a Control shall |
|
925 |
* register only once with its parent. |
|
926 |
* @param aChild The child control to register, cannot be a Shell. |
|
927 |
* @sa MSwtShell::RegisterChildShellL() |
|
928 |
*/ |
|
929 |
virtual void RegisterChildL(MSwtControl& aChild) =0; |
|
930 |
||
931 |
/** |
|
932 |
* Unregisters a child from this Composite |
|
933 |
* A Control shall not attempt to unregister itself from a |
|
934 |
* parent it was not registered with. |
|
935 |
* @param aChild The child control to unregister, cannot be a Shell |
|
936 |
* @sa MSwtShell::UnregisterChildShell() |
|
937 |
*/ |
|
938 |
virtual void UnregisterChild(MSwtControl& aChild) =0; |
|
939 |
||
940 |
/** |
|
941 |
* Retrieves the Java peer of each child. |
|
942 |
* @return A newly allocated array containing the peers; the caller is |
|
943 |
* responsible for freeing the array. NULL can be returned if |
|
944 |
* the Composite has no child. |
|
945 |
*/ |
|
946 |
virtual CSwtPeerArray* GetChildrenPeersL() =0; |
|
947 |
||
948 |
/** |
|
949 |
* Returns the array containing the Composite's children. |
|
950 |
* @return The array containing the Composite's children. |
|
951 |
* NULL can be returned if the Composite has no child. |
|
952 |
*/ |
|
953 |
virtual const RSwtControlArray* Children() const =0; |
|
954 |
||
955 |
/** |
|
956 |
* Notifies this Composite that one of its children has gained or lost focus. |
|
957 |
* @param aControl The child whose focus state has changed. The child may |
|
958 |
* not be a direct child, it can be the child of a child, and so on. |
|
959 |
*/ |
|
960 |
virtual void ChildFocusChanged(MSwtControl& aControl) =0; |
|
961 |
||
962 |
/** |
|
963 |
* Count focusable kids. |
|
964 |
* @param aTryBreakAfter try to stop counting when reached, count all when < 0 |
|
965 |
* @param aExclude count all except the composite and all its descents |
|
966 |
* @param aVisualFocusCount ignores controls which have ENoFocusBackground policy |
|
967 |
*/ |
|
968 |
virtual TInt CountFocusableChildren(TInt aTryBreakAfter = -1, |
|
969 |
const MSwtControl* aExclude = NULL, |
|
970 |
TBool aVisualFocusCount = ETrue) const =0; |
|
971 |
||
972 |
/** |
|
973 |
* Sets the tabbing order for the specified controls to match the |
|
974 |
* order that they occur in the argument list. |
|
975 |
* @param aControls An array of pointers to controls, they must all be |
|
976 |
* direct children of this Composite. May be NULL |
|
977 |
* but if so, aCount must be 0. |
|
978 |
* @param aCount The number of controls in aControls, if 0 |
|
979 |
* the tab order is reset to its default. |
|
980 |
*/ |
|
981 |
virtual void SetTabListL(MSwtControl** aControls, TInt aCount) =0; |
|
982 |
||
983 |
virtual CSwtPeerArray* GetTabListL() const =0; |
|
984 |
||
985 |
/** |
|
986 |
* Moves aChild1 such that it will lie above aChild2 |
|
987 |
* @param aChild1 The child to move. |
|
988 |
* @param aChild2 The child to be placed above of. If NULL, |
|
989 |
* aChild1 is moved to the top. |
|
990 |
*/ |
|
991 |
virtual void MoveChildAbove(MSwtControl& aChild1, const MSwtControl* aChild2) =0; |
|
992 |
||
993 |
/** |
|
994 |
* Moves aChild1 such that it will lie below aChild2 |
|
995 |
* @param aChild1 The child to move. |
|
996 |
* @param aChild2 The child to be placed below of. If NULL, |
|
997 |
* aChild1 is moved to the bottom. |
|
998 |
*/ |
|
999 |
virtual void MoveChildBelow(MSwtControl& aChild1, const MSwtControl* aChild2) =0; |
|
1000 |
||
1001 |
/** |
|
1002 |
* When a Radio Button with a Parent which don't have a NO_RADIO_GROUP is selected |
|
1003 |
* the other Radio Button with the same parent must be unselected. |
|
1004 |
* So the new selected Radio Button call this method. |
|
1005 |
* @param aSelectedButton The new selected Buttton. |
|
1006 |
*/ |
|
1007 |
virtual void NotifyRadioGroup(MSwtButton* aSelectedButton) = 0; |
|
1008 |
||
1009 |
/** |
|
1010 |
* Returns the pointer grabbing control of the composite. |
|
1011 |
* Pay attention that this returns NULL after pointer up! |
|
1012 |
* @return Pointer to the pointer grabbing control or NULL. |
|
1013 |
*/ |
|
1014 |
virtual MSwtControl* GetPointerGrabbingControl() const |
|
1015 |
{ |
|
1016 |
return NULL; |
|
1017 |
} |
|
1018 |
||
1019 |
/** |
|
1020 |
* ScrolledComposite content setter. |
|
1021 |
*/ |
|
1022 |
virtual void SetScrolledCompositeContentL(MSwtControl* aContent) = 0; |
|
1023 |
||
1024 |
/** |
|
1025 |
* In case this is a ScrolledComposite, returns the scrolled content. |
|
1026 |
*/ |
|
1027 |
virtual MSwtControl* ScrolledCompositeContent() const = 0; |
|
1028 |
||
1029 |
/** |
|
1030 |
* In case this is a ScrolledComposite, returns one of the possible physics actions defined in eswt.h |
|
1031 |
*/ |
|
1032 |
virtual TInt ScrolledCompositePysicsAction() const = 0; |
|
1033 |
||
1034 |
/** |
|
1035 |
* Draw scrollbar background. |
|
1036 |
*/ |
|
1037 |
virtual void DrawScrollBarBackground(const TRect& aRect) const = 0; |
|
1038 |
}; |
|
1039 |
||
1040 |
/** |
|
1041 |
* Interface class for the org.eclipse.swt.widgets.Canvas class |
|
1042 |
* A class that implements MSwtCanvas must also implement MSwtComposite. |
|
1043 |
*/ |
|
1044 |
class MSwtCanvas |
|
1045 |
{ |
|
1046 |
protected: |
|
1047 |
virtual ~MSwtCanvas() {} // Made protected to prevent destruction through the interface |
|
1048 |
||
1049 |
public: |
|
1050 |
/** |
|
1051 |
* Returns the MSwtComposite interface |
|
1052 |
*/ |
|
1053 |
virtual MSwtComposite* Composite() =0; |
|
1054 |
||
1055 |
/** |
|
1056 |
* Returns the MSwtScrollable interface |
|
1057 |
*/ |
|
1058 |
inline MSwtScrollable* Scrollable() |
|
1059 |
{ |
|
1060 |
return Composite()->Scrollable(); |
|
1061 |
} |
|
1062 |
||
1063 |
/** |
|
1064 |
* Returns the MSwtControl interface |
|
1065 |
*/ |
|
1066 |
inline MSwtControl* Control() |
|
1067 |
{ |
|
1068 |
return Composite()->Control(); |
|
1069 |
} |
|
1070 |
||
1071 |
/** |
|
1072 |
* Scrolls a rectangular area of this Canvas |
|
1073 |
* @param aDest The coordinates of the destination, in client coordinates. |
|
1074 |
* @param aRect The rectangle being scrolled, in client coordinates. |
|
1075 |
* @param aAll Whether to scroll the children as well. Only the children |
|
1076 |
* intersecting aRect are to be scrolled. |
|
1077 |
*/ |
|
1078 |
virtual void Scroll(const TPoint& aDest, const TRect& aRect, TBool aAll) =0; |
|
1079 |
}; |
|
1080 |
||
1081 |
||
1082 |
/** |
|
1083 |
* Interface class for the org.eclipse.swt.widgets.Decorations class |
|
1084 |
* A class that implements MSwtDecorations must also implement MSwtCanvas. |
|
1085 |
*/ |
|
1086 |
class MSwtDecorations |
|
1087 |
{ |
|
1088 |
protected: |
|
1089 |
virtual ~MSwtDecorations() {} // Made protected to prevent destruction through the interface |
|
1090 |
||
1091 |
public: |
|
1092 |
/** |
|
1093 |
* Returns the MSwtCanvas interface |
|
1094 |
*/ |
|
1095 |
virtual MSwtCanvas* Canvas() =0; |
|
1096 |
||
1097 |
/** |
|
1098 |
* Returns the MSwtComposite interface |
|
1099 |
*/ |
|
1100 |
inline MSwtComposite* Composite() |
|
1101 |
{ |
|
1102 |
return Canvas()->Composite(); |
|
1103 |
} |
|
1104 |
||
1105 |
/** |
|
1106 |
* Returns the MSwtScrollable interface |
|
1107 |
*/ |
|
1108 |
inline MSwtScrollable* Scrollable() |
|
1109 |
{ |
|
1110 |
return Canvas()->Scrollable(); |
|
1111 |
} |
|
1112 |
||
1113 |
/** |
|
1114 |
* Returns the MSwtControl interface |
|
1115 |
*/ |
|
1116 |
inline MSwtControl* Control() |
|
1117 |
{ |
|
1118 |
return Canvas()->Control(); |
|
1119 |
} |
|
1120 |
||
1121 |
/** |
|
1122 |
* Returns the decorations menu bar |
|
1123 |
*/ |
|
1124 |
virtual const MSwtMenu* MenuBar() =0; |
|
1125 |
||
1126 |
/** |
|
1127 |
* Sets the images for this Decorations |
|
1128 |
*/ |
|
1129 |
virtual void SetImageL(const MSwtImage* aImage) =0; |
|
1130 |
||
1131 |
/** |
|
1132 |
* Gets the images of this Decorations |
|
1133 |
*/ |
|
1134 |
virtual const MSwtImage* GetImage() const = 0; |
|
1135 |
||
1136 |
/** |
|
1137 |
* Maximises the control |
|
1138 |
*/ |
|
1139 |
virtual void SetMaximized(TBool aMaximized) =0; |
|
1140 |
||
1141 |
/** |
|
1142 |
* Returns if the control is currently maximised. |
|
1143 |
*/ |
|
1144 |
virtual TBool GetMaximized() const =0; |
|
1145 |
||
1146 |
/** |
|
1147 |
* Minimises (iconifies) the control. |
|
1148 |
*/ |
|
1149 |
virtual void SetMinimized(TBool aMinimized) =0; |
|
1150 |
||
1151 |
/** |
|
1152 |
* Returns if the control is currently maximised. |
|
1153 |
*/ |
|
1154 |
virtual TBool GetMinimized() const =0; |
|
1155 |
||
1156 |
/** |
|
1157 |
* Sets the menu bar |
|
1158 |
*/ |
|
1159 |
virtual void SetMenuBar(const MSwtMenu* aMenuBar) =0; |
|
1160 |
||
1161 |
/** |
|
1162 |
* Sets the <a>Decorations</a>'s title. |
|
1163 |
* @param aText A reference to the title descriptor. |
|
1164 |
* The method does nothing if the <a>Decorations</a> has no title. |
|
1165 |
*/ |
|
1166 |
virtual void SetTextL(const TDesC& aText) =0; |
|
1167 |
||
1168 |
/** |
|
1169 |
* Returns the Decorations' title. |
|
1170 |
* @return The title text, can be NULL. |
|
1171 |
*/ |
|
1172 |
virtual const TDesC* GetText() const =0; |
|
1173 |
||
1174 |
/** |
|
1175 |
* Sets the original default button of this Decorations. |
|
1176 |
*/ |
|
1177 |
virtual void SetDefaultButton(MSwtButton* aButton) =0; |
|
1178 |
||
1179 |
/** |
|
1180 |
* Sets the Button wich have the Focus. |
|
1181 |
*/ |
|
1182 |
virtual void SetFocusedDefaultButton(MSwtButton* aButton) =0; |
|
1183 |
||
1184 |
/** |
|
1185 |
* Returns the default button. |
|
1186 |
*/ |
|
1187 |
virtual const MSwtButton* OriginalDefaultButton() const =0; |
|
1188 |
||
1189 |
/** |
|
1190 |
* Returns the button wich have the Focus or the OriginalDefaultButton. |
|
1191 |
*/ |
|
1192 |
virtual const MSwtButton* DefaultButton() const =0; |
|
1193 |
||
1194 |
/** |
|
1195 |
* Returns the button wich have the Focus or the OriginalDefaultButton. |
|
1196 |
*/ |
|
1197 |
virtual TSwtPeer GetDefaultButton() const =0; |
|
1198 |
}; |
|
1199 |
||
1200 |
||
1201 |
/** |
|
1202 |
* Interface class for the org.eclipse.swt.widgets.Shell class |
|
1203 |
* A class that implements MSwtShell must also implement MSwtDecorations. |
|
1204 |
*/ |
|
1205 |
class MSwtShell |
|
1206 |
: public MEikStatusPaneObserver |
|
1207 |
{ |
|
1208 |
public: |
|
1209 |
/** |
|
1210 |
* Possible different styles for the status pane. |
|
1211 |
* The values have to match with what is defined in Java API for |
|
1212 |
* MobileShell.NO_STATUS_PANE, MobileShell.SMALL_STATUS_PANE and |
|
1213 |
* MobileShell.LARGE_STATUS_PANE. |
|
1214 |
*/ |
|
1215 |
enum TSwtStatusPaneStyle |
|
1216 |
{ |
|
1217 |
EStyleNoStatusPane = 1, // No status pane at all |
|
1218 |
EStyleSmallStatusPane = 2, // Small status pane variant |
|
1219 |
EStyleLargeStatusPane = 3 // Large status pane variant |
|
1220 |
}; |
|
1221 |
||
1222 |
public: |
|
1223 |
virtual ~MSwtShell() {} |
|
1224 |
||
1225 |
/** |
|
1226 |
* Returns the MSwtDecorations interface |
|
1227 |
*/ |
|
1228 |
virtual MSwtDecorations* Decorations() =0; |
|
1229 |
||
1230 |
/** |
|
1231 |
* Returns the MSwtCanvas interface |
|
1232 |
*/ |
|
1233 |
inline MSwtCanvas* Canvas() |
|
1234 |
{ |
|
1235 |
return Decorations()->Canvas(); |
|
1236 |
} |
|
1237 |
||
1238 |
/** |
|
1239 |
* Returns the MSwtComposite interface |
|
1240 |
*/ |
|
1241 |
inline MSwtComposite* Composite() |
|
1242 |
{ |
|
1243 |
return Decorations()->Composite(); |
|
1244 |
} |
|
1245 |
||
1246 |
/** |
|
1247 |
* Returns the MSwtScrollable interface |
|
1248 |
*/ |
|
1249 |
inline MSwtScrollable* Scrollable() |
|
1250 |
{ |
|
1251 |
return Decorations()->Scrollable(); |
|
1252 |
} |
|
1253 |
||
1254 |
/** |
|
1255 |
* Returns the MSwtControl interface |
|
1256 |
*/ |
|
1257 |
inline MSwtControl* Control() |
|
1258 |
{ |
|
1259 |
return Decorations()->Control(); |
|
1260 |
} |
|
1261 |
||
1262 |
/** |
|
1263 |
* Returns a pointer to the MSwtMobileShell interface of this Shell. |
|
1264 |
* Only actual MobileShells will return a non-null pointer |
|
1265 |
* @return The Control's MSwtMobileShell interface, or NULL |
|
1266 |
*/ |
|
1267 |
virtual MSwtMobileShell* MobileShellInterface() |
|
1268 |
{ |
|
1269 |
return NULL; |
|
1270 |
} |
|
1271 |
virtual const MSwtMobileShell* MobileShellInterface() const |
|
1272 |
{ |
|
1273 |
return NULL; |
|
1274 |
} |
|
1275 |
||
1276 |
/** |
|
1277 |
* Tests if this Shell is a MobileShell |
|
1278 |
*/ |
|
1279 |
virtual TBool IsMobileShell() const |
|
1280 |
{ |
|
1281 |
return EFalse; |
|
1282 |
} |
|
1283 |
||
1284 |
/** |
|
1285 |
* Returns the parent Shell of this Shell. |
|
1286 |
* Note: this method is only a more effective shortcut. The parent Shell |
|
1287 |
* can also be retrieved using Control(), MSwtControl::GetParent() |
|
1288 |
* and MSwtControl::ShellInterface() |
|
1289 |
*/ |
|
1290 |
virtual MSwtShell* GetParentShell() =0; |
|
1291 |
||
1292 |
/** |
|
1293 |
* Causes the Shell to become the active Shell |
|
1294 |
*/ |
|
1295 |
virtual void ForceActive() =0; |
|
1296 |
||
1297 |
/** |
|
1298 |
* Retrieves the Java peer of each child shell. |
|
1299 |
* @return A newly allocated array containing the peers; the caller is |
|
1300 |
* responsible for freeing the array. NULL can be returned if |
|
1301 |
* the Composite has no child. |
|
1302 |
*/ |
|
1303 |
virtual CSwtPeerArray* GetChildShellsPeersL() =0; |
|
1304 |
||
1305 |
/** |
|
1306 |
* Returns the display of the composite. |
|
1307 |
* @return A reference to the display. |
|
1308 |
*/ |
|
1309 |
virtual MSwtDisplay& Display() const =0; |
|
1310 |
||
1311 |
/** |
|
1312 |
* Returns the fullscreen mode of the MSwtShell |
|
1313 |
*/ |
|
1314 |
virtual TBool FullScreenMode() const =0; |
|
1315 |
||
1316 |
/** |
|
1317 |
* @return the initial editor input mode |
|
1318 |
*/ |
|
1319 |
virtual TInt GetImeInputMode() const =0; |
|
1320 |
||
1321 |
/** |
|
1322 |
* @return the minimum possible size for the shell |
|
1323 |
*/ |
|
1324 |
virtual TSize GetMinimumSize() const =0; |
|
1325 |
||
1326 |
/** |
|
1327 |
* Set the initial editor input mode |
|
1328 |
*/ |
|
1329 |
virtual void SetImeInputMode(TInt aMode) =0; |
|
1330 |
||
1331 |
/** |
|
1332 |
* Sets the minimum possible size for the shell |
|
1333 |
*/ |
|
1334 |
virtual void SetMinimumSize(const TSize& aMinimumSize) =0; |
|
1335 |
||
1336 |
/** |
|
1337 |
* Sets the control's style |
|
1338 |
* This method is provided in order to implement MobileShell |
|
1339 |
* whose ChangeTrimL method impacts on the style. |
|
1340 |
*/ |
|
1341 |
virtual void SetStyle(TInt aStyle) =0; |
|
1342 |
||
1343 |
/** |
|
1344 |
* Returns this Shell's full tab list |
|
1345 |
* The full tab list contains all of the Shell's children in the order they |
|
1346 |
* are to be traversed. It includes focusable as well as non-focusable |
|
1347 |
* controls but excludes child Shells. |
|
1348 |
*/ |
|
1349 |
virtual const RSwtControlArray& GetFullTabListL() =0; |
|
1350 |
||
1351 |
/** |
|
1352 |
* Tells the Shell to reset its tab list as it may have changed |
|
1353 |
* Reasons for resetting the tab list are addition or removal of a child. |
|
1354 |
*/ |
|
1355 |
virtual void ResetTabList() =0; |
|
1356 |
||
1357 |
/** |
|
1358 |
* Finds the new control to receive focus if the specified traversal is to be performed. |
|
1359 |
* @param aDetail The traversal detail; only values defined in |
|
1360 |
* TSwtTraversal are valid, others are to be ignored. |
|
1361 |
* @param aFocusControl The control that currently has the focus. |
|
1362 |
* @param aExcludedControls Optional list of controls that can not get the focus. |
|
1363 |
*/ |
|
1364 |
virtual MSwtControl* FindTraversalTargetL(TInt aDetail, MSwtControl& aFocusControl, |
|
1365 |
RSwtControlArray* aExcludedControls = NULL) =0; |
|
1366 |
||
1367 |
/** |
|
1368 |
* Sets this Shell's focus control |
|
1369 |
*/ |
|
1370 |
virtual void SetFocusControl(MSwtControl* aControl) =0; |
|
1371 |
||
1372 |
/** |
|
1373 |
* Test whether this Shell has a modal child Shell |
|
1374 |
* Only modal children that would prevent this Shell from being active are |
|
1375 |
* to be considered. For example, if a child Shell is modal but invisible |
|
1376 |
* it will not cause this method to return ETrue. |
|
1377 |
*/ |
|
1378 |
virtual TBool HasModalChild() const =0; |
|
1379 |
||
1380 |
/** |
|
1381 |
* Informs this Shell that its active status has changed. |
|
1382 |
* @param aIsActive The new active status |
|
1383 |
* @param aSetFocus Instructs a newly activated Shell to try and set the |
|
1384 |
* focus on one of its children. To be ignored if aIsActive is EFalse. |
|
1385 |
*/ |
|
1386 |
virtual void ActivityChanged(TBool aIsActive, TBool aSetFocus) =0; |
|
1387 |
||
1388 |
/** |
|
1389 |
* Sets the Shell's Z-order position |
|
1390 |
* The Shell must recursively set its child Shells' Z-order positions so as |
|
1391 |
* not to obscure them. |
|
1392 |
* @param aZPosition The new Z-order position, 0 being the foreground and |
|
1393 |
* the background being >0. |
|
1394 |
*/ |
|
1395 |
virtual void SetZPosition(TInt aZPosition) =0; |
|
1396 |
||
1397 |
/** |
|
1398 |
* Return the focussed control or NULL |
|
1399 |
*/ |
|
1400 |
virtual MSwtControl* FocusControl() const =0; |
|
1401 |
||
1402 |
/** |
|
1403 |
* Sets the default command |
|
1404 |
*/ |
|
1405 |
virtual void SetDefaultCommand(const MSwtCommand* aCommand) =0; |
|
1406 |
||
1407 |
/** |
|
1408 |
* Returns the default command |
|
1409 |
*/ |
|
1410 |
virtual const MSwtCommand* DefaultCommand() const =0; |
|
1411 |
||
1412 |
/** |
|
1413 |
* Makes the Shell full-screen or not |
|
1414 |
*/ |
|
1415 |
virtual void SetFullScreen(TBool aFullScreen) =0; |
|
1416 |
||
1417 |
/** |
|
1418 |
* Set the pointer to the child which should be added to Control Stack. |
|
1419 |
*/ |
|
1420 |
virtual void SetControlGoingToStack(MSwtControl* aControl) =0; |
|
1421 |
||
1422 |
/** |
|
1423 |
* Set the pointer to the child which gains the focus. |
|
1424 |
*/ |
|
1425 |
virtual void SetControlGainingFocus(MSwtControl* aControl) =0; |
|
1426 |
||
1427 |
/** |
|
1428 |
* Get the current status pane style. |
|
1429 |
*/ |
|
1430 |
virtual TSwtStatusPaneStyle StatusPaneStyle() const = 0; |
|
1431 |
||
1432 |
/** |
|
1433 |
* Returns the default bounds of the shell taking into consideration |
|
1434 |
* fullscreen mode, title and shell style. |
|
1435 |
*/ |
|
1436 |
virtual TRect DefaultBounds() const =0; |
|
1437 |
||
1438 |
/** |
|
1439 |
* Remember the control on which the foucus was set before activating the shell |
|
1440 |
*/ |
|
1441 |
virtual void SetToBeFocusedControl(MSwtControl* aControl) = 0; |
|
1442 |
||
1443 |
/** |
|
1444 |
* Checks if shell is not keeping reference (in iFocusMemory) to Control, |
|
1445 |
* that is going to be unregistered. |
|
1446 |
*/ |
|
1447 |
virtual void CheckFocusMemory(MSwtControl& aUnregisteredControl) =0; |
|
1448 |
||
1449 |
/** |
|
1450 |
* Unfortunately we are not able to keep drawing through Java side while |
|
1451 |
* kinetic scrolling is ongoing (panning or flicking). Shells need to |
|
1452 |
* respond immediately to native draw requests during scrolling. |
|
1453 |
* There can be only one Control at a time drawing urgently. |
|
1454 |
* See CSwtShell:Draw(). |
|
1455 |
*/ |
|
1456 |
virtual void SetUrgentPaintControl(MSwtControl* aControl) = 0; |
|
1457 |
virtual MSwtControl* UrgentPaintControl() const = 0; |
|
1458 |
||
1459 |
/** |
|
1460 |
* True if Java paint listeners are registered to self or children. |
|
1461 |
*/ |
|
1462 |
virtual TBool AsyncPainting() const = 0; |
|
1463 |
virtual void SetAsyncPainting(TBool aStatus) = 0; |
|
1464 |
||
1465 |
/** |
|
1466 |
* Attached CBA to the Shell. Cannot be undone. |
|
1467 |
*/ |
|
1468 |
virtual void InstallCba() = 0; |
|
1469 |
virtual TBool HasCba() const = 0; |
|
1470 |
||
1471 |
/** |
|
1472 |
* Set task tip style. |
|
1473 |
*/ |
|
1474 |
virtual void SetTaskTip() = 0; |
|
1475 |
virtual TBool IsTaskTip() const = 0; |
|
1476 |
||
1477 |
/** |
|
1478 |
* Sets the location even if top shell. |
|
1479 |
*/ |
|
1480 |
virtual void DoSetLocation(const TPoint& aPoint) = 0; |
|
1481 |
||
1482 |
/** |
|
1483 |
* To be called whenever focus changes or controls get pressed. |
|
1484 |
* @param aDrawNow - immediate or deferred repaint. |
|
1485 |
* For focus changes deferred repaint is preferred. |
|
1486 |
* For pressed state changes immediate repaint is preferred. |
|
1487 |
*/ |
|
1488 |
virtual void UpdateHighlight(TBool aDrawNow = EFalse) = 0; |
|
1489 |
||
1490 |
/** |
|
1491 |
* Remove any references to the disposing control. |
|
1492 |
*/ |
|
1493 |
virtual void ControlDisposing(const MSwtControl& aControl) = 0; |
|
1494 |
}; |
|
1495 |
||
1496 |
/** |
|
1497 |
* Structure containing the data needed for the |
|
1498 |
* org.eclipse.swt.core.Item class. |
|
1499 |
*/ |
|
1500 |
NONSHARABLE_CLASS(CSwtItem) |
|
1501 |
: public CBase |
|
1502 |
{ |
|
1503 |
public: |
|
1504 |
inline CSwtItem(HBufC* aString, const MSwtImage* aImage) |
|
1505 |
: iString(aString) |
|
1506 |
, iImage(aImage) |
|
1507 |
, iImageSize(TSize::EUninitialized) |
|
1508 |
{ |
|
1509 |
if (iImage != NULL) |
|
1510 |
iImage->AddRef(); |
|
1511 |
} |
|
1512 |
||
1513 |
inline CSwtItem(HBufC* aString, const MSwtImage* aImage, const TSize& aImageSize) |
|
1514 |
: iString(aString) |
|
1515 |
, iImage(aImage) |
|
1516 |
, iImageSize(aImageSize) |
|
1517 |
{ |
|
1518 |
if (iImage != NULL) |
|
1519 |
iImage->AddRef(); |
|
1520 |
} |
|
1521 |
||
1522 |
~CSwtItem() |
|
1523 |
{ |
|
1524 |
delete iString; |
|
1525 |
if (iImage != NULL) |
|
1526 |
iImage->RemoveRef(); |
|
1527 |
} |
|
1528 |
||
1529 |
inline const TDesC& String() const |
|
1530 |
{ |
|
1531 |
return (iString!=NULL) ? static_cast<const TDesC&>(*iString) : KNullDesC; |
|
1532 |
} |
|
1533 |
||
1534 |
inline void SetString(HBufC* aString) |
|
1535 |
{ |
|
1536 |
delete iString; |
|
1537 |
iString = aString; |
|
1538 |
} |
|
1539 |
||
1540 |
inline const MSwtImage* Image() const |
|
1541 |
{ |
|
1542 |
return iImage; |
|
1543 |
} |
|
1544 |
||
1545 |
inline void SetImageSize(const TSize& aNewSize) |
|
1546 |
{ |
|
1547 |
iImageSize = aNewSize; |
|
1548 |
} |
|
1549 |
||
1550 |
inline TSize ImageSize() const |
|
1551 |
{ |
|
1552 |
return iImageSize; |
|
1553 |
} |
|
1554 |
||
1555 |
inline void SetImage(const MSwtImage* aImage) |
|
1556 |
{ |
|
1557 |
if (iImage != NULL) |
|
1558 |
iImage->RemoveRef(); |
|
1559 |
iImage = aImage; |
|
1560 |
if (iImage != NULL) |
|
1561 |
iImage->AddRef(); |
|
1562 |
} |
|
1563 |
||
1564 |
private: |
|
1565 |
HBufC* iString; // Owned |
|
1566 |
const MSwtImage* iImage; // Ref counted |
|
1567 |
TSize iImageSize; |
|
1568 |
}; |
|
1569 |
||
1570 |
||
1571 |
/** |
|
1572 |
* Type for an array of titles in menu bar |
|
1573 |
*/ |
|
1574 |
typedef CEikMenuBar::CTitleArray CMenuBarTitleArray; |
|
1575 |
||
1576 |
||
1577 |
/** |
|
1578 |
* Interface class for the org.eclipse.swt.widgets.Menu class |
|
1579 |
* |
|
1580 |
*/ |
|
1581 |
class MSwtMenu |
|
1582 |
{ |
|
1583 |
protected: |
|
1584 |
virtual ~MSwtMenu() {} // Made protected to prevent destruction through the interface |
|
1585 |
||
1586 |
public: |
|
1587 |
/** |
|
1588 |
* Disposes of (i.e. destroys) the menu. |
|
1589 |
* @return The Java peer associated with this object |
|
1590 |
*/ |
|
1591 |
virtual TSwtPeer Dispose() =0; |
|
1592 |
||
1593 |
/** |
|
1594 |
* Returns the Java peer associated with this object. |
|
1595 |
*/ |
|
1596 |
virtual TSwtPeer JavaPeer() const =0; |
|
1597 |
||
1598 |
/** |
|
1599 |
* Registers a new menu item with this Menu |
|
1600 |
* A MenuItem may register itself only once it has been |
|
1601 |
* <b>fully</b> constructed. Additionally, a MenuItem shall |
|
1602 |
* register only once with its parent. |
|
1603 |
* @param aChild The menu item to register. |
|
1604 |
* @param aIndex The position of the menu item. |
|
1605 |
*/ |
|
1606 |
virtual void RegisterChildL(MSwtMenuItem& aChild, TInt aIndex) =0; |
|
1607 |
||
1608 |
/** |
|
1609 |
* Unregisters a menu item from this Menu |
|
1610 |
* A MenuItem shall not attempt to unregister itself from a |
|
1611 |
* parent it was not registered with. |
|
1612 |
* @param aChild The menu item to unregister. |
|
1613 |
*/ |
|
1614 |
virtual void UnregisterChild(MSwtMenuItem& aChild) =0; |
|
1615 |
||
1616 |
/** |
|
1617 |
* Enables or disables the menubar |
|
1618 |
*/ |
|
1619 |
virtual void SetEnabled(TBool aEnabled) =0; |
|
1620 |
||
1621 |
/** |
|
1622 |
* Make menu visible or invisible |
|
1623 |
*/ |
|
1624 |
virtual void SetVisible(TBool aEnabled) =0; |
|
1625 |
||
1626 |
/** |
|
1627 |
* Returns ETrue if the menu is enabled, EFalse otherwise. |
|
1628 |
*/ |
|
1629 |
virtual TBool IsEnabled() const =0; |
|
1630 |
||
1631 |
/** |
|
1632 |
* Returns ETrue if the menu is set to be visible, EFalse otherwise. |
|
1633 |
* This is just a flag setting, does not reffer to Menu's actual visibility on the screen. |
|
1634 |
*/ |
|
1635 |
virtual TBool IsVisible() const =0; |
|
1636 |
||
1637 |
/** |
|
1638 |
* Set default menu item |
|
1639 |
*/ |
|
1640 |
virtual void SetDefaultItem(MSwtMenuItem* aMenuItem) =0; |
|
1641 |
||
1642 |
virtual MSwtMenuItem* DefaultItem() const =0; |
|
1643 |
||
1644 |
/** |
|
1645 |
* Fills the menu pane control with the menu items. |
|
1646 |
*/ |
|
1647 |
virtual void FillPaneL(CEikMenuPane& aPane) const =0; |
|
1648 |
||
1649 |
/** |
|
1650 |
* Asks the menu to reload resources and redisplay them on the shown menu pane. |
|
1651 |
*/ |
|
1652 |
virtual void RefreshPaneL(CEikMenuPane& aPane) const =0; |
|
1653 |
||
1654 |
#ifdef RD_SCALABLE_UI_V2 |
|
1655 |
/** |
|
1656 |
* Adds the menu items to the stylus popup menu. Also the submenu items are |
|
1657 |
* added directly to the stylus popup menu as it does not support cascaded menus. |
|
1658 |
* @param aPoupMenu The stylus popup menu to which the menu items are added. |
|
1659 |
*/ |
|
1660 |
virtual void FillPopupL(CAknStylusPopUpMenu& aPopupMenu) const =0; |
|
1661 |
#endif //RD_SCALABLE_UI_V2 |
|
1662 |
||
1663 |
/** |
|
1664 |
* Processes the command associated with the command Id and the item index. |
|
1665 |
*/ |
|
1666 |
virtual void ProcessCommandL(TInt aCommandId, TInt aItemIndex, TBool aOfferToSubMenus = EFalse) const =0; |
|
1667 |
||
1668 |
/** |
|
1669 |
* Returns the number of enabled items. |
|
1670 |
* @param aStylusPopupMenu Indicates if the displayable items are counted for |
|
1671 |
* stylus popup menu. Stylus popup menu is handled differently |
|
1672 |
* than the other menus. |
|
1673 |
* @return The number of displayable items. |
|
1674 |
*/ |
|
1675 |
virtual TInt CountDisplayableItems(TBool aStylusPopupMenu = EFalse) const =0; |
|
1676 |
||
1677 |
virtual const MSwtMenu* GetCascadeMenu(const CEikMenuPaneItem::SData& aItemData) const =0; |
|
1678 |
||
1679 |
virtual TBool HasRadioGroup() const =0; |
|
1680 |
||
1681 |
/** |
|
1682 |
* Return the host menu pane of this menu. |
|
1683 |
*/ |
|
1684 |
virtual CEikMenuPane* Host() const =0; |
|
1685 |
||
1686 |
/** |
|
1687 |
* Set the host menu pane of this menu. |
|
1688 |
*/ |
|
1689 |
virtual void SetHost(CEikMenuPane* aPane) =0; |
|
1690 |
||
1691 |
/** |
|
1692 |
* Set menu location |
|
1693 |
*/ |
|
1694 |
virtual void SetLocation(TInt aX, TInt aY) =0; |
|
1695 |
||
1696 |
/** |
|
1697 |
* Get menu location |
|
1698 |
*/ |
|
1699 |
virtual TPoint GetLocation() const =0; |
|
1700 |
||
1701 |
/** |
|
1702 |
* Show menu on its location |
|
1703 |
*/ |
|
1704 |
virtual TBool LocationEnabled() const =0; |
|
1705 |
||
1706 |
/** |
|
1707 |
* Get reference to item list. |
|
1708 |
*/ |
|
1709 |
virtual const RPointerArray<MSwtMenuItem>* Items() const = 0; |
|
1710 |
}; |
|
1711 |
||
1712 |
||
1713 |
/** |
|
1714 |
* Interface class for the org.eclipse.swt.widgets.MenuItem class |
|
1715 |
*/ |
|
1716 |
class MSwtMenuItem |
|
1717 |
{ |
|
1718 |
// Types |
|
1719 |
public: |
|
1720 |
enum TSwtMenuItemData |
|
1721 |
{ |
|
1722 |
ESwtMenuItemDataAll = 0, |
|
1723 |
ESwtMenuItemDataText, |
|
1724 |
ESwtMenuItemDataCascade, |
|
1725 |
ESwtMenuItemDataSelection, |
|
1726 |
ESwtMenuItemDataImage, |
|
1727 |
ESwtMenuItemDataFlags |
|
1728 |
}; |
|
1729 |
protected: |
|
1730 |
virtual ~MSwtMenuItem() {} // Made protected to prevent destruction through the interface |
|
1731 |
||
1732 |
public: |
|
1733 |
/** |
|
1734 |
* Disposes of (i.e. destroys) the menu item. |
|
1735 |
* @return The Java peer associated with this object |
|
1736 |
*/ |
|
1737 |
virtual TSwtPeer Dispose() =0; |
|
1738 |
||
1739 |
/** |
|
1740 |
* Returns the Java peer associated with this object. |
|
1741 |
*/ |
|
1742 |
virtual TSwtPeer JavaPeer() const =0; |
|
1743 |
||
1744 |
/** |
|
1745 |
* Returns the parent menu. |
|
1746 |
*/ |
|
1747 |
virtual const MSwtMenu& Parent() const =0; |
|
1748 |
||
1749 |
/** |
|
1750 |
* Returns ETrue if the menu item is selected. |
|
1751 |
*/ |
|
1752 |
virtual TBool GetSelection() const =0; |
|
1753 |
||
1754 |
/** |
|
1755 |
* Sets an accelerator to the menu item. |
|
1756 |
*/ |
|
1757 |
virtual void SetAcceleratorL(TInt aAccelerator) =0; |
|
1758 |
||
1759 |
/** |
|
1760 |
* Enables or disables the menu item. |
|
1761 |
*/ |
|
1762 |
virtual void SetEnabled(TBool aEnabled) =0; |
|
1763 |
||
1764 |
/** |
|
1765 |
* Sets the image of the menu item. |
|
1766 |
*/ |
|
1767 |
virtual void SetImageL(const MSwtImage* aImage) =0; |
|
1768 |
||
1769 |
/** |
|
1770 |
* Sets the Menu of the menu item. |
|
1771 |
*/ |
|
1772 |
virtual void SetMenuL(const MSwtMenu* aMenu) =0; |
|
1773 |
||
1774 |
/** |
|
1775 |
* Selects of unselects the menu item. |
|
1776 |
*/ |
|
1777 |
virtual void SetSelection(TBool aSelected) =0; |
|
1778 |
||
1779 |
/** |
|
1780 |
* Sets the text of the menu item. |
|
1781 |
*/ |
|
1782 |
virtual void SetTextL(const TDesC& aText) =0; |
|
1783 |
||
1784 |
/** |
|
1785 |
* Gets the accelerator of the menu item. |
|
1786 |
*/ |
|
1787 |
virtual TInt Accelerator() const =0; |
|
1788 |
||
1789 |
/** |
|
1790 |
* Returns ETrue if the menu item is enabled, EFalse otherwise. |
|
1791 |
*/ |
|
1792 |
virtual TBool IsEnabled() const =0; |
|
1793 |
||
1794 |
/** |
|
1795 |
* Gets the image of the menu item. |
|
1796 |
*/ |
|
1797 |
virtual const MSwtImage* Image() const =0; |
|
1798 |
||
1799 |
/** |
|
1800 |
* Gets the bitmap and mask of the menu item image. |
|
1801 |
* MenuItem keeps the ownership and its image is subreferenced according to aSize. |
|
1802 |
*/ |
|
1803 |
virtual void GetImageBitmapsL(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask, |
|
1804 |
const TSize& aSize) = 0; |
|
1805 |
||
1806 |
/** |
|
1807 |
* Gets the menu associated with the menu item. |
|
1808 |
*/ |
|
1809 |
virtual const MSwtMenu* Menu() const =0; |
|
1810 |
||
1811 |
/** |
|
1812 |
* @ brief Gets the text of the menu item. |
|
1813 |
*/ |
|
1814 |
virtual const TDesC& Text() const =0; |
|
1815 |
||
1816 |
/** |
|
1817 |
* Gets the command id. |
|
1818 |
*/ |
|
1819 |
virtual TInt CommandId() const =0; |
|
1820 |
||
1821 |
/** |
|
1822 |
* Returns the style of the menu item. |
|
1823 |
*/ |
|
1824 |
virtual TInt Style() const =0; |
|
1825 |
||
1826 |
/** |
|
1827 |
* Similar to Menu's FillPaneL, adds data to the native pane item. |
|
1828 |
* @param one of TSwtMenuItemData |
|
1829 |
*/ |
|
1830 |
virtual void UpdatePaneL(CEikMenuPane& aPane, TSwtMenuItemData aDetail) =0; |
|
1831 |
}; |
|
1832 |
||
1833 |
||
1834 |
/** |
|
1835 |
* Interface class for the menu arranger |
|
1836 |
*/ |
|
1837 |
class MSwtMenuArranger |
|
1838 |
{ |
|
1839 |
public: |
|
1840 |
typedef enum TSwtMenuEvent |
|
1841 |
{ |
|
1842 |
ESwtMenuAdded, |
|
1843 |
ESwtMenuRemoved, |
|
1844 |
ESwtMenuEnableStateChanged, |
|
1845 |
ESwtMenuItemAdded, |
|
1846 |
ESwtMenuItemRemoved, |
|
1847 |
ESwtMenuItemEnableStateChanged |
|
1848 |
}; |
|
1849 |
||
1850 |
public: |
|
1851 |
virtual ~MSwtMenuArranger() {} |
|
1852 |
virtual void ControlFocusLost() =0; |
|
1853 |
virtual void ControlFocusGained(const MSwtControl& aControl) =0; |
|
1854 |
virtual void ActiveShellLost() =0; |
|
1855 |
virtual void ActiveShellGained(const MSwtShell& aShell) =0; |
|
1856 |
virtual void MenuBarSetOnDecorations() =0; |
|
1857 |
virtual void SetCommandMenu(const MSwtMenu* aCommandMenu) =0; |
|
1858 |
virtual void SetContextMenu(const MSwtMenu* aContextMenu) =0; |
|
1859 |
virtual void HandleMenuChangedL(const MSwtMenu& aMenu, TSwtMenuEvent aType) =0; |
|
1860 |
virtual CEikMenuBar* EikMenuBar() const =0; |
|
1861 |
virtual void AddOptionsCommandL() =0; |
|
1862 |
virtual void RemoveOptionsCommand() =0; |
|
1863 |
virtual TBool IsOptionsCommandAdded() =0; |
|
1864 |
virtual void TryDisplayMenuBarL(TInt aDisplayContextMenu) =0; |
|
1865 |
virtual void StopDisplayingMenuBar() =0; |
|
1866 |
virtual TBool HasMenuItems() const =0; |
|
1867 |
virtual void HandleResolutionChangeL() =0; |
|
1868 |
virtual void HandleWindowVisibilityChangeL(CCoeControl* aDestination) =0; |
|
1869 |
virtual TSize ImageSize() const =0; |
|
1870 |
virtual CEikMenuPane* ParentPane(CEikMenuPane& aPane) const =0; |
|
1871 |
||
1872 |
#ifdef RD_SCALABLE_UI_V2 |
|
1873 |
virtual void OpenStylusPopupMenuL(const MSwtControl& aControl, const TPoint& aPoint, |
|
1874 |
MSwtPopupMenuCallBack* aCallBack = NULL) =0; |
|
1875 |
virtual void OpenStylusPopupMenuL(const MSwtMenu& aMenu, const TPoint& aPoint) =0; |
|
1876 |
virtual void CloseStylusPopupMenuL() =0; |
|
1877 |
#endif //RD_SCALABLE_UI_V2 |
|
1878 |
}; |
|
1879 |
||
1880 |
||
1881 |
/** |
|
1882 |
* Interface class for the org.eclipse.swt.widgets.Label class |
|
1883 |
*/ |
|
1884 |
class MSwtLabel |
|
1885 |
{ |
|
1886 |
protected: |
|
1887 |
virtual ~MSwtLabel() {} // Made protected to prevent destruction through the interface |
|
1888 |
||
1889 |
public: |
|
1890 |
/** |
|
1891 |
* Returns the MSwtControl interface. |
|
1892 |
*/ |
|
1893 |
virtual MSwtControl* Control() = 0; |
|
1894 |
||
1895 |
/** |
|
1896 |
* Returns a value which describes the position of the text or image in the receiver. |
|
1897 |
* This method will only get called if the KSwtStyleSeparator flag is <b>not</b> set. |
|
1898 |
*/ |
|
1899 |
virtual TInt GetAlignment() const = 0; |
|
1900 |
||
1901 |
/** |
|
1902 |
* Controls how text and images will be displayed in the receiver. |
|
1903 |
* This method will only get called if the KSwtStyleSeparator |
|
1904 |
* flag is <b>not</b> set. |
|
1905 |
* @param aAlignment The new alignment, one of KSwtStyleLead, |
|
1906 |
* KSwtStyleCenter or KSwtStyleTrail. |
|
1907 |
*/ |
|
1908 |
virtual void SetAlignment(TInt aAlignment) = 0; |
|
1909 |
||
1910 |
/** |
|
1911 |
* Sets the receiver's image to the argument, which may be null |
|
1912 |
* indicating that no image should be displayed. |
|
1913 |
* This method will only get called if the KSwtStyleSeparator |
|
1914 |
* flag is <b>not</b> set. |
|
1915 |
*/ |
|
1916 |
virtual void SetImageL(const MSwtImage* aImage) = 0; |
|
1917 |
||
1918 |
/** |
|
1919 |
* Sets the receiver's text. |
|
1920 |
* This method will only get called if the KSwtStyleSeparator |
|
1921 |
* flag is <b>not</b> set. |
|
1922 |
*/ |
|
1923 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1924 |
}; |
|
1925 |
||
1926 |
||
1927 |
/** |
|
1928 |
* Interface class for the org.eclipse.swt.widgets.Button class |
|
1929 |
*/ |
|
1930 |
class MSwtButton |
|
1931 |
{ |
|
1932 |
protected: |
|
1933 |
virtual ~MSwtButton() {} // Made protected to prevent destruction through the interface |
|
1934 |
||
1935 |
public: |
|
1936 |
/** |
|
1937 |
* Returns the MSwtControl interface. |
|
1938 |
*/ |
|
1939 |
virtual MSwtControl* Control() = 0; |
|
1940 |
||
1941 |
/** |
|
1942 |
* Returns a value which describes state of the button. |
|
1943 |
*/ |
|
1944 |
virtual TBool GetSelection() const = 0; |
|
1945 |
||
1946 |
/** |
|
1947 |
* Gets the state of the button. |
|
1948 |
*/ |
|
1949 |
virtual void SetSelection(TBool aState) = 0; |
|
1950 |
||
1951 |
/** |
|
1952 |
* Returns a value which describes the position of the text or image in the receiver. |
|
1953 |
*/ |
|
1954 |
virtual TInt GetAlignment() const = 0; |
|
1955 |
||
1956 |
/** |
|
1957 |
* Controls how text and images will be displayed in the receiver. |
|
1958 |
* @param aAlignment The new alignment, one of KSwtStyleLeft, |
|
1959 |
* KSwtStyleCenter or KSWtStyleRight. |
|
1960 |
*/ |
|
1961 |
virtual void SetAlignment(TInt aAlignment) = 0; |
|
1962 |
||
1963 |
/** |
|
1964 |
* Sets the receiver's image to the argument, which may be null |
|
1965 |
* indicating that no image should be displayed. |
|
1966 |
*/ |
|
1967 |
virtual void SetImageL(const MSwtImage* aImage) = 0; |
|
1968 |
||
1969 |
/** |
|
1970 |
* Sets the receiver's text. |
|
1971 |
*/ |
|
1972 |
virtual void SetTextL(const TDesC& aText) = 0; |
|
1973 |
||
1974 |
/** |
|
1975 |
* Sets this button as the default Button. |
|
1976 |
*/ |
|
1977 |
virtual void SetDefault(TBool aDefault) = 0; |
|
1978 |
||
1979 |
/** |
|
1980 |
* Indicate if the Button is default button. |
|
1981 |
*/ |
|
1982 |
virtual TBool IsDefault() const = 0; |
|
1983 |
||
1984 |
/** |
|
1985 |
* Simulate button selection. |
|
1986 |
*/ |
|
1987 |
virtual void ClickL() = 0; |
|
1988 |
}; |
|
1989 |
||
1990 |
||
1991 |
/** |
|
1992 |
* Interface class for Verify event observer. |
|
1993 |
*/ |
|
1994 |
class MSwtVerifyEventObserver |
|
1995 |
{ |
|
1996 |
public: |
|
1997 |
/** |
|
1998 |
* Processes the text from the verify event |
|
1999 |
*/ |
|
2000 |
virtual void ProcessVerifiedTextL(TInt aStart, TInt aEnd, TDes& aText) =0; |
|
2001 |
}; |
|
2002 |
||
2003 |
||
2004 |
/** |
|
2005 |
* Interface class for the org.eclipse.swt.widgets.Combo class |
|
2006 |
* A class that implements MSwtCombo must also implement MSwtComposite. |
|
2007 |
*/ |
|
2008 |
class MSwtCombo |
|
2009 |
{ |
|
2010 |
protected: |
|
2011 |
virtual ~MSwtCombo() {} // Made protected to prevent destruction through the interface |
|
2012 |
||
2013 |
public: |
|
2014 |
/** |
|
2015 |
* Returns the MSwtComposite interface |
|
2016 |
*/ |
|
2017 |
virtual MSwtComposite* Composite() =0; |
|
2018 |
||
2019 |
/** |
|
2020 |
* Returns the MSwtScrollable interface |
|
2021 |
*/ |
|
2022 |
inline MSwtScrollable* Scrollable() |
|
2023 |
{ |
|
2024 |
return Composite()->Scrollable(); |
|
2025 |
} |
|
2026 |
||
2027 |
/** |
|
2028 |
* Returns the MSwtControl interface |
|
2029 |
*/ |
|
2030 |
inline MSwtControl* Control() |
|
2031 |
{ |
|
2032 |
return Composite()->Control(); |
|
2033 |
} |
|
2034 |
||
2035 |
/** |
|
2036 |
* Appends a string element to the <a>Combo</a>. |
|
2037 |
* @param aPtr A reference to the descriptor to be appended. |
|
2038 |
*/ |
|
2039 |
virtual void AppendL(const TDesC& aPtr) =0; |
|
2040 |
||
2041 |
/** |
|
2042 |
* Inserts a string element into the <a>Combo</a> at the specified position. |
|
2043 |
* @param aPos The position (relative to zero) where the string element is to be inserted. |
|
2044 |
* @param aPtr A reference to the descriptor to be inserted. |
|
2045 |
*/ |
|
2046 |
virtual void InsertL(TInt aPos, const TDesC& aPtr) =0; |
|
2047 |
||
2048 |
/** |
|
2049 |
* Clears the selection. |
|
2050 |
*/ |
|
2051 |
virtual void ClearSelectionL() =0; |
|
2052 |
||
2053 |
/** |
|
2054 |
* Copies the selected text to the clipboard. |
|
2055 |
*/ |
|
2056 |
virtual void CopyL() =0; |
|
2057 |
||
2058 |
/** |
|
2059 |
* Deselects the item indexed as aIndex from the <a>Combo</a>. |
|
2060 |
* |
|
2061 |
* @param aIndex The index of the item to deselect. |
|
2062 |
*/ |
|
2063 |
virtual void DeselectItem(TInt aIndex) =0; |
|
2064 |
||
2065 |
/** |
|
2066 |
* Deselects all the items from the <a>Combo</a>. |
|
2067 |
*/ |
|
2068 |
virtual void DeselectAll() =0; |
|
2069 |
||
2070 |
/** |
|
2071 |
* Gets the text of the specified item. |
|
2072 |
* @param aItemIndex The specified item. |
|
2073 |
* @param aString The descriptor that will hold the item's text upon return. |
|
2074 |
* Must be empty upon call. |
|
2075 |
*/ |
|
2076 |
virtual void GetItemL(TInt aItemIndex, TPtrC& aString) const =0; |
|
2077 |
||
2078 |
/** |
|
2079 |
* Returns the number of elements of the <a>Combo</a>. |
|
2080 |
*/ |
|
2081 |
virtual TInt GetItemCount() const =0; |
|
2082 |
||
2083 |
/** |
|
2084 |
* Returns the item height. |
|
2085 |
*/ |
|
2086 |
virtual TInt GetItemHeight() const =0; |
|
2087 |
||
2088 |
/** |
|
2089 |
* Returns the array of items from the <a>Combo</a> |
|
2090 |
*/ |
|
2091 |
virtual CPtrCArray* GetItemsL() const =0; |
|
2092 |
||
2093 |
/** |
|
2094 |
* Returns the orientation of the receiver. |
|
2095 |
*/ |
|
2096 |
virtual TInt GetOrientation() const =0; |
|
2097 |
||
2098 |
/** |
|
2099 |
* Returns the selection range |
|
2100 |
* @return The selection in a TPoint where iX is |
|
2101 |
* the start and iY is the end. |
|
2102 |
*/ |
|
2103 |
virtual TPoint GetSelection() const =0; |
|
2104 |
||
2105 |
/** |
|
2106 |
* Returns the index of the currently selected item. |
|
2107 |
*/ |
|
2108 |
virtual TInt GetSelectionIndex() const =0; |
|
2109 |
||
2110 |
/** |
|
2111 |
* Gets the widget's text. |
|
2112 |
* @return The widget's text in a newly allocated buffer. The caller is |
|
2113 |
* responsible for deleting the returned buffer. NULL |
|
2114 |
* may be returned if the widget is empty. |
|
2115 |
*/ |
|
2116 |
virtual HBufC* GetTextL() const =0; |
|
2117 |
||
2118 |
/** |
|
2119 |
* Returns the height of the text field. |
|
2120 |
*/ |
|
2121 |
virtual TInt GetTextHeightL() const =0; |
|
2122 |
||
2123 |
/** |
|
2124 |
* Returns the maximum number of characters that the text field is capable of holding. |
|
2125 |
*/ |
|
2126 |
virtual TInt GetTextLimit() const =0; |
|
2127 |
||
2128 |
/** |
|
2129 |
* Gets the number of items that are visible in the drop down portion of the list. |
|
2130 |
*/ |
|
2131 |
virtual TInt GetVisibleItemCount() const =0; |
|
2132 |
||
2133 |
/** |
|
2134 |
* Searches for a text item from a given position. |
|
2135 |
* @param aString The string to search for. |
|
2136 |
* @param aStart The position from which we start. |
|
2137 |
*/ |
|
2138 |
virtual TInt IndexOf(const TDesC& aString, TInt& aStart) const =0; |
|
2139 |
||
2140 |
/** |
|
2141 |
* Insert a text at the current caret position. |
|
2142 |
* No event is posted. |
|
2143 |
*/ |
|
2144 |
virtual TBool InsertInTextControlL(const TDesC& aText) =0; |
|
2145 |
||
2146 |
/** |
|
2147 |
* Pastes text from the clipboard. |
|
2148 |
* The selected text is deleted from the widget and new text inserted from |
|
2149 |
* the clipboard. |
|
2150 |
* @return ETrue if a modify notification must be sent |
|
2151 |
*/ |
|
2152 |
virtual TBool PasteL() =0; |
|
2153 |
||
2154 |
/** |
|
2155 |
* Removes the specified item from the <a>Combo</a>. |
|
2156 |
* @param aIndex The specified item. |
|
2157 |
*/ |
|
2158 |
virtual void RemoveItemL(TInt aIndex) =0; |
|
2159 |
||
2160 |
/** |
|
2161 |
* Removes a range of items from the <a>Combo</a>. |
|
2162 |
* @param aStart The first element to remove. |
|
2163 |
* @param aEnd The last element to remove. |
|
2164 |
*/ |
|
2165 |
virtual void RemoveRangeL(TInt aStart, TInt aEnd) =0; |
|
2166 |
||
2167 |
/** |
|
2168 |
* Removes all items from the <a>Combo</a>. |
|
2169 |
*/ |
|
2170 |
virtual void RemoveAllL() =0; |
|
2171 |
||
2172 |
/** |
|
2173 |
* Selects a single item. |
|
2174 |
* @param aIndex The item to select. |
|
2175 |
*/ |
|
2176 |
virtual void SelectItemL(TInt aIndex) =0; |
|
2177 |
||
2178 |
/** |
|
2179 |
* Sets the receiver's items to be the given array of items. |
|
2180 |
* @param aStringArray The array to set. |
|
2181 |
*/ |
|
2182 |
virtual void SetItemsL(MDesCArray* aStringArray) =0; |
|
2183 |
||
2184 |
/** |
|
2185 |
* Sets the orientation of the widget. |
|
2186 |
*/ |
|
2187 |
virtual void SetOrientationL(TInt aOrientation) =0; |
|
2188 |
||
2189 |
/** |
|
2190 |
* Sets the selection. |
|
2191 |
* Indexing is zero based. The range of a selection is from 0..N where N is |
|
2192 |
* the number of characters in the widget. If the specified range is invalid, |
|
2193 |
* as much of it as is possible must be set as the selection. |
|
2194 |
* @param aStart The selection's starting point. |
|
2195 |
* @param aEnd The selection's ending point. |
|
2196 |
*/ |
|
2197 |
virtual void SetSelectionL(TInt aStart, TInt aEnd) =0; |
|
2198 |
||
2199 |
/** |
|
2200 |
* Sets the text |
|
2201 |
* @param aText The new text. As a convenience, the descriptor can be freely |
|
2202 |
* modified by the implementation if need be. |
|
2203 |
* @return ETrue if a modify notification must be sent |
|
2204 |
*/ |
|
2205 |
virtual TBool SetTextL(TDes& aText) =0; |
|
2206 |
||
2207 |
/** |
|
2208 |
* Sets the maximum number of characters that the text field is capable of holding to be the argument. |
|
2209 |
* @param aTextLimit The limit to set. |
|
2210 |
* @return ETrue if a modify notification must be sent |
|
2211 |
*/ |
|
2212 |
virtual TBool SetTextLimit(TInt aTextLimit) =0; |
|
2213 |
||
2214 |
/** |
|
2215 |
* Sets the number of items that are visible in the drop down portion of the list. |
|
2216 |
* @param aCount The number of items to set. |
|
2217 |
*/ |
|
2218 |
virtual void SetVisibleItemCount(TInt aCount) =0; |
|
2219 |
}; |
|
2220 |
||
2221 |
||
2222 |
/** |
|
2223 |
* Interface class for the org.eclipse.ercp.swt.mobile.HyperLink class. |
|
2224 |
*/ |
|
2225 |
class MSwtLink |
|
2226 |
{ |
|
2227 |
protected: |
|
2228 |
virtual ~MSwtLink() {}; // Made protected to prevent destruction through the interface |
|
2229 |
||
2230 |
public: |
|
2231 |
/** |
|
2232 |
* Returns the MSwtControl interface |
|
2233 |
*/ |
|
2234 |
virtual MSwtControl* Control() = 0; |
|
2235 |
||
2236 |
/** |
|
2237 |
* Sets the receiver's data. |
|
2238 |
* @param aTextFragments Array of text fragments strings. |
|
2239 |
* @param aLinkTargets Link targets asociated to the text fragments. |
|
2240 |
*/ |
|
2241 |
virtual void SetLinkDataL(const CDesCArray* aTextFragments, |
|
2242 |
const CDesCArray* aLinkTargets) = 0; |
|
2243 |
}; |
|
2244 |
||
2245 |
/** |
|
2246 |
* Interface class for the org.eclipse.swt.widgets.List class |
|
2247 |
* A class that implements MSwtList must also implement MSwtScrollable. |
|
2248 |
*/ |
|
2249 |
class MSwtList |
|
2250 |
{ |
|
2251 |
protected: |
|
2252 |
virtual ~MSwtList() {} // Made protected to prevent destruction through the interface |
|
2253 |
||
2254 |
public: |
|
2255 |
/** |
|
2256 |
* Returns the MSwtScrollable interface |
|
2257 |
*/ |
|
2258 |
virtual MSwtScrollable* Scrollable() =0; |
|
2259 |
||
2260 |
/** |
|
2261 |
* Returns the MSwtControl interface |
|
2262 |
*/ |
|
2263 |
inline MSwtControl* Control() |
|
2264 |
{ |
|
2265 |
return Scrollable()->Control(); |
|
2266 |
} |
|
2267 |
||
2268 |
/** |
|
2269 |
* Appends a string element to the <a>List</a>. |
|
2270 |
* @param aPtr A reference to the descriptor to be appended. |
|
2271 |
*/ |
|
2272 |
virtual void AppendL(const TDesC& aPtr) =0; |
|
2273 |
||
2274 |
/** |
|
2275 |
* Inserts a string element into the <a>List</a> at the specified position. |
|
2276 |
* @param aPos The position (relative to zero) where the string element is to be inserted. |
|
2277 |
* @param aPtr A reference to the descriptor to be inserted. |
|
2278 |
*/ |
|
2279 |
virtual void InsertL(TInt aPos, const TDesC& aPtr) =0; |
|
2280 |
||
2281 |
/** |
|
2282 |
* Deselects the items defined in the aIndices array from the <a>List</a>. |
|
2283 |
* @param aIndices The array of the items to deselect. |
|
2284 |
* @param aCount The number of items of this array. |
|
2285 |
*/ |
|
2286 |
virtual void DeselectItems(const TInt* aIndices, TInt aCount) =0; |
|
2287 |
||
2288 |
/** |
|
2289 |
* Deselects the item indexed as aIndex from the <a>List</a>. |
|
2290 |
* @param aIndex The index of the item to deselect. |
|
2291 |
*/ |
|
2292 |
virtual void DeselectItem(TInt aIndex) =0; |
|
2293 |
||
2294 |
/** |
|
2295 |
* Deselects the items indexed from aStart to aEnd from the <a>List</a>. |
|
2296 |
* @param aStart The first element to deselect. |
|
2297 |
* @param aEnd The last element to deselect. |
|
2298 |
*/ |
|
2299 |
virtual void DeselectRange(TInt aStart, TInt aEnd) =0; |
|
2300 |
||
2301 |
/** |
|
2302 |
* Deselects all the items from the <a>List</a>. |
|
2303 |
*/ |
|
2304 |
virtual void DeselectAll() =0; |
|
2305 |
||
2306 |
/** |
|
2307 |
* Gets the current item. |
|
2308 |
*/ |
|
2309 |
virtual TInt GetFocusIndex() const =0; |
|
2310 |
||
2311 |
/** |
|
2312 |
* Gets the text of the specified item. |
|
2313 |
* @param aItemIndex The specified item. |
|
2314 |
* @param aString The descriptor that will hold the item's text upon return. |
|
2315 |
* Must be empty upon call. |
|
2316 |
*/ |
|
2317 |
virtual void GetItemL(TInt aItemIndex, TPtrC& aString) const =0; |
|
2318 |
||
2319 |
/** |
|
2320 |
* Returns the number of elements of the <a>List</a>. |
|
2321 |
*/ |
|
2322 |
virtual TInt GetItemCount() const =0; |
|
2323 |
||
2324 |
/** |
|
2325 |
* Returns the item height. |
|
2326 |
*/ |
|
2327 |
virtual TInt GetItemHeight() const =0; |
|
2328 |
||
2329 |
/** |
|
2330 |
* Returns the number of selected elements. |
|
2331 |
*/ |
|
2332 |
virtual TInt GetSelectionCount() const =0; |
|
2333 |
||
2334 |
/** |
|
2335 |
* Returns the index of the currently selected item. |
|
2336 |
*/ |
|
2337 |
virtual TInt GetSelectionIndex() const =0; |
|
2338 |
||
2339 |
/** |
|
2340 |
* Get the selected items indices. |
|
2341 |
*/ |
|
2342 |
virtual const CArrayFix<TInt>* GetSelectionIndices() const =0; |
|
2343 |
||
2344 |
/** |
|
2345 |
* Returns the index of the top element. |
|
2346 |
*/ |
|
2347 |
virtual TInt GetTopIndex() const =0; |
|
2348 |
||
2349 |
/** |
|
2350 |
* Searches for a text item from a given position. |
|
2351 |
* @param aString The string to search for. |
|
2352 |
* @param aStart The position from which we start. |
|
2353 |
*/ |
|
2354 |
virtual TInt IndexOf(const TDesC& aString, TInt& aStart) const =0; |
|
2355 |
||
2356 |
/** |
|
2357 |
* Returns if the specified item is selected. |
|
2358 |
* @param aIndex The specified item. |
|
2359 |
*/ |
|
2360 |
virtual TBool IsSelected(TInt aIndex) const =0; |
|
2361 |
||
2362 |
/** |
|
2363 |
* Removes the items defined in the aIndices array from the <a>List</a>. |
|
2364 |
* @param aIndices The array of the items to remove. |
|
2365 |
* @param aCount The number of items of this array. |
|
2366 |
*/ |
|
2367 |
virtual void RemoveItemsL(const TInt* aIndices, TInt aCount) =0; |
|
2368 |
||
2369 |
/** |
|
2370 |
* Removes the specified item from the <a>List</a>. |
|
2371 |
* @param aIndex The specified item. |
|
2372 |
*/ |
|
2373 |
virtual void RemoveItemL(TInt aIndex) =0; |
|
2374 |
||
2375 |
/** |
|
2376 |
* Removes a range of items from the <a>List</a>. |
|
2377 |
* @param aStart The first element to remove. |
|
2378 |
* @param aEnd The last element to remove. |
|
2379 |
*/ |
|
2380 |
virtual void RemoveRangeL(TInt aStart, TInt aEnd) =0; |
|
2381 |
||
2382 |
/** |
|
2383 |
* Removes all items from the <a>List</a>. |
|
2384 |
*/ |
|
2385 |
virtual void RemoveAllL() =0; |
|
2386 |
||
2387 |
/** |
|
2388 |
* Selects a single item. |
|
2389 |
* @param aIndex The item to select. |
|
2390 |
* @param aScroll Scrolls the list if true. |
|
2391 |
*/ |
|
2392 |
virtual void SelectItemL(TInt aIndex, TBool aScroll) =0; |
|
2393 |
||
2394 |
/** |
|
2395 |
* Selects a range of items. |
|
2396 |
* @param aStart The first item to select. |
|
2397 |
* @param aEnd The last item to select. |
|
2398 |
*/ |
|
2399 |
virtual void SelectRangeL(TInt aStart, TInt aEnd) =0; |
|
2400 |
||
2401 |
/** |
|
2402 |
* Selects all items. |
|
2403 |
*/ |
|
2404 |
virtual void SelectAllL() =0; |
|
2405 |
||
2406 |
/** |
|
2407 |
* Sets the current focused item. |
|
2408 |
* |
|
2409 |
* @param aIndex The item to focus on. |
|
2410 |
*/ |
|
2411 |
virtual void SetFocusIndex(TInt aIndex) =0; |
|
2412 |
||
2413 |
/** |
|
2414 |
* Sets the receiver's items to be the given array of items. |
|
2415 |
* @param aStringArray The array to set. |
|
2416 |
*/ |
|
2417 |
virtual void SetItemsL(MDesCArray* aStringArray) =0; |
|
2418 |
||
2419 |
/** |
|
2420 |
* Sets the top item index. |
|
2421 |
* @param aIndex The index to set as the top item. |
|
2422 |
*/ |
|
2423 |
virtual void SetTopIndex(TInt aIndex) =0; |
|
2424 |
||
2425 |
/** |
|
2426 |
* Shows the selection. |
|
2427 |
*/ |
|
2428 |
virtual void ShowSelection() =0; |
|
2429 |
}; |
|
2430 |
||
2431 |
||
2432 |
||
2433 |
/** |
|
2434 |
* Interface for class for the org.eclipse.swt.Text class. |
|
2435 |
* A class that implements MSwtText must also implement MSwtScrollable. |
|
2436 |
*/ |
|
2437 |
class MSwtText |
|
2438 |
{ |
|
2439 |
protected: |
|
2440 |
virtual ~MSwtText() {}; |
|
2441 |
||
2442 |
public: |
|
2443 |
enum {ETextLimit=KMaxTInt}; |
|
2444 |
||
2445 |
public: |
|
2446 |
virtual MSwtScrollable* Scrollable() =0; |
|
2447 |
||
2448 |
/** |
|
2449 |
* Gets the widget's text. |
|
2450 |
* @return The widget's text in a newly allocated buffer. The caller is |
|
2451 |
* responsible for deleting the returned buffer. NULL |
|
2452 |
* may be returned if the widget is empty. |
|
2453 |
*/ |
|
2454 |
virtual HBufC* GetTextL() const =0; |
|
2455 |
||
2456 |
/** |
|
2457 |
* Returns a range of the widget's text. |
|
2458 |
* If the specified values are out of range, as much text as possible is |
|
2459 |
* returned. However, aStart can never exceed aEnd. |
|
2460 |
* @param aStart The position of the first character in the range |
|
2461 |
* @param aEnd The position of the last character in the range |
|
2462 |
* @return The widget's text in a newly allocated buffer. The caller is |
|
2463 |
* responsible for deleting the returned buffer. NULL |
|
2464 |
* may be returned if the widget is empty. |
|
2465 |
*/ |
|
2466 |
virtual HBufC* GetTextRangeL(TInt aStart, TInt aEnd) const =0; |
|
2467 |
||
2468 |
/** |
|
2469 |
* Sets the text |
|
2470 |
* @param aText The new text. As a convenience, the descriptor can be freely |
|
2471 |
* modified by the implementation if need be. |
|
2472 |
* @return ETrue if a modify notification must be sent |
|
2473 |
*/ |
|
2474 |
virtual TBool SetTextL(TDes& aText) =0; |
|
2475 |
||
2476 |
/** |
|
2477 |
* Appends a string. |
|
2478 |
* @param aText The text to be appended. As a convenience, the descriptor |
|
2479 |
* can be freely modified by the implementation if need be. |
|
2480 |
* @return ETrue if a modify notification must be sent |
|
2481 |
*/ |
|
2482 |
virtual TBool AppendL(TDes& aText) =0; |
|
2483 |
||
2484 |
/** |
|
2485 |
* Inserts a string. |
|
2486 |
* The old selection is replaced with the new text. |
|
2487 |
* @param aText The text to be inserted. As a convenience, the descriptor |
|
2488 |
* can be freely modified by the implementation if need be. |
|
2489 |
* @return ETrue if a modify notification must be sent |
|
2490 |
*/ |
|
2491 |
virtual TBool InsertL(TDes& aText) =0; |
|
2492 |
||
2493 |
/** |
|
2494 |
* Gets the number of characters. |
|
2495 |
*/ |
|
2496 |
virtual TInt GetCharCount() const =0; |
|
2497 |
||
2498 |
/** |
|
2499 |
* Sets the maximum number of characters that the receiver is capable of holding. |
|
2500 |
* @return ETrue if a modify notification must be sent |
|
2501 |
*/ |
|
2502 |
virtual TBool SetTextLimitL(TInt aLimit) =0; |
|
2503 |
||
2504 |
/** |
|
2505 |
* Gets the line number of the caret. |
|
2506 |
*/ |
|
2507 |
virtual TInt GetCaretLineNumber() const =0; |
|
2508 |
||
2509 |
/** |
|
2510 |
* Gets the location of the caret. |
|
2511 |
* @return The caret's position in pixels, in client area coordinates. |
|
2512 |
*/ |
|
2513 |
virtual TPoint GetCaretLocationL() const =0; |
|
2514 |
||
2515 |
/** |
|
2516 |
* Gets the position of the caret. |
|
2517 |
* @return The caret's position in characters. |
|
2518 |
*/ |
|
2519 |
virtual TInt GetCaretPosition() const =0; |
|
2520 |
||
2521 |
/** |
|
2522 |
* Returns the selection range |
|
2523 |
* @return The selection in a TPoint where iX is |
|
2524 |
* the start and iY is the end. |
|
2525 |
*/ |
|
2526 |
virtual TPoint GetSelection() const =0; |
|
2527 |
||
2528 |
/** |
|
2529 |
* Returns the selected text. |
|
2530 |
* @return The selected text in a newly allocated buffer, may return |
|
2531 |
* NULL if no text is selected. |
|
2532 |
*/ |
|
2533 |
virtual HBufC* GetSelectionTextL() const =0; |
|
2534 |
||
2535 |
/** |
|
2536 |
* Sets the selection. |
|
2537 |
* Indexing is zero based. The range of a selection is from 0..N where N is |
|
2538 |
* the number of characters in the widget. If the specified range is invalid, |
|
2539 |
* as much of it as is possible must be set as the selection. |
|
2540 |
* The control is scrolled so as to make the new selection visible. |
|
2541 |
* @param aStart The selection's starting point. |
|
2542 |
* @param aEnd The selection's ending point. |
|
2543 |
*/ |
|
2544 |
virtual void SetSelectionL(TInt aStart, TInt aEnd) =0; |
|
2545 |
||
2546 |
/** |
|
2547 |
* Clears the selection. |
|
2548 |
*/ |
|
2549 |
virtual void ClearSelectionL() =0; |
|
2550 |
||
2551 |
/** |
|
2552 |
* Selects all the text in the widget. |
|
2553 |
*/ |
|
2554 |
virtual void SelectAllL() =0; |
|
2555 |
||
2556 |
/** |
|
2557 |
* Makes the selction visible |
|
2558 |
* The control is scrolled is need be such that the selection is visible. |
|
2559 |
*/ |
|
2560 |
virtual void ShowSelectionL() =0; |
|
2561 |
||
2562 |
/** |
|
2563 |
* Copies the selected text to the clipboard. |
|
2564 |
*/ |
|
2565 |
virtual void CopyL() =0; |
|
2566 |
||
2567 |
/** |
|
2568 |
* Pastes text from the clipboard. |
|
2569 |
* The selected text is deleted from the widget and new text inserted from |
|
2570 |
* the clipboard. |
|
2571 |
* @return ETrue if a modify notification must be sent |
|
2572 |
*/ |
|
2573 |
virtual TBool PasteL() =0; |
|
2574 |
||
2575 |
/** |
|
2576 |
* Gets the editable state. |
|
2577 |
*/ |
|
2578 |
virtual TBool GetEditable() const =0; |
|
2579 |
||
2580 |
/** |
|
2581 |
* Sets the editable state. |
|
2582 |
*/ |
|
2583 |
virtual void SetEditable(TBool aEditable) =0; |
|
2584 |
||
2585 |
/** |
|
2586 |
* Gets the number of lines. |
|
2587 |
*/ |
|
2588 |
virtual TInt GetLineCount() const =0; |
|
2589 |
||
2590 |
/** |
|
2591 |
* Gets the height of a line. |
|
2592 |
* @return The height of a line, in pixels. |
|
2593 |
*/ |
|
2594 |
virtual TInt GetLineHeightL() const =0; |
|
2595 |
||
2596 |
/** |
|
2597 |
* Returns the zero-relative index of the line which is currently |
|
2598 |
* at the top of the widget. |
|
2599 |
*/ |
|
2600 |
virtual TInt GetTopIndexL() const =0; |
|
2601 |
||
2602 |
/** |
|
2603 |
* Sets the zero-relative index of the line which is currently at the top. |
|
2604 |
*/ |
|
2605 |
virtual void SetTopIndexL(TInt aIndex) =0; |
|
2606 |
||
2607 |
/** |
|
2608 |
* Gets the top pixel. |
|
2609 |
* The top pixel is the pixel position of the line that is currently at the |
|
2610 |
* top of the widget. On some platforms, a text widget can be scrolled by |
|
2611 |
* pixels instead of lines so that a partial line is displayed at the top of the widget. |
|
2612 |
* The top pixel changes when the widget is scrolled. |
|
2613 |
* The top pixel does not include the widget trimming. |
|
2614 |
*/ |
|
2615 |
virtual TInt GetTopPixelL() const =0; |
|
2616 |
||
2617 |
/** |
|
2618 |
* Gets the echo character. |
|
2619 |
* The echo character is the character that is displayed when the user |
|
2620 |
* enters text or the text is changed by the programmer. |
|
2621 |
*/ |
|
2622 |
virtual TText GetEchoChar() const =0; |
|
2623 |
||
2624 |
/** |
|
2625 |
* Sets the echo character. |
|
2626 |
* The echo character is the character that is displayed when the user |
|
2627 |
* enters text or the text is changed by the programmer. Setting the echo |
|
2628 |
* character to 0 clears the echo character and redraws the original |
|
2629 |
* text. If for any reason the echo character is invalid, the default echo |
|
2630 |
* character for the platform is used. |
|
2631 |
*/ |
|
2632 |
virtual void SetEchoCharL(TText aEcho) =0; |
|
2633 |
||
2634 |
/** |
|
2635 |
* Sets the double click enabled flag. |
|
2636 |
* The double click flag enables or disables the default action of the text |
|
2637 |
* widget when the user double clicks. |
|
2638 |
*/ |
|
2639 |
virtual void SetDoubleClickEnabled(TBool aEnabled) =0; |
|
2640 |
||
2641 |
/** |
|
2642 |
* Returns the orientation of the receiver. |
|
2643 |
*/ |
|
2644 |
virtual TInt GetOrientation() const =0; |
|
2645 |
||
2646 |
/** |
|
2647 |
* Sets the orientation of the widget. |
|
2648 |
*/ |
|
2649 |
virtual void SetOrientationL(TInt aOrientation) =0; |
|
2650 |
}; |
|
2651 |
||
2652 |
/** |
|
2653 |
* Interface for class for the org.eclipse.swt.ProgressBar class. |
|
2654 |
*/ |
|
2655 |
class MSwtProgressBar |
|
2656 |
{ |
|
2657 |
protected: |
|
2658 |
virtual ~MSwtProgressBar() {}; |
|
2659 |
||
2660 |
public: |
|
2661 |
virtual MSwtControl* Control() = 0; |
|
2662 |
virtual TInt GetMaximum() const =0; |
|
2663 |
virtual TInt GetMinimum() const =0; |
|
2664 |
virtual TInt GetSelection() const =0; |
|
2665 |
virtual void SetMaximum(TInt aValue) =0; |
|
2666 |
virtual void SetMinimum(TInt aValue) =0; |
|
2667 |
virtual void SetSelection(TInt aValue) =0; |
|
2668 |
}; |
|
2669 |
||
2670 |
/** |
|
2671 |
* Interface for class for the org.eclipse.swt.Slider class. |
|
2672 |
*/ |
|
2673 |
class MSwtSlider |
|
2674 |
{ |
|
2675 |
protected: |
|
2676 |
virtual ~MSwtSlider() {}; |
|
2677 |
||
2678 |
public: |
|
2679 |
virtual MSwtControl* Control() = 0; |
|
2680 |
virtual TInt GetMaximum() const =0; |
|
2681 |
virtual TInt GetMinimum() const =0; |
|
2682 |
virtual TInt GetIncrement() const =0; |
|
2683 |
virtual TInt GetPageIncrement() const =0; |
|
2684 |
virtual TInt GetSelection() const =0; |
|
2685 |
virtual void SetMaximum(TInt aValue) =0; |
|
2686 |
virtual void SetMinimum(TInt aValue) =0; |
|
2687 |
virtual void SetIncrement(TInt aValue) =0; |
|
2688 |
virtual void SetPageIncrement(TInt aValue) =0; |
|
2689 |
virtual void SetSelection(TInt aValue) =0; |
|
2690 |
virtual void SetValues(TInt aSelection, TInt aMinimum, |
|
2691 |
TInt aMaximum, TInt aIncrement, TInt aPageIncrement) =0; |
|
2692 |
}; |
|
2693 |
||
2694 |
||
2695 |
/** |
|
2696 |
* Interface for class for the org.eclipse.swt.FileDialog class. |
|
2697 |
*/ |
|
2698 |
class MSwtFileDialog |
|
2699 |
{ |
|
2700 |
protected: |
|
2701 |
virtual ~MSwtFileDialog() {}; |
|
2702 |
||
2703 |
public: |
|
2704 |
/** |
|
2705 |
* Opens a File dialog, according to the style of the dialog. |
|
2706 |
* @return A buffer containing the path and filename of the selected file, |
|
2707 |
* or NULL if Cancel button is used to close the dialog. The user |
|
2708 |
* has to release this buffer. |
|
2709 |
*/ |
|
2710 |
virtual HBufC* OpenLD() =0; |
|
2711 |
}; |
|
2712 |
||
2713 |
||
2714 |
/** |
|
2715 |
* Interface for a utility class |
|
2716 |
* An instance (and only one) of the concrete class implementing this interface |
|
2717 |
* will be created by the Display when the UI thread is started. |
|
2718 |
* The instance will be destroyed when the UI thread is terminated. |
|
2719 |
*/ |
|
2720 |
class MSwtUiUtils : public MSwtAppFocusObserver |
|
2721 |
{ |
|
2722 |
public: |
|
2723 |
/** |
|
2724 |
* Destructor |
|
2725 |
*/ |
|
2726 |
virtual ~MSwtUiUtils() {}; |
|
2727 |
||
2728 |
/** |
|
2729 |
* Returns the matching standard color for the given constant. |
|
2730 |
* @param aId SWT color constant |
|
2731 |
* @return The Symbian OS' matching standard color. Any value other |
|
2732 |
* than one of the SWT color constants which is passed |
|
2733 |
* in will result in the color black. |
|
2734 |
*/ |
|
2735 |
virtual TRgb GetSystemColor(TSwtColorId aId) const =0; |
|
2736 |
||
2737 |
/** |
|
2738 |
* Returns the font spec of a reasonable font for applications to use. |
|
2739 |
*/ |
|
2740 |
virtual TFontSpec SystemFontSpec() const =0; |
|
2741 |
||
2742 |
/** |
|
2743 |
* Open a modal note |
|
2744 |
* @param aDisplay The Display the MessageBox belongs to |
|
2745 |
* @param aTitle Dialog's title. |
|
2746 |
* @param aMessage The message that will be displayed. |
|
2747 |
* @param aStyle MessageBox's style |
|
2748 |
* @return A button id. |
|
2749 |
*/ |
|
2750 |
virtual TInt RunMessageBoxDlgLD(MSwtDisplay& aDisplay, const TDesC& aTitle, |
|
2751 |
const TDesC& aMessage, TInt aStyle) const =0; |
|
2752 |
||
2753 |
/** |
|
2754 |
* Returns the active shell. |
|
2755 |
*/ |
|
2756 |
virtual MSwtShell* GetActiveShell() const =0; |
|
2757 |
||
2758 |
/** |
|
2759 |
* Returns the parent top level Shell of the active shell. |
|
2760 |
*/ |
|
2761 |
virtual MSwtShell* GetParentTopShellOfActiveShell() const =0; |
|
2762 |
||
2763 |
/** |
|
2764 |
* Get the top most top Shell, that is the only top Shell displayed. |
|
2765 |
*/ |
|
2766 |
virtual MSwtShell* TopMostTopShell() const = 0; |
|
2767 |
||
2768 |
/** |
|
2769 |
* Returns the peer of the active shell. |
|
2770 |
*/ |
|
2771 |
virtual TSwtPeer GetActiveShellPeer() const =0; |
|
2772 |
||
2773 |
/** |
|
2774 |
* Returns the existing shells. |
|
2775 |
*/ |
|
2776 |
virtual const RPointerArray<MSwtShell>& Shells() const =0; |
|
2777 |
||
2778 |
/** |
|
2779 |
* Returns peers of the existing shells |
|
2780 |
*/ |
|
2781 |
virtual CSwtPeerArray* GetShellPeersL() const =0; |
|
2782 |
||
2783 |
/** |
|
2784 |
* Returns the focussed control, or NULL. |
|
2785 |
*/ |
|
2786 |
virtual TSwtPeer GetFocusControl() const =0; |
|
2787 |
||
2788 |
/** |
|
2789 |
* Returns the Control's closest parent top level Shell |
|
2790 |
*/ |
|
2791 |
virtual MSwtShell& GetControlTopShell(const MSwtControl& aControl) const =0; |
|
2792 |
||
2793 |
/** |
|
2794 |
* Draw a rectangle which has the appearance of the platform's |
|
2795 |
* focus rectangle. |
|
2796 |
* If there is no such thing as a focus rectangle, this method must draw |
|
2797 |
* a rectangle with the GC's foreground colour. |
|
2798 |
* @param aGc The GC to draw the rectangle on |
|
2799 |
* @param aRect The rectangle to draw |
|
2800 |
*/ |
|
2801 |
virtual void DrawFocusRect(MSwtGc& aGc, const TRect& aRect) const =0; |
|
2802 |
||
2803 |
/** |
|
2804 |
* Returns the cba created by MSwtUiUtils |
|
2805 |
*/ |
|
2806 |
virtual CEikButtonGroupContainer& Cba() const =0; |
|
2807 |
||
2808 |
/** |
|
2809 |
* Recreate the status pane based on the current active shell if that shell |
|
2810 |
* is a top shell, or on the last active top shell. |
|
2811 |
*/ |
|
2812 |
virtual void UpdateStatusPaneL() =0; |
|
2813 |
||
2814 |
/** |
|
2815 |
* Get the state of the application focus. |
|
2816 |
*/ |
|
2817 |
virtual TBool IsAppFocused() const =0; |
|
2818 |
||
2819 |
/** |
|
2820 |
* Get localized string for the ok command title |
|
2821 |
*/ |
|
2822 |
virtual const HBufC* GetCommandOkTitleL() const =0; |
|
2823 |
||
2824 |
/** |
|
2825 |
* Get localized string for the cancel command title |
|
2826 |
*/ |
|
2827 |
virtual const HBufC* GetCommandCancelTitleL() const =0; |
|
2828 |
||
2829 |
/** |
|
2830 |
* Handles free ram memory event. |
|
2831 |
* @param aEventType The type of event. |
|
2832 |
*/ |
|
2833 |
virtual void HandleFreeRamEventL(TInt aEventType) = 0; |
|
2834 |
||
2835 |
/** |
|
2836 |
* Returns the mouse event state mask that can be passed to the eSWT application in MouseEvent. |
|
2837 |
* @param aPointerEventModifiers The modifiers of the corresponding symbian TPointerEvent. |
|
2838 |
* @return State mask that can be sent to the eSWT application in MouseEvent |
|
2839 |
*/ |
|
2840 |
virtual TInt GetPointerEventStateMask(TUint aPointerEventModifiers) const =0; |
|
2841 |
||
2842 |
/** |
|
2843 |
* Returns the eventual faded Shell. |
|
2844 |
*/ |
|
2845 |
virtual MSwtShell* FadingShell() const =0; |
|
2846 |
||
2847 |
/** |
|
2848 |
* Change the name of the Title in the Status Pane. |
|
2849 |
* @param The name for the eSwt display title in the Status Pane. |
|
2850 |
*/ |
|
2851 |
virtual void SetAppNameL(const TDesC* aAppName) = 0; |
|
2852 |
||
2853 |
/** |
|
2854 |
* Gets the image maximum size from the layouts. |
|
2855 |
* @param The type of the image passed to the layouts to get the size. |
|
2856 |
* Returns maximum size from the layouts |
|
2857 |
*/ |
|
2858 |
virtual TSize GetBestImageSize(TInt aImageType) = 0; |
|
2859 |
||
2860 |
/** |
|
2861 |
* Default padding reference for helping inline controls (Button, Label, |
|
2862 |
* Text, DateEditor) achieving similar ideal size, height especially. |
|
2863 |
* |
|
2864 |
*/ |
|
2865 |
virtual TMargins8 InlineReferencePadding() const = 0; |
|
2866 |
||
2867 |
/** |
|
2868 |
* Default font height reference for helping inline controls (Button, Label, |
|
2869 |
* Text, DateEditor) achieving similar ideal size, height especially. |
|
2870 |
* Does not mean that all these controls should have same font! |
|
2871 |
*/ |
|
2872 |
virtual TInt InlineReferenceFontHeight() const = 0; |
|
2873 |
||
2874 |
/** |
|
2875 |
* Update cached values, inform Shells. |
|
2876 |
*/ |
|
2877 |
virtual void HandleResourceChangedL(TInt aType) = 0; |
|
2878 |
||
2879 |
/** |
|
2880 |
* Get breadth of the scrollbar. The value is cached. |
|
2881 |
* If the scrollbar is null returns 0. |
|
2882 |
*/ |
|
2883 |
virtual TInt ScrollBarBreadth(const CEikScrollBar* aBar) = 0; |
|
2884 |
||
2885 |
/** |
|
2886 |
* Returns number of active browsers in applicaition. |
|
2887 |
*/ |
|
2888 |
virtual TInt ActiveBrowserCount() const = 0; |
|
2889 |
||
2890 |
/** |
|
2891 |
* Setter and getter for key input flag. |
|
2892 |
*/ |
|
2893 |
virtual TBool NaviKeyInput() const = 0; |
|
2894 |
virtual void SetNaviKeyInput(TBool aKeyInput) = 0; |
|
2895 |
||
2896 |
/** |
|
2897 |
* This should be always used to hide, show the CBA. |
|
2898 |
*/ |
|
2899 |
virtual void SetCbaVisible(TBool aVisible) = 0; |
|
2900 |
||
2901 |
/** |
|
2902 |
* Returns the pointer to the control that is currently receiving the pointer events |
|
2903 |
* because it has received EButton1Down event. This returns a valid control only between |
|
2904 |
* EButton1Down and EButton1Up events. |
|
2905 |
* @return Pointer to the control that is receiving the pointer events currently or NULL. |
|
2906 |
*/ |
|
2907 |
virtual MSwtControl* GetPointerGrabbingControl() = 0; |
|
2908 |
||
2909 |
/** |
|
2910 |
* Default bounds for TaskTips |
|
2911 |
*/ |
|
2912 |
virtual TRect TaskTipRect() const = 0; |
|
2913 |
||
2914 |
/** |
|
2915 |
* Sets the pointerGrabbingControl |
|
2916 |
* Calling with NULL of course unsets. |
|
2917 |
*/ |
|
2918 |
virtual void SetPointerCaptureControl(MSwtControl* aControl) = 0; |
|
2919 |
||
2920 |
/** |
|
2921 |
* Returns the current control that is grabbing the pointer events. |
|
2922 |
*/ |
|
2923 |
virtual MSwtControl* PointerCaptureControl() = 0; |
|
2924 |
||
2925 |
/** |
|
2926 |
* Rearranges the application layout (status pane, Shell position, split |
|
2927 |
* input view size) for best editing experience. There can be only one |
|
2928 |
* editor in split view mode at a time. Setting 0 clears the split view |
|
2929 |
* and restores the layout. |
|
2930 |
* |
|
2931 |
* Following actions must be delegated to UiUtils while split editing is on: |
|
2932 |
* - Relocating the split input Shell (@see SetSplitInputShellPos) |
|
2933 |
* - Resizing the split input view. (@see SetSplitInputViewSize) |
|
2934 |
* |
|
2935 |
* Following actions must be notified to UiUtils while split editing is on: |
|
2936 |
* - Resizing the split input shell. (@see AdjustSplitInputShellPos) |
|
2937 |
* - Relocating the split input view. (@see AdjustSplitInputShellPos) |
|
2938 |
*/ |
|
2939 |
virtual void SetSplitInputEditor(MSwtControl* aEditor) = 0; |
|
2940 |
||
2941 |
/** |
|
2942 |
* The currently active(focused) split input editor. |
|
2943 |
* Can be any Text, TextExtension, ConstrainedText or DateEditor. |
|
2944 |
*/ |
|
2945 |
virtual MSwtControl* SplitInputEditor() const = 0; |
|
2946 |
||
2947 |
/** |
|
2948 |
* The currently active split input editor or a parent ScrolledComposite. |
|
2949 |
* The view is getting resized automatically to fit in the available space |
|
2950 |
* above the VKB. |
|
2951 |
*/ |
|
2952 |
virtual MSwtControl* SplitInputView() const = 0; |
|
2953 |
||
2954 |
/** |
|
2955 |
* The parent shell of the active split input editor is temporarily |
|
2956 |
* moved vertically during split input editing therefore setting a new |
|
2957 |
* location must be diverted trough UiUtils. |
|
2958 |
* @param aOriginalPos - The real position of the Shell, which will be |
|
2959 |
* applied when VKB closes. |
|
2960 |
*/ |
|
2961 |
virtual void SetSplitInputShellPos(const TPoint& aOriginalPos) = 0; |
|
2962 |
||
2963 |
/** |
|
2964 |
* The active split input editor or its ScrolledComposite ancestor |
|
2965 |
* is temporarily resized vertically during split input editing |
|
2966 |
* therefore setting a new size must be diverted trough UiUtils. |
|
2967 |
* @param aOriginalSize - The real size of the control, which will be |
|
2968 |
* applied when VKB closes. |
|
2969 |
*/ |
|
2970 |
virtual void SetSplitInputViewSize(const TSize& aOriginalSize) = 0; |
|
2971 |
||
2972 |
/** |
|
2973 |
* The split input shell resized during split editing or |
|
2974 |
* the split input view relocated during split editing. |
|
2975 |
* The vertical position of the shell will be readjusted. |
|
2976 |
*/ |
|
2977 |
virtual void AdjustSplitInputShellPos() = 0; |
|
2978 |
||
2979 |
/** |
|
2980 |
* Fixes the UI orientation on screen. |
|
2981 |
* The orientation remains fixed until UnRegisterFixScreenOrientation() |
|
2982 |
* is called for so many times as this method was called. |
|
2983 |
*/ |
|
2984 |
virtual void RegisterFixScreenOrientation() = 0; |
|
2985 |
||
2986 |
/** |
|
2987 |
* Unregisters request to fix the UI orientation. |
|
2988 |
* Component which called RegisterFixScreenOrientation() |
|
2989 |
* must call this funtion when UI orientation fix is no more needed. |
|
2990 |
* The UI orientation remains fixed until this method is called |
|
2991 |
* so many times as registering methods was called. |
|
2992 |
*/ |
|
2993 |
virtual void UnRegisterFixScreenOrientation() = 0; |
|
2994 |
||
2995 |
/** |
|
2996 |
* Indicates that the UI orientation is fixed. |
|
2997 |
* This means that some components requested it calling |
|
2998 |
* RegisterFixScreenOrientation(). |
|
2999 |
* |
|
3000 |
* @return ETrue when the UI orientation is fixed. |
|
3001 |
*/ |
|
3002 |
virtual TBool IsScreenOrientationFixed() const = 0; |
|
3003 |
}; |
|
3004 |
||
3005 |
||
3006 |
/** |
|
3007 |
* Interface class for constructing native peers. |
|
3008 |
*/ |
|
3009 |
class MSwtFactory |
|
3010 |
{ |
|
3011 |
public: |
|
3012 |
/** |
|
3013 |
* Destructor. |
|
3014 |
*/ |
|
3015 |
virtual ~MSwtFactory() {}; |
|
3016 |
||
3017 |
/** |
|
3018 |
* Constructs a utility object |
|
3019 |
*/ |
|
3020 |
virtual MSwtUiUtils* NewUiUtilsL(MSwtDisplay& aDisplay) const =0; |
|
3021 |
||
3022 |
/** |
|
3023 |
* Constructs a Canvas |
|
3024 |
* @param aDisplay The Display this Canvas belongs to |
|
3025 |
* @param aPeer The Java object associated with this C++ object |
|
3026 |
* @param aParent The parent Composite |
|
3027 |
* @param aStyle The SWT style flags |
|
3028 |
*/ |
|
3029 |
virtual MSwtCanvas* NewCanvasL( |
|
3030 |
MSwtDisplay& aDisplay, |
|
3031 |
TSwtPeer aPeer, |
|
3032 |
MSwtComposite& aParent, |
|
3033 |
TInt aStyle) const =0; |
|
3034 |
||
3035 |
/** |
|
3036 |
* Constructs a Composite |
|
3037 |
* |
|
3038 |
* @param aDisplay The Display this Composite belongs to |
|
3039 |
* @param aPeer The Java object associated with this C++ object |
|
3040 |
* @param aParent The parent Composite |
|
3041 |
* @param aStyle The SWT style flags |
|
3042 |
*/ |
|
3043 |
virtual MSwtComposite* NewCompositeL( |
|
3044 |
MSwtDisplay& aDisplay, |
|
3045 |
TSwtPeer aPeer, |
|
3046 |
MSwtComposite& aParent, |
|
3047 |
TInt aStyle) const =0; |
|
3048 |
||
3049 |
/** |
|
3050 |
* Constructs a Decorations |
|
3051 |
* @param aDisplay The Display this Decorations belongs to |
|
3052 |
* @param aPeer The Java object associated with this C++ object |
|
3053 |
* @param aParent The parent Composite |
|
3054 |
* @param aStyle The SWT style flags |
|
3055 |
*/ |
|
3056 |
virtual MSwtDecorations* NewDecorationsL( |
|
3057 |
MSwtDisplay& aDisplay, |
|
3058 |
TSwtPeer aPeer, |
|
3059 |
MSwtComposite& aParent, |
|
3060 |
TInt aStyle) const =0; |
|
3061 |
||
3062 |
/** |
|
3063 |
* Constructs a Shell |
|
3064 |
* @param aDisplay The Display this Shell belongs to |
|
3065 |
* @param aPeer The Java object associated with this C++ object |
|
3066 |
* @param aParent The parent Composite, if NULL a top level |
|
3067 |
* Shell is to be created. |
|
3068 |
* @param aStyle The SWT style flags |
|
3069 |
*/ |
|
3070 |
virtual MSwtShell* NewShellL( |
|
3071 |
MSwtDisplay& aDisplay, |
|
3072 |
TSwtPeer aPeer, |
|
3073 |
MSwtShell* aParent, |
|
3074 |
TInt aStyle) const =0; |
|
3075 |
||
3076 |
virtual MSwtMenu* NewMenuL( |
|
3077 |
MSwtDisplay& aDisplay, |
|
3078 |
TSwtPeer aPeer, |
|
3079 |
TInt aStyle) const =0; |
|
3080 |
||
3081 |
virtual MSwtMenuItem* NewMenuItemL( |
|
3082 |
MSwtDisplay& aDisplay, |
|
3083 |
TSwtPeer aPeer, |
|
3084 |
MSwtMenu& aParent, |
|
3085 |
TInt aIndex, |
|
3086 |
TInt aStyle) const =0; |
|
3087 |
||
3088 |
virtual MSwtMenuArranger* NewMenuArrangerL( |
|
3089 |
MSwtDisplay& aDisplay) const =0; |
|
3090 |
||
3091 |
/** |
|
3092 |
* Constructs a Link |
|
3093 |
* @param aDisplay The Display this List belongs to |
|
3094 |
* @param aPeer The Java object associated with this C++ object |
|
3095 |
* @param aParent The parent Composite |
|
3096 |
* @param aStyle The SWT style flags |
|
3097 |
*/ |
|
3098 |
virtual MSwtLink* NewLinkL( |
|
3099 |
MSwtDisplay& aDisplay, |
|
3100 |
TSwtPeer aPeer, |
|
3101 |
MSwtComposite& aParent, |
|
3102 |
TInt aStyle) const =0; |
|
3103 |
||
3104 |
/** |
|
3105 |
* Constructs a List |
|
3106 |
* @param aDisplay The Display this List belongs to |
|
3107 |
* @param aPeer The Java object associated with this C++ object |
|
3108 |
* @param aParent The parent Composite |
|
3109 |
* @param aStyle The SWT style flags |
|
3110 |
*/ |
|
3111 |
virtual MSwtList* NewListL( |
|
3112 |
MSwtDisplay& aDisplay, |
|
3113 |
TSwtPeer aPeer, |
|
3114 |
MSwtComposite& aParent, |
|
3115 |
TInt aStyle) const =0; |
|
3116 |
||
3117 |
/** |
|
3118 |
* Constructs a Label |
|
3119 |
* @param aDisplay The Display this Label belongs to |
|
3120 |
* @param aPeer The Java object associated with this C++ object |
|
3121 |
* @param aParent The parent Composite |
|
3122 |
* @param aStyle The SWT style flags |
|
3123 |
*/ |
|
3124 |
virtual MSwtLabel* NewLabelL( |
|
3125 |
MSwtDisplay& aDisplay, |
|
3126 |
TSwtPeer aPeer, |
|
3127 |
MSwtComposite& aParent, |
|
3128 |
TInt aStyle) const =0; |
|
3129 |
||
3130 |
/** |
|
3131 |
* Constructs a Button |
|
3132 |
* @param aDisplay The Display this Button belongs to |
|
3133 |
* @param aPeer The Java object associated with this C++ object |
|
3134 |
* @param aParent The parent Composite |
|
3135 |
* @param aStyle The SWT style flags |
|
3136 |
*/ |
|
3137 |
virtual MSwtButton* NewButtonL( |
|
3138 |
MSwtDisplay& aDisplay, |
|
3139 |
TSwtPeer aPeer, |
|
3140 |
MSwtComposite& aParent, |
|
3141 |
TInt aStyle) const =0; |
|
3142 |
||
3143 |
/** |
|
3144 |
* Constructs a Text |
|
3145 |
* @param aDisplay The Display this Text belongs to |
|
3146 |
* @param aPeer The Java object associated with this C++ object |
|
3147 |
* @param aParent The parent Composite |
|
3148 |
* @param aStyle The SWT style flags |
|
3149 |
*/ |
|
3150 |
virtual MSwtText* NewTextL( |
|
3151 |
MSwtDisplay& aDisplay, |
|
3152 |
TSwtPeer aPeer, |
|
3153 |
MSwtComposite& aParent, |
|
3154 |
TInt aStyle) const =0; |
|
3155 |
||
3156 |
/** |
|
3157 |
* Constructs a ProgressBar |
|
3158 |
* @param aDisplay The Display this ProgressBar belongs to |
|
3159 |
* @param aPeer The Java object associated with this C++ object |
|
3160 |
* @param aParent The parent Composite |
|
3161 |
* @param aStyle The SWT style flags |
|
3162 |
*/ |
|
3163 |
virtual MSwtProgressBar* NewProgressBarL( |
|
3164 |
MSwtDisplay& aDisplay, |
|
3165 |
TSwtPeer aPeer, |
|
3166 |
MSwtComposite& aParent, |
|
3167 |
TInt aStyle) const =0; |
|
3168 |
||
3169 |
/** |
|
3170 |
* Constructs a Slider |
|
3171 |
* @param aDisplay The Display this Slider belongs to |
|
3172 |
* @param aPeer The Java object associated with this C++ object |
|
3173 |
* @param aParent The parent Composite |
|
3174 |
* @param aStyle The SWT style flags |
|
3175 |
*/ |
|
3176 |
virtual MSwtSlider* NewSliderL( |
|
3177 |
MSwtDisplay& aDisplay, |
|
3178 |
TSwtPeer aPeer, |
|
3179 |
MSwtComposite& aParent, |
|
3180 |
TInt aStyle) const =0; |
|
3181 |
||
3182 |
/** |
|
3183 |
* Constructs a Combo |
|
3184 |
* @param aDisplay The Display this Combo belongs to |
|
3185 |
* @param aPeer The Java object associated with this C++ object |
|
3186 |
* @param aParent The parent Composite |
|
3187 |
* @param aStyle The SWT style flags |
|
3188 |
*/ |
|
3189 |
virtual MSwtCombo* NewComboL( |
|
3190 |
MSwtDisplay& aDisplay, |
|
3191 |
TSwtPeer aPeer, |
|
3192 |
MSwtComposite& aParent, |
|
3193 |
TInt aStyle) const =0; |
|
3194 |
||
3195 |
/** |
|
3196 |
* Construct a File dialog. Custom title. |
|
3197 |
* @param aFileName Initial path and filename. A new buffer will be allocated. |
|
3198 |
* @param aTitle Title of the dialog. |
|
3199 |
* @param aStyle Style of the dialog: KSwtStyleOpen or KSwtStyleSave. |
|
3200 |
*/ |
|
3201 |
virtual MSwtFileDialog* NewFileDialogL(const TDesC& aFileName, |
|
3202 |
const TDesC& aTitle, TInt aStyle) const =0; |
|
3203 |
||
3204 |
virtual MSwtCommand* NewCommandL(MSwtDisplay& aDisplay, TSwtPeer aPeerRef, |
|
3205 |
MSwtControl& aParentControl, MSwtCommand* aParentCommand, TInt aType, |
|
3206 |
TInt aPriority) const =0; |
|
3207 |
virtual MSwtCommandArranger* NewCommandArrangerL(MSwtDisplay& aDisplay) const =0; |
|
3208 |
||
3209 |
/** |
|
3210 |
* Constructs a MobileShell |
|
3211 |
* @param aDisplay The Display this Shell belongs to |
|
3212 |
* @param aPeer The Java object associated with this C++ object |
|
3213 |
* @param aParent The parent Composite, if NULL |
|
3214 |
* a top level Shell is to be created. |
|
3215 |
* @param aStyle The SWT style flags |
|
3216 |
*/ |
|
3217 |
virtual MSwtMobileShell* NewMobileShellL(MSwtDisplay& aDisplay, |
|
3218 |
TSwtPeer aPeer, MSwtShell* aParent, TInt aStyle) const =0; |
|
3219 |
||
3220 |
/** |
|
3221 |
* Constructs a MobileDevice |
|
3222 |
* @param aDisplay The Display this Device belongs to |
|
3223 |
* @param aPeer The Java object associated with this C++ object |
|
3224 |
*/ |
|
3225 |
virtual MSwtMobileDevice* NewMobileDeviceL(MSwtDisplay& aDisplay, TSwtPeer aPeer) const =0; |
|
3226 |
||
3227 |
/** |
|
3228 |
* Constructs a Screen |
|
3229 |
* @param aPeer The Java object associated with this C++ object |
|
3230 |
* @param aInputId The identifier of the output. |
|
3231 |
*/ |
|
3232 |
virtual MSwtInput* NewInputL(TSwtPeer aPeer, TInt aInputId) const =0; |
|
3233 |
||
3234 |
/** |
|
3235 |
* Constructs a Screen |
|
3236 |
* |
|
3237 |
* @param aDisplay The Display this HyperLink belongs to. |
|
3238 |
* @param aPeer The Java object associated with this C++ object |
|
3239 |
* @param aScreenId Screen identifier. |
|
3240 |
*/ |
|
3241 |
virtual MSwtScreen* NewScreenL(MSwtDisplay& aDisplay, TSwtPeer aPeer, |
|
3242 |
TInt aScreenId) const =0; |
|
3243 |
||
3244 |
/** |
|
3245 |
* Constructs a multi page pages. |
|
3246 |
* @param aDisplay The Display this MultiPageDialog belongs to. |
|
3247 |
* @param aPeer The Java object associated with this C++ object |
|
3248 |
* @param aParent The parent of this control ( it must be a shell ) |
|
3249 |
*/ |
|
3250 |
virtual MSwtMultiPagePager* NewMultiPagePagerL(MSwtDisplay& aDisplay, |
|
3251 |
TSwtPeer aPeer, MSwtShell& aParent) const =0; |
|
3252 |
||
3253 |
/** |
|
3254 |
* Constructs a multi page tab group. This is a control for implementing page tabs |
|
3255 |
* @param aDisplay The Display this MultiPageDialog belongs to. |
|
3256 |
* @param aPeer The Java object associated with this C++ object |
|
3257 |
* @param aParent The parent of this control ( it must be a shell ) |
|
3258 |
*/ |
|
3259 |
virtual MSwtMultiPageTabGroup* NewMultiPageTabGroupL(MSwtDisplay& aDisplay, |
|
3260 |
TSwtPeer aPeer, MSwtShell& aParent) const = 0; |
|
3261 |
||
3262 |
/** |
|
3263 |
* Constructs a multi page dialog. This is a control for implementing page tabs |
|
3264 |
* |
|
3265 |
* @param aDisplay The Display this MultiPageDialog belongs to. |
|
3266 |
* @param aPeer The Java object associated with this C++ object |
|
3267 |
* @param aParent The parent of this control ( it must be a shell ) |
|
3268 |
*/ |
|
3269 |
virtual MSwtMultiPageDialog* NewMultiPageDialogL(MSwtDisplay& aDisplay, |
|
3270 |
TSwtPeer aPeer, MSwtShell& aParent) const = 0; |
|
3271 |
||
3272 |
/** |
|
3273 |
* Constructs a CaptionedControl |
|
3274 |
* @param aDisplay The Display this CaptionedControl belongs to. |
|
3275 |
* @param aPeer The Java object associated with this C++ object |
|
3276 |
* @param aParent The parent Composite |
|
3277 |
* @param aStyle The SWT style flags |
|
3278 |
*/ |
|
3279 |
virtual MSwtCaptionedControl* NewCaptionedControlL(MSwtDisplay& aDisplay, |
|
3280 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3281 |
||
3282 |
/** |
|
3283 |
* Constructs a ConstrainedText |
|
3284 |
* @param aDisplay The Display this CaptionedControl belongs to. |
|
3285 |
* @param aPeer The Java object associated with this C++ object |
|
3286 |
* @param aParent The parent Composite |
|
3287 |
* @param aStyle The SWT style flags |
|
3288 |
*/ |
|
3289 |
virtual MSwtConstrainedText* NewConstrainedTextL(MSwtDisplay& aDisplay, |
|
3290 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3291 |
||
3292 |
/** |
|
3293 |
* Constructs a DateEditor |
|
3294 |
* @param aDisplay The Display this DateEditor belongs to. |
|
3295 |
* @param aPeer The Java object associated with this C++ object |
|
3296 |
* @param aParent The parent Composite |
|
3297 |
* @param aStyle The SWT style flags |
|
3298 |
*/ |
|
3299 |
virtual MSwtDateEditor* NewDateEditorL(MSwtDisplay& aDisplay, |
|
3300 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3301 |
||
3302 |
/** |
|
3303 |
* Constructs a HyperLink |
|
3304 |
* @param aDisplay The Display this HyperLink belongs to. |
|
3305 |
* @param aPeer The Java object associated with this C++ object |
|
3306 |
* @param aParent The parent Composite |
|
3307 |
* @param aStyle The SWT style flags |
|
3308 |
*/ |
|
3309 |
virtual MSwtHyperLink* NewHyperLinkL(MSwtDisplay& aDisplay, |
|
3310 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3311 |
||
3312 |
/** |
|
3313 |
* Constructs a ListBox |
|
3314 |
* @param aDisplay The Display this ListBox belongs to. |
|
3315 |
* @param aPeer The Java object associated with this C++ object |
|
3316 |
* @param aParent The parent Composite |
|
3317 |
* @param aStyle The SWT style flags |
|
3318 |
*/ |
|
3319 |
virtual MSwtListBox* NewListBoxL(MSwtDisplay& aDisplay, |
|
3320 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3321 |
||
3322 |
/** |
|
3323 |
* Constructs a ListView |
|
3324 |
* @param aDisplay The Display this ListView belongs to. |
|
3325 |
* @param aPeer The Java object associated with this C++ object |
|
3326 |
* @param aParent The parent Composite |
|
3327 |
* @param aStyle The SWT style flags |
|
3328 |
*/ |
|
3329 |
virtual MSwtListView* NewListViewL(MSwtDisplay& aDisplay, |
|
3330 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3331 |
||
3332 |
/** |
|
3333 |
* Constructs a SortedList |
|
3334 |
* @param aDisplay The Display this ListBox belongs to. |
|
3335 |
* @param aPeer The Java object associated with this C++ object |
|
3336 |
* @param aParent The parent Composite |
|
3337 |
* @param aStyle The SWT style flags |
|
3338 |
*/ |
|
3339 |
virtual MSwtSortedList* NewSortedListL(MSwtDisplay& aDisplay, |
|
3340 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3341 |
||
3342 |
/** |
|
3343 |
* Constructs a TextExtension |
|
3344 |
* @param aDisplay The Display this TextExtension belongs to. |
|
3345 |
* @param aPeer The Java object associated with this C++ object |
|
3346 |
* @param aParent The parent Composite |
|
3347 |
* @param aStyle The SWT style flags |
|
3348 |
*/ |
|
3349 |
virtual MSwtTextExtension* NewTextExtensionL(MSwtDisplay& aDisplay, |
|
3350 |
TSwtPeer aPeer, MSwtComposite& aParent, TInt aStyle) const =0; |
|
3351 |
||
3352 |
/** |
|
3353 |
* Constructs a TimedMessageBox |
|
3354 |
* @param aTitle The string to display as the receiver's title |
|
3355 |
* @param aMessage The description of the purpose for which the dialog was opened |
|
3356 |
* @param aStyle The SWT style flags |
|
3357 |
* @param aImage The image to display in the message box |
|
3358 |
*/ |
|
3359 |
virtual void RunTimedMessageBoxDlgLD(const TDesC& aTitle, |
|
3360 |
const TDesC& aMessage, TInt aStyle, const MSwtImage* aImage) const=0; |
|
3361 |
||
3362 |
/** |
|
3363 |
* Constructs a QueryDialog |
|
3364 |
* @param aTitle The dialog title |
|
3365 |
* @param aStyle The SWT style flags |
|
3366 |
* @param aQueryType The query style flags |
|
3367 |
* @param aPromptText The prompt text |
|
3368 |
* @param aDefaultValue The default value string |
|
3369 |
* @param aMinimum The minimum of allowed characters |
|
3370 |
* @param aMaximum The maximum of allowed characters |
|
3371 |
* @return The string input result |
|
3372 |
*/ |
|
3373 |
virtual HBufC* RunQueryDialogL(const TDesC& aTitle, TInt aStyle, |
|
3374 |
TInt aQueryType, const TDesC& aPromptText, const TDesC& aDefaultValue, |
|
3375 |
TInt aMinimum, TInt aMaximum) const=0; |
|
3376 |
||
3377 |
/** |
|
3378 |
* Calls ConvertDefaultValueL of QueryDialog |
|
3379 |
* @param aString The string to check the format |
|
3380 |
* @param aQueryType The query style flags |
|
3381 |
* @return True if the string is valid |
|
3382 |
*/ |
|
3383 |
virtual HBufC* RunQueryDialogConvertDefaultValueL(const TDesC& aString, |
|
3384 |
TInt aQueryType) const=0; |
|
3385 |
||
3386 |
/** |
|
3387 |
* Construct a Clipboard |
|
3388 |
* @param aPeer The Java object associated with this C++ object |
|
3389 |
*/ |
|
3390 |
virtual MSwtClipboard* NewClipboardL(TSwtPeer aPeer) const =0; |
|
3391 |
||
3392 |
/** |
|
3393 |
* Construct a TableColumn |
|
3394 |
* @param aPeer The Java object associated with this C++ object |
|
3395 |
* @param aParent The parent Table |
|
3396 |
* @param aStyle The SWT style flags |
|
3397 |
* @param aColumnIndex The index where to insert the column |
|
3398 |
*/ |
|
3399 |
virtual MSwtTableColumn* NewTableColumnL( |
|
3400 |
TSwtPeer aPeer, |
|
3401 |
MSwtTable& aParent, |
|
3402 |
TInt aStyle, |
|
3403 |
TInt aColumnIndex) const =0; |
|
3404 |
||
3405 |
/** |
|
3406 |
* Construct a TableItem |
|
3407 |
* @param aDisplay The Display this TableItem belongs to |
|
3408 |
* @param aPeer The Java object associated with this C++ object |
|
3409 |
* @param aParent The parent Table |
|
3410 |
* @param aRowIndex The index where to insert the row inside the Table |
|
3411 |
*/ |
|
3412 |
virtual MSwtTableItem* NewTableItemL( |
|
3413 |
MSwtDisplay& aDisplay, |
|
3414 |
TSwtPeer aPeer, |
|
3415 |
MSwtTable& aParent, |
|
3416 |
TInt aRowIndex) const =0; |
|
3417 |
||
3418 |
/** |
|
3419 |
* Constructs a Table |
|
3420 |
* @param aDisplay The Display this Table belongs to. |
|
3421 |
* @param aPeer The Java object associated with this C++ object |
|
3422 |
* @param aParent The parent Composite |
|
3423 |
* @param aStyle The SWT style flags |
|
3424 |
*/ |
|
3425 |
virtual MSwtTable* NewTableL( |
|
3426 |
MSwtDisplay& aDisplay, |
|
3427 |
TSwtPeer aPeer, |
|
3428 |
MSwtComposite& aParent, |
|
3429 |
TInt aStyle) const =0; |
|
3430 |
||
3431 |
/** |
|
3432 |
* Constructs a Tree |
|
3433 |
* @param aDisplay The Display this Tree belongs to. |
|
3434 |
* @param aPeer The Java object associated with this C++ object |
|
3435 |
* @param aParent The parent Composite |
|
3436 |
* @param aStyle The SWT style flags |
|
3437 |
*/ |
|
3438 |
virtual MSwtTree* NewTreeL( |
|
3439 |
MSwtDisplay& aDisplay, |
|
3440 |
TSwtPeer aPeer, |
|
3441 |
MSwtComposite& aParent, |
|
3442 |
TInt aStyle) const =0; |
|
3443 |
||
3444 |
/** |
|
3445 |
* Constructs a QueryDialog |
|
3446 |
* @param aDefaultColor The default selected color. |
|
3447 |
* @return The color input result, null if the user doesn't select a color |
|
3448 |
* (Exit from the dialog with the CANCEL button). |
|
3449 |
* This object must be deleted by the caller. |
|
3450 |
*/ |
|
3451 |
virtual TRgb* RunColorDialogL(TRgb* aDefaultColor) const=0; |
|
3452 |
||
3453 |
/** |
|
3454 |
* Constructs a DirectoryDialog |
|
3455 |
*/ |
|
3456 |
virtual MSwtDirectoryDialog* NewDirectoryDialogL(const TDesC& aFilterPath, |
|
3457 |
const TDesC& aTitle) const =0; |
|
3458 |
||
3459 |
/** |
|
3460 |
* Consturct a browser object |
|
3461 |
* @param aDisplay The Display the browser belongs to. |
|
3462 |
* @param aPeer The Java object associated with this C++ object |
|
3463 |
* @param aParent he parent composite |
|
3464 |
* @param aStyle The SWT style flags |
|
3465 |
*/ |
|
3466 |
virtual MSwtBrowser* NewBrowserL(MSwtDisplay& aDisplay, TSwtPeer aPeer |
|
3467 |
, MSwtComposite& aParent, TInt aStyle) const = 0; |
|
3468 |
||
3469 |
/** |
|
3470 |
* Constructs a Color |
|
3471 |
* @param aDevice The device this colour is represented on. |
|
3472 |
* @param aRgb A RGB triplet of the colour to represent. |
|
3473 |
*/ |
|
3474 |
virtual MSwtColor* NewColorL(const MSwtDevice& aDevice, const TRgb& aRgb) const =0; |
|
3475 |
||
3476 |
/** |
|
3477 |
* Constructs a GC suitable for the font & bitmap server's devices. |
|
3478 |
* @param aDrawable The drawable that created aGc. |
|
3479 |
* @param aGc The native GC to use, ownership is transferred. |
|
3480 |
* @param aDestructor The function that will take care of destroying iGc. |
|
3481 |
* @param aPenCol The pen's colour. |
|
3482 |
* @param aBrushCol The brush's colour. |
|
3483 |
* @param aFont The font to use |
|
3484 |
*/ |
|
3485 |
virtual MSwtGc* NewBitmapGcL(MSwtBitmapDrawable& aDrawable, CFbsBitGc* aGc, |
|
3486 |
MSwtGc::TDestructor aDestructor, const TRgb& aPenCol, const TRgb& aBrushCol, |
|
3487 |
const MSwtFont& aFont) const =0; |
|
3488 |
||
3489 |
/** |
|
3490 |
* Constructs a GC suitable for the window server's devices. |
|
3491 |
* @param aDrawable The drawable that created aGc. |
|
3492 |
* @param aGc The native GC to use, ownership is transferred. |
|
3493 |
* @param aDestructor The function that will take care of destroying iGc. |
|
3494 |
* @param aPenCol The pen's colour. |
|
3495 |
* @param aBrushCol The brush's colour. |
|
3496 |
* @param aFont The font to use |
|
3497 |
* @param aBoundaryRect The rectangle drawing is restricted to, in GC coordinates. |
|
3498 |
* @param aGcScreenRect The GC's rectangle in screen coordinates |
|
3499 |
*/ |
|
3500 |
virtual MSwtGc* NewWindowGcL(MSwtWindowDrawable& aDrawable, CWindowGc* aGc, |
|
3501 |
MSwtGc::TDestructor aDestructor, const TRgb& aPenCol, const TRgb& aBrushCol, |
|
3502 |
const MSwtFont& aFont,const TRect& aBoundaryRect, const TRect& aGcScreenRect) const =0; |
|
3503 |
||
3504 |
/** |
|
3505 |
* Constructs a Font |
|
3506 |
* @param aDevice The device this font is represented on. |
|
3507 |
* @param aTypefaceName The name of the typeface (i.e. Courrier for example). |
|
3508 |
* @param aHeight The height of the font. |
|
3509 |
* @param aStyle The style of the font. |
|
3510 |
*/ |
|
3511 |
virtual MSwtFont* NewFontL(const MSwtDevice& aDevice, |
|
3512 |
const TDesC& aTypefaceName, TInt aHeight, TInt aStyle) const =0; |
|
3513 |
}; |
|
3514 |
||
3515 |
||
3516 |
#endif // ESWTWIDGETSCORE_H |