textinput/peninputarc/inc/peninputlayoutcontrolinc/peninputlayoutbubblectrl.h
branchRCL_3
changeset 20 ebd48d2de13c
parent 12 5e18d8c489d6
child 21 ecbabf52600f
equal deleted inserted replaced
19:ac7e4d1d9209 20:ebd48d2de13c
    45      */
    45      */
    46     IMPORT_C static CBubbleCtrl* NewL(const TRect& aRect,
    46     IMPORT_C static CBubbleCtrl* NewL(const TRect& aRect,
    47                              CFepUiLayout* aUiLayout,
    47                              CFepUiLayout* aUiLayout,
    48                              TInt aCtrlId);
    48                              TInt aCtrlId);
    49     
    49     
    50     inline void SetIconOffsetAndSize( 
       
    51             const TSize& aOffset, const TSize& aSize );
       
    52     IMPORT_C virtual void Draw();
    50     IMPORT_C virtual void Draw();
    53 
    51 
    54     IMPORT_C virtual void Hide(TBool aShowFlag);    
    52     IMPORT_C virtual void Hide(TBool aShowFlag);    
    55         
    53         
    56     IMPORT_C void SetBitmapParam(CFbsBitmap* aBmpId,
    54     IMPORT_C void SetBitmapParam(CFbsBitmap* aBmpId,
    84     IMPORT_C void Close();
    82     IMPORT_C void Close();
    85 
    83 
    86     IMPORT_C TBool IsShowing();
    84     IMPORT_C TBool IsShowing();
    87 
    85 
    88     IMPORT_C void SetFrameDiff(TInt aLeftDiff,TInt aTopDiff,TInt aRightDiff,TInt aBottomDiff);
    86     IMPORT_C void SetFrameDiff(TInt aLeftDiff,TInt aTopDiff,TInt aRightDiff,TInt aBottomDiff);
    89     inline void GetText( TDes& aText );
       
    90     
    87     
    91     void Freeze();
    88     void Freeze();
    92     
    89     
    93     void UnFreeze( TBool aUpdate = ETrue );
    90     void UnFreeze( TBool aUpdate = ETrue );
    94     inline void SetTextColorIndex( TInt aTxtClrIndex );
    91     inline void SetTextColorIndex( TInt aTxtClrIndex );
    95     inline TInt TextColorIndex() const;
    92     inline TInt TextColorIndex() const;
    96 
       
    97     inline void SetLangCode( TInt aLangCode );
       
    98 
       
    99 protected:
    93 protected:
   100     IMPORT_C CBubbleCtrl(const TRect& aRect,
    94     IMPORT_C CBubbleCtrl(const TRect& aRect,
   101                 CFepUiLayout* aUiLayout,
    95                 CFepUiLayout* aUiLayout,
   102                 TInt aCtrlId);
    96                 TInt aCtrlId);
   103                     
    97                     
   104     IMPORT_C void ConstructL(TInt aBmpId, TInt aMaskId);
    98     IMPORT_C void ConstructL(TInt aBmpId, TInt aMaskId);
   105        
       
   106 private:
       
   107     TRect GetRect();
       
   108        
    99        
   109 private:
   100 private:
   110     CFbsBitmap* iForgroundBmp;
   101     CFbsBitmap* iForgroundBmp;
   111     CFbsBitmap* iForgroundBmpMask;
   102     CFbsBitmap* iForgroundBmpMask;
   112     
   103     
   129     TBool iFreeze;
   120     TBool iFreeze;
   130     TRect iInvalidRect;
   121     TRect iInvalidRect;
   131     
   122     
   132     TBool iNeedRedraw; // redraw flag after text changed.
   123     TBool iNeedRedraw; // redraw flag after text changed.
   133     TInt iTextColorIndex;    
   124     TInt iTextColorIndex;    
   134     TSize iIconOffset;
   125     };
   135     TSize iIconSize;
       
   136 	
       
   137 public:
       
   138     IMPORT_C virtual void SetRect(const TRect& aRect);
       
   139     void SetBmpDevice(CFbsBitGc* aGc,CFbsBitmapDevice* aDevice);
       
   140     void CreateBmpDevL();
       
   141     inline void SetOffset(TPoint& aPt);
       
   142 protected:    
       
   143     IMPORT_C void HandleResourceChange(TInt aType);
       
   144 private:
       
   145     
   126     
   146         
       
   147 private:
       
   148     CFbsBitmap* iBitmap;
       
   149     CFbsBitmap* iMaskBitmap;
       
   150     
       
   151     TPoint iOffset;
       
   152     TInt iReserved1;
       
   153     
       
   154     TInt iLangCode;
       
   155     };
       
   156 
       
   157 inline void CBubbleCtrl::SetOffset(TPoint& aPt)
       
   158     {
       
   159     iOffset = aPt;
       
   160     }
       
   161 
       
   162 inline void CBubbleCtrl::SetTextColorIndex( TInt aTxtClrIndex )
   127 inline void CBubbleCtrl::SetTextColorIndex( TInt aTxtClrIndex )
   163 	{
   128 	{
   164 	iTextColorIndex = aTxtClrIndex;	
   129 	iTextColorIndex = aTxtClrIndex;	
   165 	}
   130 	}
   166 	
   131 	
   167 inline TInt CBubbleCtrl::TextColorIndex() const
   132 inline TInt CBubbleCtrl::TextColorIndex() const
   168 	{
   133 	{
   169 	return iTextColorIndex;
   134 	return iTextColorIndex;
   170 	}
   135 	}
   171 inline void CBubbleCtrl::SetIconOffsetAndSize( 
       
   172         const TSize& aOffset, const TSize& aSize )
       
   173     {
       
   174     iIconOffset = aOffset;
       
   175     iIconSize = aSize;
       
   176     }
       
   177 
       
   178 inline void CBubbleCtrl::GetText( TDes& aText )
       
   179     {
       
   180     aText.Copy( *iText );
       
   181     }
       
   182 
       
   183 inline void CBubbleCtrl::SetLangCode( TInt aLangCode )
       
   184     {
       
   185     iLangCode = aLangCode;
       
   186     }
       
   187 
   136 
   188 class CTooltipBubbleCtrl: public CBubbleCtrl
   137 class CTooltipBubbleCtrl: public CBubbleCtrl
   189     {
   138     {
   190 public: 
   139 public: 
   191     //constructor and destructor
   140     //constructor and destructor