textinput/peninputarc/inc/peninputlayoutcontrolinc/peninputlayouthwrwnd.inl
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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 HWR window base and transparent window
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 const TInt KFixedStartTime = 1000000; // 1s
       
    20 const TInt KFixedStartAdjustTime = 100000; //100ms
       
    21 const TInt KFixedIntervalTime = 300000; // 300ms
       
    22 const TInt KFixedIntervalAdjustTime = 30000; // 30ms
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // Get stroke list
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 inline const RArray<TPoint>& CHwrWndBase::StrokeList()
       
    29     {
       
    30     return iListOfPoints;
       
    31     }
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // Set HWR recognizer
       
    35 // -----------------------------------------------------------------------------
       
    36 //    
       
    37 /*inline void CHwrWndBase::SetRecognizer(MHwRecognizer* aRecognizer)
       
    38     {
       
    39     iRecognizer=aRecognizer;
       
    40     }    
       
    41     */
       
    42 // -----------------------------------------------------------------------------
       
    43 // Set stroke delay timer -- The interval for recognition
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 inline void CHwrWndBase::SetStrokeDelay(TTimeIntervalMicroSeconds32 aStrokeDelay)
       
    47     {
       
    48     iStrokeDelay = aStrokeDelay;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // Set character timer
       
    53 // -----------------------------------------------------------------------------
       
    54 //    
       
    55 inline void CHwrWndBase::SetCharacterDelay(TTimeIntervalMicroSeconds32 aCharDelay)
       
    56     {
       
    57     iCharDelay=aCharDelay;
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // Set stroke end mark
       
    62 // -----------------------------------------------------------------------------
       
    63 //    
       
    64 inline void CHwrWndBase::SetStrokeEndMark (const TPoint& aPt)
       
    65     {
       
    66     iStrokeEndMark = aPt;
       
    67     }
       
    68     
       
    69 // -----------------------------------------------------------------------------
       
    70 // Get current candidate
       
    71 // -----------------------------------------------------------------------------
       
    72 //    
       
    73 /*inline const RPointerArray<HBufC>& CHwrWndBase::CandidateData()
       
    74     {
       
    75     return iResult;
       
    76     }
       
    77 */
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // Get stroke end mark
       
    81 // -----------------------------------------------------------------------------
       
    82 //        
       
    83 inline const TPoint& CHwrWndBase::StrokeEndMark()
       
    84     {
       
    85     return iStrokeEndMark;
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // Get previous stroke point
       
    90 // -----------------------------------------------------------------------------
       
    91 //    
       
    92 /*inline const TPoint& CHwrWndBase::PrevPoint()
       
    93     {
       
    94     return iPtPrev;
       
    95     }
       
    96 */
       
    97 // -----------------------------------------------------------------------------
       
    98 // Get dirty rect
       
    99 // -----------------------------------------------------------------------------
       
   100 //    
       
   101 inline TRect& CHwrWndBase::DirtyRect()
       
   102     {
       
   103     return iDirtyRect;
       
   104     }
       
   105 
       
   106     
       
   107 // -----------------------------------------------------------------------------
       
   108 // get new trace flag
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 inline TBool CHwrWndBase::HasNewTrace()
       
   112     {
       
   113     return iHasNewTrace;
       
   114     }
       
   115     
       
   116     
       
   117 // -----------------------------------------------------------------------------
       
   118 // Set border corlor. Obsolete.
       
   119 // -----------------------------------------------------------------------------
       
   120 //    
       
   121 inline void CHwrWndBase::SetFrameCol(const TRgb& aCol)
       
   122 	{
       
   123 	SetBorderColor(aCol);
       
   124 	}
       
   125 	
       
   126 // -----------------------------------------------------------------------------
       
   127 // get border corlor. Obsolete.
       
   128 // -----------------------------------------------------------------------------
       
   129 //    
       
   130 inline const TRgb& CHwrWndBase::FrameCol()
       
   131 	{
       
   132 	return BorderColor();
       
   133 	}
       
   134 	
       
   135 // -----------------------------------------------------------------------------
       
   136 // Set clip region
       
   137 // -----------------------------------------------------------------------------
       
   138 //  	
       
   139 inline void CTransparentHwrWnd::SetClipRegion()
       
   140     {
       
   141     if(iTraceOutsideWindowFlag) //do nothing if able to write outside of window
       
   142         return;
       
   143     CFbsBitGc* gc= static_cast<CFbsBitGc*> (BitGc());    
       
   144     gc->SetClippingRect(Rect());        
       
   145     }
       
   146     
       
   147 // -----------------------------------------------------------------------------
       
   148 // Cancel clip region
       
   149 // -----------------------------------------------------------------------------
       
   150 //      
       
   151 inline void CTransparentHwrWnd::CancelClipRegion()
       
   152     {
       
   153     if(iTraceOutsideWindowFlag)//do nothing if able to write outside of window
       
   154         return;
       
   155     
       
   156     CFbsBitGc* gc= static_cast<CFbsBitGc*> (BitGc());    
       
   157     gc->CancelClippingRect();     
       
   158     }
       
   159     
       
   160 // -----------------------------------------------------------------------------
       
   161 // get transparency factor
       
   162 // -----------------------------------------------------------------------------
       
   163 // 
       
   164 inline TUint8 CTransparentHwrWnd::TransparencyFactor()
       
   165     {
       
   166     return iTransparencyFactor;
       
   167     }
       
   168     
       
   169 // -----------------------------------------------------------------------------
       
   170 // enable/disable fade
       
   171 // -----------------------------------------------------------------------------
       
   172 // 
       
   173 inline void CTransparentHwrWndExt::SetEnableFade( TBool aEnable )
       
   174     {
       
   175     iEnableFade = aEnable;
       
   176     }		
       
   177 // -----------------------------------------------------------------------------
       
   178 // set fading speed.
       
   179 // -----------------------------------------------------------------------------
       
   180 // 
       
   181 inline void CTransparentHwrWndExt::SetFadingSpeed(TInt aFadingSpeed)
       
   182     {
       
   183     switch ( aFadingSpeed )
       
   184         {
       
   185         case 1:
       
   186             {
       
   187             iFadeBeginTime = KFixedStartTime - KFixedStartAdjustTime*2; // 800ms
       
   188             iFadeIntervalTime = KFixedIntervalTime - KFixedIntervalAdjustTime*2; // 240ms
       
   189             }
       
   190             break;
       
   191         case 2:
       
   192             {
       
   193             iFadeBeginTime = KFixedStartTime - KFixedStartAdjustTime; // 900ms
       
   194             iFadeIntervalTime = KFixedIntervalTime - KFixedIntervalAdjustTime; // 270ms
       
   195             }
       
   196             break;
       
   197         case 3:
       
   198             {
       
   199             iFadeBeginTime = KFixedStartTime; // 1s
       
   200             iFadeIntervalTime = KFixedIntervalTime; // 300ms
       
   201             }
       
   202             break;
       
   203         case 4:
       
   204             {
       
   205             iFadeBeginTime = KFixedStartTime + KFixedStartAdjustTime; // 1.2s
       
   206             iFadeIntervalTime = KFixedIntervalTime + KFixedIntervalAdjustTime; // 330ms
       
   207             }
       
   208             break;
       
   209         case 5:
       
   210             {
       
   211             iFadeBeginTime = KFixedStartTime + KFixedStartAdjustTime*2; // 1.4s
       
   212             iFadeIntervalTime = KFixedIntervalTime + KFixedIntervalAdjustTime*2; // 360ms
       
   213             }
       
   214             break;
       
   215         }    
       
   216     }
       
   217 //end of file
       
   218