javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtshell.h
branchRCL_3
changeset 14 04becd199f91
child 17 0fd27995241b
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     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 SWTSHELL_H
       
    14 #define SWTSHELL_H
       
    15 
       
    16 
       
    17 #include "swtdecorations.h"
       
    18 
       
    19 
       
    20 /**
       
    21  * CSwtShell
       
    22  * @lib eswt
       
    23  */
       
    24 NONSHARABLE_CLASS(CSwtShell)
       
    25         : public CSwtDecorations
       
    26         , public MSwtShell
       
    27 {
       
    28 // Own methods.
       
    29 public:
       
    30     static CSwtShell* NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer,
       
    31     MSwtShell* aParent, TInt aStyle);
       
    32 protected:
       
    33     CSwtShell(MSwtDisplay& aDisplay, TSwtPeer aPeer,
       
    34               MSwtShell* aParent, TInt aStyle);
       
    35     virtual ~CSwtShell();
       
    36     void ConstructL();
       
    37     MSwtShell& GetTopShell() const;
       
    38     void RemoveAndRememberFocus();
       
    39 
       
    40 // From CSwtComposite
       
    41 protected:
       
    42     void SwtHandleResourceChangeL(TInt aType);
       
    43 
       
    44 // From ASwtControlBase
       
    45 protected:
       
    46     void DoPaint(const TRect& aRect) const;
       
    47     TRect BorderInnerRect() const;
       
    48     TRect BorderOuterRect(const TRect& aRect) const;
       
    49     void DoDelete();
       
    50 
       
    51 // From CCoeControl
       
    52 public:
       
    53     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    54     void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
    55     void MakeVisible(TBool aVisible);
       
    56     void SetDimmed(TBool aDimmed);
       
    57 protected:
       
    58     void FocusChanged(TDrawNow aDrawNow);
       
    59     void Draw(const TRect& aRect) const;
       
    60 
       
    61 // From MCoeControlBackground
       
    62 public:
       
    63     void Draw(CWindowGc& aGc, const CCoeControl& aControl, const TRect& aRect) const;
       
    64 
       
    65 // From MSwtControl
       
    66 public:
       
    67     TBool IsFocusable(TInt aReason = KSwtFocusByApi) const;
       
    68     TBool SetSwtFocus(TInt aReason = KSwtFocusByApi);
       
    69     TBool GetVisible() const;
       
    70     TRect GetBounds() const;
       
    71     TPoint GetLocation() const;
       
    72     void Redraw();
       
    73     void SetLocation(const TPoint& aPoint);
       
    74     void SetWidgetSize(const TSize& aSize);
       
    75     void SetBounds(const TRect& aRect);
       
    76     TBool IsFocusControl();
       
    77     void MoveAbove(const MSwtControl* aControl);
       
    78     void MoveBelow(const MSwtControl* aControl);
       
    79     MSwtShell* ShellInterface()
       
    80     {
       
    81         return this;
       
    82     };
       
    83     const MSwtShell* ShellInterface() const
       
    84     {
       
    85         return this;
       
    86     };
       
    87     void HideSilently();
       
    88     void ShowSilently();
       
    89     inline TBool HiddenSilently() const
       
    90     {
       
    91         return iSilentlyHidden;
       
    92     };
       
    93     void SetVisible(TBool aVisible);
       
    94 
       
    95 // From MSwtComposite
       
    96 public:
       
    97     void ChildFocusChanged(MSwtControl& aControl);
       
    98 
       
    99 // From MSwtDecorations
       
   100 public:
       
   101     void SetMaximized(TBool aMaximized);
       
   102     void SetMinimized(TBool aMinimized);
       
   103     TBool GetMinimized() const;
       
   104     void SetTextL(const TDesC& aText);
       
   105     const TDesC* GetText() const;
       
   106     void SetImageL(const MSwtImage* aImage);
       
   107     void SetMenuBar(const MSwtMenu* aMenuBar);
       
   108 
       
   109 // From MSwtShell
       
   110 public:
       
   111     MSwtDecorations* Decorations();
       
   112     MSwtShell* GetParentShell();
       
   113     void ForceActive();
       
   114     CSwtPeerArray* GetChildShellsPeersL();
       
   115     MSwtDisplay& Display() const;
       
   116     TBool FullScreenMode() const;
       
   117     TInt GetImeInputMode() const;
       
   118     TSize GetMinimumSize() const;
       
   119     void SetImeInputMode(TInt aMode);
       
   120     void SetMinimumSize(const TSize& aMinimumSize);
       
   121     void SetStyle(TInt aStyle);
       
   122     const RSwtControlArray& GetFullTabListL();
       
   123     void ResetTabList();
       
   124     MSwtControl* FindTraversalTargetL(TInt aDetail,
       
   125                                       MSwtControl& aFocusControl, RSwtControlArray* aExcludedControls = NULL);
       
   126     void SetFocusControl(MSwtControl* aControl);
       
   127     TBool HasModalChild() const;
       
   128     void ActivityChanged(TBool aIsActive, TBool aSetFocus);
       
   129     void SetZPosition(TInt aZPosition);
       
   130     MSwtControl* FocusControl() const;
       
   131     void SetDefaultCommand(const MSwtCommand* aCommand);
       
   132     const MSwtCommand* DefaultCommand() const;
       
   133     void SetFullScreen(TBool aFullScreen);
       
   134     void SetControlGoingToStack(MSwtControl* aControl);
       
   135     MSwtControl* ControlGoingToStack() const;
       
   136     void SetControlGainingFocus(MSwtControl* aControl);
       
   137     MSwtControl* ControlGainingFocus() const;
       
   138     MSwtShell::TSwtStatusPaneStyle StatusPaneStyle() const
       
   139     {
       
   140         return MSwtShell::EStyleLargeStatusPane;
       
   141     };
       
   142     virtual TRect DefaultBounds() const;
       
   143     void SetToBeFocusedControl(MSwtControl* aControl);
       
   144     void CheckFocusMemory(MSwtControl& aUnregisteredControl);
       
   145     void SetUrgentPaintControl(MSwtControl* aControl);
       
   146     MSwtControl* UrgentPaintControl() const;
       
   147     TBool AsyncPainting() const;
       
   148     void SetAsyncPainting(TBool aStatus);
       
   149     void InstallCba();
       
   150     TBool HasCba() const;
       
   151 
       
   152 // From MEikStatusPaneObserver
       
   153 public:
       
   154     void HandleStatusPaneSizeChange();
       
   155 
       
   156 private:
       
   157     void FinishRedraw() const;
       
   158     
       
   159 // Data
       
   160 private:
       
   161     /**
       
   162      * This Shell's focus control, may be NULL.
       
   163      * Not own.
       
   164      */
       
   165     MSwtControl* iFocusControl;
       
   166 
       
   167     /**
       
   168      * This Shell's focus control before it got deactivated, may be NULL.
       
   169      * Not own.
       
   170      */
       
   171     MSwtControl* iFocusMemory;
       
   172 
       
   173     /**
       
   174      * A pointer to the child control of this shell, which should be added
       
   175      * to the Appui's Control Stack, if needed. May be NULL.
       
   176      * Not own.
       
   177      */
       
   178     MSwtControl* iControlGoingToStack;
       
   179 
       
   180     /**
       
   181      * A pointer to the child control of this shell, which should be set
       
   182      * focused, if needed. May be NULL.
       
   183      * Not own.
       
   184      */
       
   185     MSwtControl* iControlGainingFocus;
       
   186 
       
   187     /**
       
   188      * This Shell's tab-list.
       
   189      */
       
   190     RSwtControlArray iFullTabList;
       
   191 
       
   192     /**
       
   193      * This Shell's default command, may be NULL.
       
   194      * Not own.
       
   195      */
       
   196     const MSwtCommand* iDefaultCommand;
       
   197 
       
   198     /**
       
   199      * Whether or not this Shell is full-screen
       
   200      */
       
   201     TBool iFullScreen;
       
   202 
       
   203     /**
       
   204      * The minimum size, not used for top-level shells
       
   205      */
       
   206     TSize iMinSize;
       
   207 
       
   208     /**
       
   209      * The value of the style at the construction. When the shell is set
       
   210      * to fullscreen, iStyle is modified. iSavedStyle is used to recover
       
   211      * original style when get back to non fullscreen mode.
       
   212      */
       
   213     TInt iSavedStyle;
       
   214 
       
   215     /**
       
   216      * Used by top level shell, because all top level shells share the
       
   217      * Title pane of the appUI.
       
   218      * Own.
       
   219      */
       
   220     TDesC* iTitleText;
       
   221 
       
   222     /**
       
   223      * Whether or not draw method is called by eSWT drawing framework
       
   224      * and not by Symbian drawing framework.
       
   225      */
       
   226     TBool iDrawCalledByOurFrwk;
       
   227 
       
   228     /**
       
   229      * Original window priority
       
   230      */
       
   231     TInt iWindowPriority;
       
   232 
       
   233     /**
       
   234      * Tells if the Shell has been sent to background while inactive.
       
   235      */
       
   236     TBool iSilentlyHidden;
       
   237 
       
   238     /**
       
   239      * While this is not null, no paint events are delivered to Java and all
       
   240      * native paint requests received in ::Draw() are served immediately.
       
   241      * Only the urgently painted control and its children are drawn.
       
   242      */
       
   243     MSwtControl* iUrgentPaintControl;
       
   244 
       
   245     /**
       
   246      * If there are no paint listeners, no painting trough Java. By default
       
   247      * this is set to EFalse. If any of the children registers a paint listener,
       
   248      * this goes ETrue.
       
   249      */
       
   250     TBool iAsyncPainting;
       
   251     
       
   252     /**
       
   253      * Once turned on can never be turned off.
       
   254      */
       
   255     TBool iHasCba;
       
   256 };
       
   257 
       
   258 #endif // SWTSHELL_H