textinput/peninputarc/inc/pensrvcliinc/penuiwndctrl.h
changeset 0 eb1f2e154e89
child 9 e6a39382bb9c
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifndef __PEN_UI_WINDOW_CONTROL__
       
    18 #define __PEN_UI_WINDOW_CONTROL__
       
    19 
       
    20 #include <coecntrl.h>
       
    21 class RAknUiServer;
       
    22 class CPenUiWndCtrl;
       
    23 class CPenUiPopWnd : public CCoeControl
       
    24     {
       
    25 public: // Constructors and destructor
       
    26     static CPenUiPopWnd* NewL(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap,
       
    27                                     CPenUiWndCtrl* aCtrl);
       
    28     /**
       
    29      * Destructor.
       
    30      */
       
    31     ~CPenUiPopWnd();
       
    32     
       
    33     /** 
       
    34      * show popup window
       
    35      * @param aRectInScreen the rect of popup in screen coord-sys
       
    36      * @param aRectInLayout the rect of popup in layout(extended) coord-sys
       
    37      * @return none
       
    38      */
       
    39     void PopUp(const TRect& aRectInScreen, const TRect aRectInLayout );
       
    40     
       
    41     void PopUp(TInt aPriority);
       
    42     void Invalidate(const TRect& aRect);
       
    43     void Close();
       
    44 public: // Functions from base classes.
       
    45 
       
    46     /**
       
    47      * From CCoeControl    
       
    48      * Function where control's drawing is done.
       
    49      *
       
    50      * @param aRect Control's area.
       
    51      */
       
    52     void Draw( const TRect &aRect ) const;
       
    53 private:
       
    54     /**
       
    55      * C++ default constructor.
       
    56      * @param aAppUi AppUi of Eikon server.
       
    57      */
       
    58     CPenUiPopWnd(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap,
       
    59                                                       CPenUiWndCtrl* aCtrl);
       
    60     
       
    61     /**
       
    62      * Two-phased constructor.
       
    63      */
       
    64     void ConstructL();
       
    65     
       
    66     
       
    67 private: // Data
       
    68     RWindowGroup& iWndGroup;
       
    69     CFbsBitmap * iBitmap;
       
    70     //RWindowTreeNode& iBackgroundWnd;    
       
    71     RAknUiServer* iAknUiSrv;    
       
    72     CPenUiWndCtrl* iBackgroundCtrl;
       
    73     
       
    74     /**
       
    75      * the position and size of image in extended layout coord-sys
       
    76      */
       
    77     TRect iRectInLayout;
       
    78     };
       
    79 
       
    80 class CAknIncallBubble;
       
    81 class CPenUiWndCtrl : public CCoeControl
       
    82     {
       
    83 public:
       
    84 
       
    85     enum EditorType
       
    86         {
       
    87         ENoremalEditor,
       
    88         EGlobleNotes,
       
    89         EGlobleNotesWithEditor  
       
    90         };
       
    91     
       
    92 public: // Constructors and destructor
       
    93     /**
       
    94      * C++ default constructor.
       
    95      * @param aAppUi AppUi of Eikon server.
       
    96      */
       
    97     CPenUiWndCtrl(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap);
       
    98     
       
    99     /**
       
   100      * Two-phased constructor.
       
   101      */
       
   102     void ConstructL();
       
   103     
       
   104     /**
       
   105      * Destructor.
       
   106      */
       
   107     ~CPenUiWndCtrl();
       
   108 
       
   109 public: // New functions
       
   110     /**
       
   111      * Called from akncapserver appui to run fastswap.
       
   112      */
       
   113 
       
   114     /**
       
   115      * Show pen UI with priority.
       
   116      */
       
   117     void ShowPenUiL(TBool aDimmed = EFalse);
       
   118     
       
   119     /**
       
   120      * Show popup window
       
   121      * @param aRectInScreen the rect of popup, in screen coord-sys
       
   122      * @param aRectInLayout the rect of popup, in layout(extended) coord-sys
       
   123      * @param aLayoutTrimRect the rect of old layout, in layout(extended) coord-sys
       
   124      * @return none
       
   125      */
       
   126     void ShowPopup( const TRect& aRectInScreen, const TRect& aRectInLayout, 
       
   127                     const TRect& aLayoutTrimRect ); 
       
   128 
       
   129     /**
       
   130      * Close the pop up window.
       
   131      */
       
   132     void ClosePopup();
       
   133         
       
   134     /**
       
   135      * Called from akncapserver appui to close fastswap.
       
   136      */
       
   137     void ClosePenUi(TBool aResChanging = EFalse);    
       
   138     
       
   139     void Invalidate(const TRect& aRect,TBool aFullUpdate);
       
   140     void OnDeactivate();
       
   141     void OnActivate(EditorType aType);
       
   142 
       
   143 
       
   144     void Fade();
       
   145     
       
   146     
       
   147     TBool IsDimmed();    
       
   148 
       
   149     TInt WndPriority();
       
   150     
       
   151     void DimPenUiForMenu(TInt aPriority);
       
   152     void DimInternalPenUiForMenu(TInt aPriority);
       
   153     void DimPenUiForMenu();
       
   154     TInt GetWndPriority();
       
   155     void SetResourceChange(TBool aResourceChange);
       
   156 public: // Functions from base classes.
       
   157 
       
   158     /**
       
   159      * From CCoeControl    
       
   160      * Function where control's drawing is done.
       
   161      *
       
   162      * @param aRect Control's area.
       
   163      */
       
   164     void Draw( const TRect &aRect ) const;
       
   165     
       
   166 private:
       
   167 
       
   168     /**
       
   169      * when pen ui is activated, e.g. after screen saver, restore system fading status 
       
   170      * and set non-fading for pen ui
       
   171      */
       
   172     void RestoreSystemFadeStatus();
       
   173     
       
   174     /**
       
   175      * set non-fading feature for pen ui window when pen ui is open to be shown
       
   176      */
       
   177     void ChangeSysteFadeStatus();
       
   178 
       
   179 
       
   180     /**
       
   181      * From CCoeControl.
       
   182      * Key event handling
       
   183      *
       
   184      * @return TKeyResponse  Indicates whether or not the key event was used by this control.
       
   185      * @param aKeyEvent      Key event.
       
   186      * @param aType          Type of key event.
       
   187      */
       
   188     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   189     
       
   190     
       
   191     /**
       
   192      * Get the AppUid of WinsowGroupName
       
   193      * 
       
   194      * @return TUid          Indicate the Id of WindowGroupNameApp
       
   195      * @param  aWS           Indicate RWsSession.
       
   196      * @param  aWGId         Id of focus window group.
       
   197      */
       
   198     TUid WindowGroupNameAppUidL( RWsSession& aWS,TInt aWGId  );
       
   199     
       
   200 
       
   201 private: // Data
       
   202     RWindowGroup& iWndGroup;
       
   203     CFbsBitmap * iBitmap;
       
   204 
       
   205     // whether system fading status has been changed?
       
   206     TBool iChangeSystemFadeStatus;
       
   207 
       
   208     RAknUiServer* iAknUiSrv;
       
   209     
       
   210     TInt iFocusWndGrpPriority;
       
   211     TInt iFocusWndGrpPos;
       
   212     TInt iFocusWgHandle;
       
   213     
       
   214     TInt iPriority;
       
   215     TInt iPreEditorPriority;
       
   216     CAknIncallBubble* iIncallBubble;
       
   217     CPenUiPopWnd* iPopupWnd;
       
   218     
       
   219     TBool iShowPopup;
       
   220     TRect iInvalidateRect;
       
   221     TBool iResourceChange;
       
   222     //TBool iUiLayoutChange;
       
   223     TBool iInGlobalEditorState;
       
   224     TRect iLayoutClipRect;
       
   225     };
       
   226 class CInternalBkCtrl : public CCoeControl
       
   227     {
       
   228 public: // Constructors and destructor
       
   229     /**
       
   230      * C++ default constructor.
       
   231      * @param aAppUi AppUi of Eikon server.
       
   232      */
       
   233     CInternalBkCtrl(RWindowGroup& aWndGroup);
       
   234     
       
   235     /**
       
   236      * Two-phased constructor.
       
   237      */
       
   238     void ConstructL();
       
   239     
       
   240     /**
       
   241      * Destructor.
       
   242      */
       
   243     
       
   244 
       
   245 public: // New functions
       
   246     
       
   247 //    void Invalidate(const TRect& aRect,TBool aFullUpdate);
       
   248 public: // Functions from base classes.
       
   249 
       
   250     /**
       
   251      * From CCoeControl    
       
   252      * Function where control's drawing is done.
       
   253      *
       
   254      * @param aRect Control's area.
       
   255      */
       
   256   //  void Draw( const TRect &aRect ) const;
       
   257 
       
   258 //    void SizeChanged();   
       
   259 //    void CreateListBox(); 
       
   260 private: // Data
       
   261     RWindowGroup& iWndGroup;
       
   262     CFbsBitmap * iBitmap;
       
   263     };    
       
   264 #endif