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