javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswtwidgetscore.h
branchRCL_3
changeset 60 6c158198356e
parent 34 71c436fe3ce0
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    59 class MSwtTable;
    59 class MSwtTable;
    60 class MSwtTree;
    60 class MSwtTree;
    61 class MSwtFontDialog;
    61 class MSwtFontDialog;
    62 class MSwtDirectoryDialog;
    62 class MSwtDirectoryDialog;
    63 class MSwtHyperLink;
    63 class MSwtHyperLink;
       
    64 class MSwtScrollable;
    64 
    65 
    65 static const TInt KSwtCommandBaseId = 0x1000;
    66 static const TInt KSwtCommandBaseId = 0x1000;
    66 
    67 
    67 
    68 
    68 /**
    69 /**
   212         // Button use case, the Control's focus background is owned by Avkon
   213         // Button use case, the Control's focus background is owned by Avkon
   213         EEmbeddedFocusBackground,
   214         EEmbeddedFocusBackground,
   214 
   215 
   215         // Captioned Controls use case, default focus background policy
   216         // Captioned Controls use case, default focus background policy
   216         // applies to itself and children
   217         // applies to itself and children
   217         ECaptionedCtrlFocusBackground
   218         ECaptionedCtrlFocusBackground,
       
   219 
       
   220         // This policy is similar to EEmbeddedFocusBackground.
       
   221         // Its use case is for lists, listviews, tables, trees and listboxes.
       
   222         // They don't have focus background at all even when placed
       
   223         // to captioned control (only captioned control has highlight)
       
   224         ENoFocusBackgroundInCaptionedControl
       
   225     };
       
   226 
       
   227     enum TPressBackgroundPolicy
       
   228     {
       
   229         // No need for pressed highlight.
       
   230         ENoPressBackground = 0,
       
   231 
       
   232         // Highlight is applied whenever the control is pressed.
       
   233         EPressBackground = 1,
       
   234 
       
   235         // The control has it's own pressed highlight.
       
   236         EEmbeddedPressBackground = 2
   218     };
   237     };
   219 
   238 
   220 public:
   239 public:
   221     /**
   240     /**
   222      * Disposes of (i.e. destroys) the control
   241      * Disposes of (i.e. destroys) the control
   324      * See TFocusBackgroundPolicy.
   343      * See TFocusBackgroundPolicy.
   325      */
   344      */
   326     virtual TInt FocusBackgroundPolicy() const =0;
   345     virtual TInt FocusBackgroundPolicy() const =0;
   327 
   346 
   328     /**
   347     /**
       
   348      * Returns the policy of the pressed background.
       
   349      * See TPressBackgroundPolicy.
       
   350      */
       
   351     virtual TInt PressBackgroundPolicy() const =0;
       
   352 
       
   353     /**
   329      * Returns true if the control is selectable by the user and is not dimmed
   354      * Returns true if the control is selectable by the user and is not dimmed
   330      */
   355      */
   331     virtual TBool GetEnabled() const =0;
   356     virtual TBool GetEnabled() const =0;
   332 
   357 
   333     /**
   358     /**
   451     virtual MSwtShell& GetTopShell() const =0;
   476     virtual MSwtShell& GetTopShell() const =0;
   452 
   477 
   453     /**
   478     /**
   454      * Get the top CaptionedControl of the Control, if any
   479      * Get the top CaptionedControl of the Control, if any
   455      */
   480      */
   456     virtual MSwtCaptionedControl* GetTopCaptionedControl() const =0;
   481     virtual MSwtCaptionedControl* GetNearestCaptionedControl(TBool aIncludeSelf = ETrue) const =0;
   457 
   482 
   458     /**
   483     /**
   459      * Gets the control's width and height;
   484      * Gets the control's width and height;
   460      */
   485      */
   461     virtual TSize GetWidgetSize() const =0;
   486     virtual TSize GetWidgetSize() const =0;
   589      */
   614      */
   590     virtual MSwtShell* ShellInterface()
   615     virtual MSwtShell* ShellInterface()
   591     {
   616     {
   592         return NULL;
   617         return NULL;
   593     }
   618     }
       
   619 
   594     virtual const MSwtShell* ShellInterface() const
   620     virtual const MSwtShell* ShellInterface() const
   595     {
   621     {
   596         return NULL;
   622         return NULL;
   597     }
   623     }
   598 
   624 
   770      * Enables or disables focus highlight for controls
   796      * Enables or disables focus highlight for controls
   771      * Used only for list controls (Lists, ListView, ListBox and Table)
   797      * Used only for list controls (Lists, ListView, ListBox and Table)
   772      * Only for 9.2
   798      * Only for 9.2
   773      */
   799      */
   774     virtual void EnableFocusHighlight(TBool aEnable) = 0;
   800     virtual void EnableFocusHighlight(TBool aEnable) = 0;
   775     
   801 
   776     /**
   802     /**
   777      * Get the visible rectangle of this control.
   803      * Get the visible rectangle of this control.
   778      * Window coordinates.
   804      * Window coordinates.
   779      * The clipping take in account the parent, but not the brother.
   805      * The clipping take in account the parent, but not the brother.
   780      * To take in account the sibblings use VisibleRegion() method.
   806      * To take in account the sibblings use VisibleRegion() method.
   781      * @param aVisibleBounds If true return the visible rectangle of the control,
   807      * @param aVisibleBounds If true return the visible rectangle of the control,
   782      *        else return visible client rectangle of the control.
   808      *        else return visible client rectangle of the control.
   783      */
   809      */
   784     virtual TRect VisibleRect(TBool aVisibleBounds = EFalse) const = 0;
   810     virtual TRect VisibleRect(TBool aVisibleBounds = EFalse) const = 0;
       
   811 
       
   812     /**
       
   813      * Get the scrollable interface of control.
       
   814      * If control is not scrollable method returns null
       
   815      */
       
   816     virtual MSwtScrollable* ScrollableInterface() const
       
   817     {
       
   818         return NULL;
       
   819     }
       
   820 
       
   821     /**
       
   822      * True if the control owns a focus / pressed highlighted background.
       
   823      * @param aIncludingParents - if true, the parent tree is checked also.
       
   824      */
       
   825     virtual TBool HasHighlight(TBool aIncludingParents = ETrue) const = 0;
       
   826 
       
   827     /**
       
   828      * Instructs the control to create and display a highlighted background.
       
   829      * This is *not* supposed to repaint!
       
   830      */
       
   831     virtual void SetHighlight(TBool aEnabled) = 0;
       
   832 
       
   833     /**
       
   834      * React to highlight changes in itself or in the parent tree.
       
   835      * This is *not* supposed to repaint!
       
   836      */
       
   837     virtual void HandleHighlightChange() = 0;
       
   838 
       
   839     /**
       
   840      * True if pressed by pointer.
       
   841      */
       
   842     virtual TInt Pressed() const = 0;
       
   843 
       
   844     /**
       
   845      * Get ready for traverse event
       
   846      */
       
   847     virtual void PrepareForTraverse() = 0;
   785 };
   848 };
   786 
   849 
   787 
   850 
   788 /**
   851 /**
   789  * Interface class for the org.eclipse.swt.widgets.Scrollable class
   852  * Interface class for the org.eclipse.swt.widgets.Scrollable class
  1360      * Set the pointer to the child which should be added to Control Stack.
  1423      * Set the pointer to the child which should be added to Control Stack.
  1361      */
  1424      */
  1362     virtual void SetControlGoingToStack(MSwtControl* aControl) =0;
  1425     virtual void SetControlGoingToStack(MSwtControl* aControl) =0;
  1363 
  1426 
  1364     /**
  1427     /**
  1365      * Return the pointer  to the child which should be added to Control Stack.
       
  1366      */
       
  1367     virtual MSwtControl* ControlGoingToStack() const =0;
       
  1368 
       
  1369     /**
       
  1370      * Set the pointer to the child which gains the focus.
  1428      * Set the pointer to the child which gains the focus.
  1371      */
  1429      */
  1372     virtual void SetControlGainingFocus(MSwtControl* aControl) =0;
  1430     virtual void SetControlGainingFocus(MSwtControl* aControl) =0;
  1373 
       
  1374     /**
       
  1375      * Return the pointer to the child which gains the focus.
       
  1376      */
       
  1377     virtual MSwtControl* ControlGainingFocus() const =0;
       
  1378 
  1431 
  1379     /**
  1432     /**
  1380      * Get the current status pane style.
  1433      * Get the current status pane style.
  1381      */
  1434      */
  1382     virtual TSwtStatusPaneStyle StatusPaneStyle() const = 0;
  1435     virtual TSwtStatusPaneStyle StatusPaneStyle() const = 0;
  1423     /**
  1476     /**
  1424      * Set task tip style.
  1477      * Set task tip style.
  1425      */
  1478      */
  1426     virtual void SetTaskTip() = 0;
  1479     virtual void SetTaskTip() = 0;
  1427     virtual TBool IsTaskTip() const = 0;
  1480     virtual TBool IsTaskTip() const = 0;
  1428     
  1481 
  1429     /**
  1482     /**
  1430      * Sets the location even if top shell.
  1483      * Sets the location even if top shell.
  1431      */
  1484      */
  1432     virtual void DoSetLocation(const TPoint& aPoint) = 0;
  1485     virtual void DoSetLocation(const TPoint& aPoint) = 0;
       
  1486 
       
  1487     /**
       
  1488      * To be called whenever focus changes or controls get pressed.
       
  1489      * @param aDrawNow - immediate or deferred repaint.
       
  1490      *      For focus changes deferred repaint is preferred.
       
  1491      *      For pressed state changes immediate repaint is preferred.
       
  1492      */
       
  1493     virtual void UpdateHighlight(TBool aDrawNow = EFalse) = 0;
       
  1494 
       
  1495     /**
       
  1496      * Remove any references to the disposing control.
       
  1497      */
       
  1498     virtual void ControlDisposing(const MSwtControl& aControl) = 0;
  1433 };
  1499 };
  1434 
  1500 
  1435 /**
  1501 /**
  1436  * Structure containing the data needed for the
  1502  * Structure containing the data needed for the
  1437  * org.eclipse.swt.core.Item class.
  1503  * org.eclipse.swt.core.Item class.
  2858 
  2924 
  2859     /**
  2925     /**
  2860      * Returns the current control that is grabbing the pointer events.
  2926      * Returns the current control that is grabbing the pointer events.
  2861      */
  2927      */
  2862     virtual MSwtControl* PointerCaptureControl() = 0;
  2928     virtual MSwtControl* PointerCaptureControl() = 0;
  2863     
  2929 
  2864     /**
  2930     /**
  2865      * Rearranges the application layout (status pane, Shell position, split 
  2931      * Rearranges the application layout (status pane, Shell position, split
  2866      * input view size) for best editing experience. There can be only one 
  2932      * input view size) for best editing experience. There can be only one
  2867      * editor in split view mode at a time. Setting 0 clears the split view 
  2933      * editor in split view mode at a time. Setting 0 clears the split view
  2868      * and restores the layout.
  2934      * and restores the layout.
  2869      * 
  2935      *
  2870      * Following actions must be delegated to UiUtils while split editing is on:
  2936      * Following actions must be delegated to UiUtils while split editing is on:
  2871      * - Relocating the split input Shell (@see SetSplitInputShellPos)
  2937      * - Relocating the split input Shell (@see SetSplitInputShellPos)
  2872      * - Resizing the split input view. (@see SetSplitInputViewSize)
  2938      * - Resizing the split input view. (@see SetSplitInputViewSize)
  2873      * 
  2939      *
  2874      * Following actions must be notified to UiUtils while split editing is on:
  2940      * Following actions must be notified to UiUtils while split editing is on:
  2875      * - Resizing the split input shell. (@see AdjustSplitInputShellPos)
  2941      * - Resizing the split input shell. (@see AdjustSplitInputShellPos)
  2876      * - Relocating the split input view. (@see AdjustSplitInputShellPos)
  2942      * - Relocating the split input view. (@see AdjustSplitInputShellPos)
  2877      */
  2943      */
  2878     virtual void SetSplitInputEditor(MSwtControl* aEditor) = 0;
  2944     virtual void SetSplitInputEditor(MSwtControl* aEditor) = 0;
  2879     
  2945 
  2880     /**
  2946     /**
  2881      * The currently active(focused) split input editor.
  2947      * The currently active(focused) split input editor.
  2882      * Can be any Text, TextExtension, ConstrainedText or DateEditor.
  2948      * Can be any Text, TextExtension, ConstrainedText or DateEditor.
  2883      */
  2949      */
  2884     virtual MSwtControl* SplitInputEditor() const = 0;
  2950     virtual MSwtControl* SplitInputEditor() const = 0;
  2885     
  2951 
  2886     /**
  2952     /**
  2887      * The currently active split input editor or a parent ScrolledComposite.
  2953      * The currently active split input editor or a parent ScrolledComposite.
  2888      * The view is getting resized automatically to fit in the available space
  2954      * The view is getting resized automatically to fit in the available space
  2889      * above the VKB.
  2955      * above the VKB.
  2890      */
  2956      */
  2891     virtual MSwtControl* SplitInputView() const = 0;
  2957     virtual MSwtControl* SplitInputView() const = 0;
  2892     
  2958 
  2893     /**
  2959     /**
  2894      * The parent shell of the active split input editor is temporarily
  2960      * The parent shell of the active split input editor is temporarily
  2895      * moved vertically during split input editing therefore setting a new
  2961      * moved vertically during split input editing therefore setting a new
  2896      * location must be diverted trough UiUtils.
  2962      * location must be diverted trough UiUtils.
  2897      * @param aOriginalPos - The real position of the Shell, which will be 
  2963      * @param aOriginalPos - The real position of the Shell, which will be
  2898      *                       applied when VKB closes.
  2964      *                       applied when VKB closes.
  2899      */
  2965      */
  2900     virtual void SetSplitInputShellPos(const TPoint& aOriginalPos) = 0;
  2966     virtual void SetSplitInputShellPos(const TPoint& aOriginalPos) = 0;
  2901     
  2967 
  2902     /**
  2968     /**
  2903      * The active split input editor or its ScrolledComposite ancestor 
  2969      * The active split input editor or its ScrolledComposite ancestor
  2904      * is temporarily resized vertically during split input editing 
  2970      * is temporarily resized vertically during split input editing
  2905      * therefore setting a new size must be diverted trough UiUtils.
  2971      * therefore setting a new size must be diverted trough UiUtils.
  2906      * @param aOriginalSize - The real size of the control, which will be 
  2972      * @param aOriginalSize - The real size of the control, which will be
  2907      *                        applied when VKB closes.
  2973      *                        applied when VKB closes.
  2908      */
  2974      */
  2909     virtual void SetSplitInputViewSize(const TSize& aOriginalSize) = 0;
  2975     virtual void SetSplitInputViewSize(const TSize& aOriginalSize) = 0;
  2910     
  2976 
  2911     /**
  2977     /**
  2912      * The split input shell resized during split editing or
  2978      * The split input shell resized during split editing or
  2913      * the split input view relocated during split editing.
  2979      * the split input view relocated during split editing.
  2914      * The vertical position of the shell will be readjusted.
  2980      * The vertical position of the shell will be readjusted.
  2915      */
  2981      */
  2916     virtual void AdjustSplitInputShellPos() = 0;
  2982     virtual void AdjustSplitInputShellPos() = 0;
       
  2983 
       
  2984     /**
       
  2985      * Fixes the UI orientation on screen.
       
  2986      * The orientation remains fixed until UnRegisterFixScreenOrientation()
       
  2987      * is called for so many times as this method was called.
       
  2988      */
       
  2989     virtual void RegisterFixScreenOrientation() = 0;
       
  2990 
       
  2991     /**
       
  2992      * Unregisters request to fix the UI orientation.
       
  2993      * Component which called RegisterFixScreenOrientation()
       
  2994      * must call this funtion when UI orientation fix is no more needed.
       
  2995      * The UI orientation remains fixed until this method is called
       
  2996      * so many times as registering methods was called.
       
  2997      */
       
  2998     virtual void UnRegisterFixScreenOrientation() = 0;
       
  2999 
       
  3000     /**
       
  3001      * Indicates that the UI orientation is fixed.
       
  3002      * This means that some components requested it calling
       
  3003      * RegisterFixScreenOrientation().
       
  3004      *
       
  3005      * @return ETrue when the UI orientation is fixed.
       
  3006      */
       
  3007     virtual TBool IsScreenOrientationFixed() const = 0;
  2917 };
  3008 };
  2918 
  3009 
  2919 
  3010 
  2920 /**
  3011 /**
  2921  * Interface class for constructing native peers.
  3012  * Interface class for constructing native peers.
  3363      *          This object must be deleted by the caller.
  3454      *          This object must be deleted by the caller.
  3364      */
  3455      */
  3365     virtual TRgb* RunColorDialogL(TRgb* aDefaultColor) const=0;
  3456     virtual TRgb* RunColorDialogL(TRgb* aDefaultColor) const=0;
  3366 
  3457 
  3367     /**
  3458     /**
  3368      * Constructs a FontDialog
       
  3369      */
       
  3370     virtual MSwtFontDialog* NewFontDialogL() const =0;
       
  3371 
       
  3372     /**
       
  3373      * Constructs a DirectoryDialog
  3459      * Constructs a DirectoryDialog
  3374      */
  3460      */
  3375     virtual MSwtDirectoryDialog* NewDirectoryDialogL(const TDesC& aFilterPath,
  3461     virtual MSwtDirectoryDialog* NewDirectoryDialogL(const TDesC& aFilterPath,
  3376             const TDesC& aTitle) const =0;
  3462             const TDesC& aTitle) const =0;
  3377 
  3463