textinput/peninputarc/inc/pensrvcliinc/penuiwndctrl.h
branchRCL_3
changeset 20 ebd48d2de13c
parent 19 ac7e4d1d9209
child 21 ecbabf52600f
equal deleted inserted replaced
19:ac7e4d1d9209 20:ebd48d2de13c
    16 */
    16 */
    17 #ifndef __PEN_UI_WINDOW_CONTROL__
    17 #ifndef __PEN_UI_WINDOW_CONTROL__
    18 #define __PEN_UI_WINDOW_CONTROL__
    18 #define __PEN_UI_WINDOW_CONTROL__
    19 
    19 
    20 #include <coecntrl.h>
    20 #include <coecntrl.h>
    21 #include <AknIconUtils.h>
       
    22 #include <AknsUtils.h>
       
    23 #include <AknsDrawUtils.h> 
       
    24 
       
    25 #ifndef FIX_FOR_NGA
       
    26 #define FIX_FOR_NGA
       
    27 #endif
       
    28 
       
    29 class RAknUiServer;
    21 class RAknUiServer;
    30 class CPenUiWndCtrl;
    22 class CPenUiWndCtrl;
    31 class CPenUiHwnWnd;
       
    32 
       
    33 struct TCommonBgCtrlSubItem
       
    34     {
       
    35     TRect iRect;    
       
    36     TAknsItemID iFrameID;
       
    37     TAknsItemID iCenterID;
       
    38     TBool iIsShow;      
       
    39     };
       
    40 class CPenUiWndCtrl;
       
    41 
       
    42 class CCursorWindow : public CCoeControl
       
    43     {
       
    44 public: // Functions from base classes.
       
    45 
       
    46     CCursorWindow(CPenUiWndCtrl* aParent);
       
    47     //void ConstructL(CCoeControl* aParent);
       
    48     /**
       
    49      * From CCoeControl    
       
    50      * Function where control's drawing is done.
       
    51      *
       
    52      * @param aRect Control's area.
       
    53      */
       
    54     void Draw( const TRect &aRect ) const;
       
    55     
       
    56     void SetCursorVisible(TBool aFlag);
       
    57 
       
    58 private:
       
    59     TBool iCursorVisible;
       
    60     CPenUiWndCtrl* iParent;
       
    61     };
       
    62 	
       
    63 class CPenUiPopWnd : public CCoeControl
    23 class CPenUiPopWnd : public CCoeControl
    64     {
    24     {
    65 public: // Constructors and destructor
    25 public: // Constructors and destructor
    66     static CPenUiPopWnd* NewL(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap,
    26     static CPenUiPopWnd* NewL(RWindowGroup& aWndGroup,CFbsBitmap * aBitmap,
    67                                     CPenUiWndCtrl* aCtrl);
    27                                     CPenUiWndCtrl* aCtrl);
   191     void DimPenUiForMenu(TInt aPriority);
   151     void DimPenUiForMenu(TInt aPriority);
   192     void DimInternalPenUiForMenu(TInt aPriority);
   152     void DimInternalPenUiForMenu(TInt aPriority);
   193     void DimPenUiForMenu();
   153     void DimPenUiForMenu();
   194     TInt GetWndPriority();
   154     TInt GetWndPriority();
   195     void SetResourceChange(TBool aResourceChange);
   155     void SetResourceChange(TBool aResourceChange);
   196     void UpdateCursor(TBool aOnFlag,const CFbsBitmap* aCursorBmp,const TRect& aPos);
       
   197     void SetPopupArea(const TRect& aRect, TBool aFlag);
       
   198     void UpdateICFArea(const CFbsBitmap* aBmp,const TPoint& aPos);
       
   199     
       
   200     /**
       
   201      * Update the bubble area list
       
   202      *
       
   203      * @since S60 v5.0
       
   204      * @param aCtrl the Ctrl's address
       
   205      * @param aBmp the bubble bitmap's address
       
   206      * @param aRect the bubble rect
       
   207      * @param aFlag ETrue means add bubble area and 
       
   208      *              EFalse means remove bubble area
       
   209      * @return void
       
   210      */
       
   211     void UpdateChangedArea( const TUint32 aCtrl, 
       
   212     	const CFbsBitmap* aBmp, const TRect& aRect, TBool aFlag );
       
   213     
       
   214     /**
       
   215      * Update the bubble area list
       
   216      *
       
   217      * @since S60 v5.0
       
   218      * @param aCtrl the Ctrl's address
       
   219      * @param aBmp the bubble bitmap's address
       
   220      * @param aMaskBmp the bubble mask bitmap's address
       
   221      * @param aPos the bubble rect
       
   222      * @param aFlag ETrue means add bubble area and 
       
   223      *              EFalse means remove bubble area
       
   224      * @return void
       
   225      */
       
   226     void UpdateBubble( const TUint32 aCtrl, 
       
   227     	const CFbsBitmap* aBmp, const CFbsBitmap* aMaskBmp, 
       
   228     	const TRect& aPos, TBool aFlag );
       
   229     
       
   230     void Clean();
       
   231     
       
   232     void HandleNGASpecificSignal(TInt aEventType, const TDesC& aEventData);
       
   233     void LiftUpPriority();
       
   234     
       
   235     /**
       
   236      * Update the cursor color
       
   237      *
       
   238      * @since S60 v5.0
       
   239      * @param none
       
   240      * @return void
       
   241      */
       
   242     void SetCursorColor();
       
   243     
       
   244 public: // Functions from base classes.
   156 public: // Functions from base classes.
   245 
   157 
   246     /**
   158     /**
   247      * From CCoeControl    
   159      * From CCoeControl    
   248      * Function where control's drawing is done.
   160      * Function where control's drawing is done.
   249      *
   161      *
   250      * @param aRect Control's area.
   162      * @param aRect Control's area.
   251      */
   163      */
   252     void Draw( const TRect &aRect ) const;
   164     void Draw( const TRect &aRect ) const;
   253     
   165     
   254 public:
       
   255     /**
       
   256      * Auto refresh timer callback, refresh pen ui. (for NGA)
       
   257      */
       
   258     void RefreshUI();
       
   259 
       
   260 protected:
       
   261     CCoeControl* ComponentControl(TInt) const;
       
   262     TInt CountComponentControls() const;
       
   263 	    
       
   264 private:
   166 private:
   265 
   167 
   266     /**
   168     /**
   267      * when pen ui is activated, e.g. after screen saver, restore system fading status 
   169      * when pen ui is activated, e.g. after screen saver, restore system fading status 
   268      * and set non-fading for pen ui
   170      * and set non-fading for pen ui
   293      * @param  aWS           Indicate RWsSession.
   195      * @param  aWS           Indicate RWsSession.
   294      * @param  aWGId         Id of focus window group.
   196      * @param  aWGId         Id of focus window group.
   295      */
   197      */
   296     TUid WindowGroupNameAppUidL( RWsSession& aWS,TInt aWGId  );
   198     TUid WindowGroupNameAppUidL( RWsSession& aWS,TInt aWGId  );
   297     
   199     
   298     /**
       
   299      * Restart auto refresh timer. (for NGA)
       
   300      */
       
   301     void RestartRefreshTimer();
       
   302     
       
   303     /**
       
   304      * stop auto refresh timer. (for NGA)
       
   305      */
       
   306     void StopRefreshTimer();
       
   307     
       
   308     void DrawBkground(CWindowGc& aGc,const TRect& aRect) const;
       
   309     void DrawFrame( CWindowGc& aGc,const TRect& aRect,TAknsItemID aFrameID,TAknsItemID aCenterID ) const;
       
   310     
       
   311     void DrawCursor(CWindowGc& aGc) const;
       
   312     void DrawBubbleAsBackground(CFbsBitGc* aGc, CFbsBitmap* aBmp, const TRect& aRect);
       
   313 
   200 
   314 private: // Data
   201 private: // Data
   315     RWindowGroup& iWndGroup;
   202     RWindowGroup& iWndGroup;
   316     CFbsBitmap * iBitmap;
   203     CFbsBitmap * iBitmap;
   317 
   204 
   324     TInt iFocusWndGrpPos;
   211     TInt iFocusWndGrpPos;
   325     TInt iFocusWgHandle;
   212     TInt iFocusWgHandle;
   326     
   213     
   327     TInt iPriority;
   214     TInt iPriority;
   328     TInt iPreEditorPriority;
   215     TInt iPreEditorPriority;
   329     CAknIncallBubble* iIncallBubble;
       
   330     CPenUiPopWnd* iPopupWnd;
   216     CPenUiPopWnd* iPopupWnd;
   331     
   217     
   332     TBool iShowPopup;
   218     TBool iShowPopup;
   333     TRect iInvalidateRect;
   219     TRect iInvalidateRect;
   334     TBool iResourceChange;
   220     TBool iResourceChange;
   335     //TBool iUiLayoutChange;
   221     //TBool iUiLayoutChange;
   336     TBool iInGlobalEditorState;
   222     TBool iInGlobalEditorState;
   337     TRect iLayoutClipRect;
   223     TRect iLayoutClipRect;
   338 
       
   339     CFbsBitmap * iCursorBmp;
       
   340     CFbsBitmap* iICFBmp;
       
   341     CFbsBitmap* iChangedBmp;
       
   342     RPointerArray<CFbsBitmap> iBubblesArea;
       
   343     RPointerArray<CFbsBitmap> iBubblesMaskArea;
       
   344     
       
   345     /**
       
   346      * An array of the Controls' addresses 
       
   347      */
       
   348     RArray<TUint32> iBubblesCtrl;
       
   349     
       
   350     RArray<TRect> iBubblesPos;
       
   351     
       
   352     TPoint iCursorPos;
       
   353     TPoint iIcfPos;
       
   354     TPoint iChangedPos;
       
   355     TRect iIcfRect;
       
   356     TRect iCursorRect;
       
   357     CIdle *iIdle;
       
   358     TRect iRedrawRect;
       
   359     TInt iTouchCount;
       
   360     
       
   361     TBool iCursorVisible;
       
   362     
       
   363     RRegion iPopRegion;
       
   364 
       
   365     TBool iBackground;
       
   366     TAknsItemID iFrameID;
       
   367     TAknsItemID iCenterID;
       
   368     
       
   369     /**
       
   370      * Auto refresh timer
       
   371      * own
       
   372      */
       
   373     CPeriodic* iAutoRefreshTimer;
       
   374 
       
   375     /**
       
   376      * The sub items of the background 
       
   377      */
       
   378     RArray<TCommonBgCtrlSubItem> *iSubItems; //not own
       
   379     
       
   380     TBool iNotUpdating;
       
   381     CCursorWindow* iCursorWnd;
       
   382     
       
   383     /**
       
   384      * The cursor's color 
       
   385      */
       
   386     TRgb iCursorColor;
       
   387     
       
   388 friend class CCursorWindow;
       
   389     };
   224     };
   390 class CInternalBkCtrl : public CCoeControl
   225 class CInternalBkCtrl : public CCoeControl
   391     {
   226     {
   392 public: // Constructors and destructor
   227 public: // Constructors and destructor
   393     /**
   228     /**