textinput/peninputarc/inc/peninputlayoutcontrolinc/peninputlayoutbasecontrol.inl
changeset 0 eb1f2e154e89
child 18 c8fb4cf7b3ae
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Inline function for base controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // ---------------------------------------------------------------------------
       
    20 // get control type
       
    21 // ---------------------------------------------------------------------------
       
    22 //
       
    23 inline TControlType CFepUiBaseCtrl::ControlType()
       
    24     {
       
    25     return iControlType;
       
    26     }
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // get control id
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 inline TInt CFepUiBaseCtrl::ControlId()
       
    33     {
       
    34     return iControlId;
       
    35     } 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // get control rect
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 inline const TRect& CFepUiBaseCtrl::Rect()
       
    42     {
       
    43     return iRect;
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // get control shadow rect
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 inline const TRect& CFepUiBaseCtrl::ShadowRect()
       
    51     {
       
    52     return iShadowRect;
       
    53     }    
       
    54     
       
    55 // ---------------------------------------------------------------------------
       
    56 // Control status: Hide/Display
       
    57 // ---------------------------------------------------------------------------
       
    58 //   
       
    59 inline TBool CFepUiBaseCtrl::Hiden()
       
    60     {
       
    61     return iHiden;
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // Set control backgroud color
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 inline void CFepUiBaseCtrl::SetBkColor(const TRgb& aCol) 
       
    69     {
       
    70     iBackgroundCol = aCol;
       
    71     }
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // Set backgroud mask color
       
    75 // ---------------------------------------------------------------------------
       
    76 //    
       
    77 inline void CFepUiBaseCtrl::SetMaskBkCol(const TRgb& aCol)
       
    78     {
       
    79     iMaskBkCol = aCol;
       
    80     }
       
    81 
       
    82 // ---------------------------------------------------------------------------
       
    83 // Set pen size
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 inline void CFepUiBaseCtrl::SetPenSize(const TSize& aSize)
       
    87     {
       
    88     iPenSize = aSize;
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // Set pen color
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 inline void CFepUiBaseCtrl::SetPenColor(const TRgb& aCol)
       
    96     {
       
    97     iPenColor = aCol;    
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // Get pen size
       
   102 // ---------------------------------------------------------------------------
       
   103 //
       
   104 inline const TSize& CFepUiBaseCtrl::PenSize()
       
   105     {
       
   106     return iPenSize;
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // get pen color
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 inline const TRgb& CFepUiBaseCtrl::PenColor()
       
   114     {
       
   115     return iPenColor;
       
   116     }
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // get backgroud color
       
   120 // ---------------------------------------------------------------------------
       
   121 //    
       
   122 inline const TRgb& CFepUiBaseCtrl::BkColor()
       
   123     {
       
   124     return iBackgroundCol;
       
   125     }
       
   126     
       
   127 // ---------------------------------------------------------------------------
       
   128 // Get background mask color
       
   129 // ---------------------------------------------------------------------------
       
   130 //    
       
   131 inline const TRgb& CFepUiBaseCtrl::MaskBkCol()
       
   132     {
       
   133     return iMaskBkCol;
       
   134     }
       
   135     
       
   136 // ---------------------------------------------------------------------------
       
   137 // Control ready staus
       
   138 // ---------------------------------------------------------------------------
       
   139 //
       
   140 inline TBool CFepUiBaseCtrl::Ready()
       
   141     {
       
   142     return iReady;
       
   143     }
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // Set control ready staus
       
   147 // ---------------------------------------------------------------------------
       
   148 //
       
   149 inline void CFepUiBaseCtrl::SetReady(TBool aReadyFlag)
       
   150     {
       
   151     iReady = aReadyFlag;
       
   152     }
       
   153 
       
   154 // ---------------------------------------------------------------------------
       
   155 // get control valid region
       
   156 // ---------------------------------------------------------------------------
       
   157 //
       
   158 inline const RRegion& CFepUiBaseCtrl::Region()
       
   159     {
       
   160     return iValidRegion;
       
   161     }
       
   162 
       
   163 // ---------------------------------------------------------------------------
       
   164 // set control valid region
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 inline void CFepUiBaseCtrl::SetRegion(const RRegion& aRegion)
       
   168     {
       
   169     iValidRegion.Close(); //frees the memory first
       
   170     iValidRegion = aRegion;
       
   171     }
       
   172 
       
   173 
       
   174 // ---------------------------------------------------------------------------
       
   175 // Test whether this control is a kind of specified control
       
   176 // ---------------------------------------------------------------------------
       
   177 //  
       
   178 inline TBool CFepUiBaseCtrl::IsKindOfControl(TStockBaseCtrlType aCtrlClass)
       
   179     {    
       
   180     return (iControlType & aCtrlClass) == aCtrlClass ;    
       
   181     }
       
   182     
       
   183 // ---------------------------------------------------------------------------
       
   184 // get control active status
       
   185 // ---------------------------------------------------------------------------
       
   186 //    
       
   187 inline TBool CFepUiBaseCtrl::IsActive()
       
   188     {
       
   189     return iIsActive;
       
   190     }
       
   191 
       
   192 // ---------------------------------------------------------------------------
       
   193 // Set control type
       
   194 // ---------------------------------------------------------------------------
       
   195 //       
       
   196 inline void CFepUiBaseCtrl::SetControlType(TControlType aCtrlType)
       
   197     {
       
   198     iControlType = aCtrlType;
       
   199     }
       
   200 
       
   201 // ---------------------------------------------------------------------------
       
   202 // Get ui layout
       
   203 // ---------------------------------------------------------------------------
       
   204 //   
       
   205 inline CFepUiLayout* CFepUiBaseCtrl::UiLayout()
       
   206     {
       
   207     return iUiLayout;
       
   208     }
       
   209 
       
   210 // ---------------------------------------------------------------------------
       
   211 // get layout root control
       
   212 // ---------------------------------------------------------------------------
       
   213 //
       
   214 inline CFepUiLayoutRootCtrl* CFepUiBaseCtrl::RootControl()
       
   215     {
       
   216     return iRootCtrl;
       
   217     }
       
   218     
       
   219 // ---------------------------------------------------------------------------
       
   220 // get graphics context for sprite or window
       
   221 // ---------------------------------------------------------------------------
       
   222 //   
       
   223 inline CBitmapContext* CFepUiBaseCtrl::BitGc()
       
   224     {
       
   225     return iLayoutOwner->BitmapContext();
       
   226     }
       
   227 
       
   228 // ---------------------------------------------------------------------------
       
   229 // get Bitmap device for sprite or window
       
   230 // ---------------------------------------------------------------------------
       
   231 //
       
   232 inline CFbsBitmapDevice* CFepUiBaseCtrl::BitmapDevice()
       
   233     {
       
   234     return iLayoutOwner->BitmapDevice();
       
   235     }
       
   236 
       
   237 // ---------------------------------------------------------------------------
       
   238 // get Mask bitmap device for sprite or window
       
   239 // ---------------------------------------------------------------------------
       
   240 //
       
   241 inline CFbsBitmapDevice* CFepUiBaseCtrl::MaskBitmapDevice()
       
   242     {
       
   243     return iLayoutOwner->MaskBmpDevice();
       
   244     }
       
   245  
       
   246 
       
   247 // ---------------------------------------------------------------------------
       
   248 // get control pointer down status
       
   249 // ---------------------------------------------------------------------------
       
   250 //
       
   251 inline TBool CFepUiBaseCtrl::PointerDown()
       
   252     {
       
   253     return iPointerDown;
       
   254     }
       
   255     
       
   256 // ---------------------------------------------------------------------------
       
   257 // change control pointer down status
       
   258 // ---------------------------------------------------------------------------
       
   259 //
       
   260 inline void CFepUiBaseCtrl::SetPointerDown(TBool aFlag)
       
   261     {
       
   262     iPointerDown = aFlag;
       
   263     if(!aFlag)
       
   264         iPointerLeft = EFalse;
       
   265     }
       
   266 // ---------------------------------------------------------------------------
       
   267 // get control background maks bmp
       
   268 // ---------------------------------------------------------------------------
       
   269 //
       
   270 inline CFbsBitmap* CFepUiBaseCtrl::BkMaskBmp()
       
   271     {
       
   272     return iBkMaskBmp;
       
   273     }
       
   274     
       
   275 // ---------------------------------------------------------------------------
       
   276 // get control background bmp
       
   277 // ---------------------------------------------------------------------------
       
   278 //
       
   279 inline CFbsBitmap* CFepUiBaseCtrl::BackgroundBmp()
       
   280     {
       
   281     return iBackgroundBmp;
       
   282     }
       
   283 
       
   284 // ---------------------------------------------------------------------------
       
   285 // set control background bmp
       
   286 // ---------------------------------------------------------------------------
       
   287 //
       
   288 inline void CFepUiBaseCtrl::SetBackgroundBmp(CFbsBitmap* aBmp)
       
   289     {
       
   290     iBackgroundBmp = aBmp;
       
   291     }
       
   292 
       
   293 // ---------------------------------------------------------------------------
       
   294 // set control background mask bmp
       
   295 // ---------------------------------------------------------------------------
       
   296 //
       
   297 inline void CFepUiBaseCtrl::SetBackgroundMaskBmp(CFbsBitmap* aBmp)
       
   298     {
       
   299     iBkMaskBmp = aBmp;
       
   300     }
       
   301 
       
   302 // ---------------------------------------------------------------------------
       
   303 // Get overlap falg. Tell whether it allows other control moving on top of it
       
   304 // ---------------------------------------------------------------------------
       
   305 //
       
   306 inline TBool CFepUiBaseCtrl::AllowOverlap()
       
   307     {
       
   308     return iAllowOverlap;
       
   309     }
       
   310     
       
   311 // ---------------------------------------------------------------------------
       
   312 // Set overlap falg.
       
   313 // ---------------------------------------------------------------------------
       
   314 //
       
   315 inline void CFepUiBaseCtrl::SetAllowOverlap(TBool aFlag)
       
   316     {
       
   317     iAllowOverlap = aFlag;
       
   318     }
       
   319   
       
   320 // ---------------------------------------------------------------------------
       
   321 // Get shadow area rect
       
   322 // ---------------------------------------------------------------------------
       
   323 //   
       
   324 inline TRect CFepUiBaseCtrl::ShadowAreaRect(TShadowBitmapIndex aIndex)
       
   325     {
       
   326     return iShadowAreaRect[aIndex];
       
   327     }
       
   328     
       
   329 // ---------------------------------------------------------------------------
       
   330 // Get window based control
       
   331 // ---------------------------------------------------------------------------
       
   332 //       
       
   333 inline CCoeControl* CFepUiBaseCtrl::WndBasedControl()
       
   334     {
       
   335     return iWndControl;
       
   336     }
       
   337 
       
   338 // ---------------------------------------------------------------------------
       
   339 // set pen size for control border
       
   340 // ---------------------------------------------------------------------------	
       
   341 inline void CFepUiBaseCtrl::SetBorderSize(const TSize& aSize)
       
   342 	{
       
   343 	iBorderSize = aSize;
       
   344 	}
       
   345     
       
   346 // ---------------------------------------------------------------------------
       
   347 // get pen size for control border
       
   348 // ---------------------------------------------------------------------------	 
       
   349 inline const TSize& CFepUiBaseCtrl::BorderSize()
       
   350 	{
       
   351 	return iBorderSize;
       
   352 	}
       
   353 
       
   354 // ---------------------------------------------------------------------------
       
   355 // set border color
       
   356 // ---------------------------------------------------------------------------		
       
   357 inline void CFepUiBaseCtrl::SetBorderColor(const TRgb& aCol)
       
   358 	{
       
   359 	iBorderColor = aCol;
       
   360 	}
       
   361 
       
   362 // ---------------------------------------------------------------------------
       
   363 // Get border color
       
   364 // ---------------------------------------------------------------------------	
       
   365 inline const TRgb& CFepUiBaseCtrl::BorderColor()
       
   366 	{
       
   367 	return iBorderColor;
       
   368 	}
       
   369 
       
   370 // ---------------------------------------------------------------------------
       
   371 // Get resource Id
       
   372 // ---------------------------------------------------------------------------
       
   373 inline TInt32 CFepUiBaseCtrl::ResourceId()
       
   374     {
       
   375     return iResourceId;
       
   376     }
       
   377 
       
   378 inline CFepUiBaseCtrl* CFepUiBaseCtrl::ParentCtrl()    
       
   379     {
       
   380     return iParentCtrl;
       
   381     }
       
   382 inline void CFepUiBaseCtrl::EnableRegionUpdating()
       
   383     {
       
   384     iUpdateFlagEnabled = ETrue;    
       
   385     }
       
   386     
       
   387 inline void CFepUiBaseCtrl::DisableRegionUpdating()
       
   388     {
       
   389     iUpdateFlagEnabled = EFalse;    
       
   390     }
       
   391    
       
   392 inline void CFepUiBaseCtrl::SetHidenFlag(TBool aFlag)
       
   393     {
       
   394     iHiden = aFlag;
       
   395     }
       
   396     
       
   397 inline CCoeControl* CFepUiBaseCtrl::WndControl()
       
   398     {
       
   399     return iWndControl;
       
   400     }
       
   401     
       
   402     
       
   403 inline TInt CFepUiBaseCtrl::OrderPos() const
       
   404     {
       
   405     return iOrdinalPos;
       
   406     }
       
   407 
       
   408 // ---------------------------------------------------------------------------
       
   409 // Advanced Tactile feedback REQ417-47932
       
   410 // get tactile feedback type
       
   411 // ---------------------------------------------------------------------------
       
   412 //
       
   413 inline TInt CFepUiBaseCtrl::TactileFeedbackType() const
       
   414     {
       
   415     return reinterpret_cast<CFepUiBaseCtrlExtension*>(iReservered1)->TactileFeedbackType();	
       
   416     }
       
   417 //end of file