textinput/peninputhwrboxcn/ctrlsrc/peninputhwrboxgroup.cpp
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  The class of handwriting box container implemention.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <AknLayoutDef.h>
       
    20 #include <AknsUtils.h>
       
    21 #include <coemain.h>
       
    22 #include <barsread.h>
       
    23 
       
    24 #include "peninputhwrboxgroup.h"
       
    25 #include "peninputhwrctrlid.h"
       
    26 #include "peninputhwrevent.h"
       
    27 
       
    28 const TUint32 KDefaultWriteBoxBgColor = 0xdddddd;
       
    29 const TUint32 KDefaultWriteBoxFrameColor = 0x000000;
       
    30 const TInt32 KInvalidResId = -1;
       
    31 
       
    32 // constant definition
       
    33 const TInt KDefaultStrokeEndMarkX = -65536;
       
    34 const TInt KDefaultStrokeEndMarkY = -65536;
       
    35 
       
    36 // Implementation of Class CAknFepHwrBoxGroup 
       
    37 // The container class of HWR boxes
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CAknFepHwrBoxGroup::NewL
       
    41 // factory function
       
    42 // (other items were commented in a header).
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 CAknFepHwrBoxGroup* CAknFepHwrBoxGroup::NewL(CFepUiLayout* aUiLayout,
       
    46                                              TInt aBoxGroupId,
       
    47                                              TInt aBoxCount)
       
    48     {
       
    49     CAknFepHwrBoxGroup* self = new (ELeave) CAknFepHwrBoxGroup(aUiLayout, aBoxGroupId);
       
    50     CleanupStack::PushL(self);
       
    51     self->ConstructL(aBoxCount);
       
    52     CleanupStack::Pop(self);
       
    53     return self;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CAknFepHwrBoxGroup::NewLC
       
    58 // factory function
       
    59 // (other items were commented in a header).
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CAknFepHwrBoxGroup* CAknFepHwrBoxGroup::NewLC(CFepUiLayout* aUiLayout,
       
    63                                               TInt aBoxGroupId,
       
    64                                               TInt aBoxCount)
       
    65     {
       
    66     CAknFepHwrBoxGroup* self = new (ELeave) CAknFepHwrBoxGroup(aUiLayout, aBoxGroupId);
       
    67     CleanupStack::PushL(self);
       
    68     self->ConstructL(aBoxCount);
       
    69     return self;
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CAknFepHwrBoxGroup::~CAknFepHwrBoxGroup
       
    74 // Destructor
       
    75 // (other items were commented in a header).
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 CAknFepHwrBoxGroup::~CAknFepHwrBoxGroup()
       
    79     {
       
    80     // base class CControlGroup frees all controls in the list
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CAknFepHwrBoxGroup::ConstructFromResourceL
       
    85 // (other items were commented in a header).
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CAknFepHwrBoxGroup::ConstructFromResourceL( TResourceReader& aReader)
       
    89     {
       
    90     // get write box bg color
       
    91     TInt32 colorMajorSkinId = aReader.ReadInt32();
       
    92     TInt skinitemid= aReader.ReadInt16();
       
    93     TInt coloridx = aReader.ReadInt16();
       
    94 
       
    95     TAknsItemID colorid;
       
    96     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
    97 
       
    98     TRgb boxcolor;
       
    99     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
       
   100     TInt error = AknsUtils::GetCachedColor(skininstance, 
       
   101                                            boxcolor, 
       
   102                                            colorid, 
       
   103                                            coloridx);
       
   104 
       
   105     if (error != KErrNone)
       
   106         {
       
   107     	boxcolor = TRgb(KDefaultWriteBoxBgColor);
       
   108         }
       
   109 
       
   110     SetBoxBackColor(boxcolor); 
       
   111         
       
   112     skinitemid = aReader.ReadInt16();
       
   113     coloridx = aReader.ReadInt16();
       
   114     
       
   115     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
   116     
       
   117     TRgb boxframecolor;
       
   118     error = AknsUtils::GetCachedColor(skininstance, 
       
   119                                       boxframecolor, 
       
   120                                       colorid, 
       
   121                                       coloridx);
       
   122 
       
   123     if (error != KErrNone)
       
   124         {
       
   125     	boxframecolor = TRgb(KDefaultWriteBoxFrameColor);
       
   126         }
       
   127 
       
   128     SetBoxFrameColor(boxframecolor);
       
   129 
       
   130     iFirstTimeConstruct = EFalse;
       
   131     }
       
   132     
       
   133 // -----------------------------------------------------------------------------
       
   134 // CAknFepHwrBoxGroup::ConstructFromResourceL
       
   135 // (other items were commented in a header).
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 void CAknFepHwrBoxGroup::ConstructFromResourceL()
       
   139     {
       
   140     if (iResourceId == KInvalidResId)
       
   141     	{
       
   142     	User::Leave(KErrArgument);
       
   143     	}
       
   144 
       
   145     TResourceReader reader;
       
   146     CCoeEnv::Static()->CreateResourceReaderLC(reader, iResourceId);
       
   147 
       
   148     // get write box bg color
       
   149     TInt32 colorMajorSkinId = reader.ReadInt32();
       
   150     TInt skinitemid = reader.ReadInt16();
       
   151     TInt coloridx = reader.ReadInt16();
       
   152 
       
   153     TAknsItemID colorid;
       
   154     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
   155 
       
   156     TRgb boxcolor;
       
   157     MAknsSkinInstance* skininstance = AknsUtils::SkinInstance();
       
   158     TInt error = AknsUtils::GetCachedColor(skininstance, 
       
   159                                            boxcolor, 
       
   160                                            colorid, 
       
   161                                            coloridx);
       
   162 
       
   163     if (error != KErrNone)
       
   164         {
       
   165         boxcolor = TRgb(KDefaultWriteBoxBgColor);
       
   166         }
       
   167     
       
   168     SetBoxBackColor(boxcolor);
       
   169 
       
   170     skinitemid = reader.ReadInt16();
       
   171     coloridx = reader.ReadInt16();
       
   172     
       
   173     colorid.Set(TInt(colorMajorSkinId), skinitemid);
       
   174     
       
   175     TRgb boxframecolor;
       
   176     error = AknsUtils::GetCachedColor(skininstance, 
       
   177                                       boxframecolor, 
       
   178                                       colorid, 
       
   179                                       coloridx);
       
   180 
       
   181     if (error != KErrNone)
       
   182         {
       
   183     	boxframecolor = TRgb(KDefaultWriteBoxFrameColor);
       
   184         }
       
   185     
       
   186     SetBoxFrameColor(boxframecolor);
       
   187 
       
   188     CleanupStack::PopAndDestroy(); // reader
       
   189     
       
   190     iFirstTimeConstruct = EFalse;
       
   191     }
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // CAknFepHwrBoxGroup::BoxCount
       
   195 // Clear current handwriting trail if any.
       
   196 // (other items were commented in a header).
       
   197 // -----------------------------------------------------------------------------
       
   198 //
       
   199 TInt CAknFepHwrBoxGroup::BoxCount()
       
   200     {
       
   201     return NumOfControls();
       
   202     }
       
   203 
       
   204 // -----------------------------------------------------------------------------
       
   205 // CAknFepHwrBoxGroup::CancelWriting
       
   206 // Clear current handwriting trail if any.
       
   207 // (other items were commented in a header).
       
   208 // -----------------------------------------------------------------------------
       
   209 //
       
   210 void CAknFepHwrBoxGroup::CancelWriting()
       
   211     {
       
   212     if( !iActiveBox )
       
   213         {
       
   214         //there is nothing to cancel
       
   215         return;
       
   216         }
       
   217 
       
   218     iActiveBox->SetWndTransparencyFactor(iInactiveTrans);
       
   219     iActiveBox->CancelCharWriting();
       
   220     }
       
   221     
       
   222 const RArray<TPoint>& CAknFepHwrBoxGroup::StrokeList()
       
   223     {
       
   224     ASSERT( iActiveBox != NULL );
       
   225     
       
   226     return iActiveBox->StrokeList();
       
   227     }
       
   228 
       
   229 // -----------------------------------------------------------------------------
       
   230 // CAknFepHwrBoxGroup::SizeChanged
       
   231 // Hand size change event.
       
   232 // (other items were commented in a header).
       
   233 // -----------------------------------------------------------------------------
       
   234 //
       
   235 void CAknFepHwrBoxGroup::SizeChanged(const TRect& aRect)
       
   236     {
       
   237     TInt boxWidth = aRect.Width() / NumOfControls();
       
   238     TInt curLeft = aRect.iTl.iX;
       
   239     
       
   240     SetRect(aRect);
       
   241     
       
   242     for( TInt j = 0; j < NumOfControls(); j++, curLeft += boxWidth )
       
   243         {
       
   244         At(j)->SetRect( TRect(curLeft, aRect.iTl.iY, 
       
   245                               curLeft + boxWidth,
       
   246                               aRect.iBr.iY) );
       
   247         }
       
   248         
       
   249     RefreshUI();
       
   250     }
       
   251 
       
   252 // -----------------------------------------------------------------------------
       
   253 // CAknFepHwrBoxGroup::SizeChanged
       
   254 // Hand size change event.
       
   255 // (other items were commented in a header).
       
   256 // -----------------------------------------------------------------------------
       
   257 //
       
   258 void CAknFepHwrBoxGroup::SizeChanged()
       
   259     {
       
   260     //load Laf data and set all boxes size 
       
   261     //TRect aRect = somecode_load_laf_data;
       
   262     //SizeChanged(aRect);
       
   263     }
       
   264 
       
   265 // -----------------------------------------------------------------------------
       
   266 // CAknFepHwrBoxGroup::SetBoxBackColor
       
   267 // (other items were commented in a header).
       
   268 // -----------------------------------------------------------------------------
       
   269 //
       
   270 void CAknFepHwrBoxGroup::SetBoxBackColor(const TRgb aCol)
       
   271     {
       
   272     for( TInt j = 0; j < NumOfControls(); j++ )
       
   273         {
       
   274         At(j)->SetBkColor(aCol);
       
   275         }
       
   276     }
       
   277 
       
   278 // -----------------------------------------------------------------------------
       
   279 // CAknFepHwrBoxGroup::SetBoxFrameColor
       
   280 // (other items were commented in a header).
       
   281 // -----------------------------------------------------------------------------
       
   282 //
       
   283 void CAknFepHwrBoxGroup::SetBoxFrameColor(const TRgb aCol)
       
   284     {
       
   285     for( TInt j = 0; j < NumOfControls(); j++ )
       
   286         {
       
   287         static_cast<CTransparentHwrWnd*>(At(j))->SetFrameCol(aCol);
       
   288         }
       
   289     }
       
   290 
       
   291 // -----------------------------------------------------------------------------
       
   292 // CAknFepHwrBoxGroup::SetTransparency
       
   293 // (other items were commented in a header).
       
   294 // -----------------------------------------------------------------------------
       
   295 //
       
   296 void CAknFepHwrBoxGroup::SetTransparency(const TUint8 aActiveTrans, const TUint8 aInactiveTrans)
       
   297     {
       
   298 #ifdef __ALPHA_TRANCEPARENCY__
       
   299     iActiveTrans = aActiveTrans;
       
   300     iInactiveTrans = aInactiveTrans;
       
   301 #else    
       
   302     iActiveTrans = 255 - aActiveTrans;
       
   303     iInactiveTrans = 255 - aInactiveTrans;
       
   304 #endif    
       
   305 
       
   306     for( TInt j = 0; j < NumOfControls(); j++ )
       
   307         {
       
   308         if( At(j) != iActiveBox)
       
   309             {
       
   310             static_cast<CTransparentHwrWnd*>(At(j))->SetWndTransparencyFactor(iInactiveTrans);
       
   311             }
       
   312         else
       
   313             {
       
   314             static_cast<CTransparentHwrWnd*>(At(j))->SetWndTransparencyFactor(iActiveTrans);
       
   315             }
       
   316         }
       
   317     }
       
   318 // -----------------------------------------------------------------------------
       
   319 // from base class MAknFepHwrPropertySubscriber
       
   320 // CAknFepHwrBoxGroup::SetPropertyL
       
   321 // (other items were commented in a header).
       
   322 // -----------------------------------------------------------------------------
       
   323 //
       
   324 void CAknFepHwrBoxGroup::SetPropertyL(const TAknFepHwrProperty aPropertyName, 
       
   325                                      const TDesC& aPropertyValue)
       
   326     {
       
   327     switch( aPropertyName )
       
   328         {
       
   329         case EAknFepHwrPropertyWriteSpeed:
       
   330             {
       
   331             const TTimeIntervalMicroSeconds32 speed = 
       
   332                                            *(TTimeIntervalMicroSeconds32 *)(aPropertyValue.Ptr());//lint !e826
       
   333             SetWritingSpeed( speed );
       
   334             }
       
   335             break;
       
   336         case EAknFepHwrPropertyPenSize:
       
   337             {
       
   338             const TSize penSize = *(TSize *)(aPropertyValue.Ptr());//lint !e826
       
   339             SetBoxPenSize( penSize );
       
   340             }
       
   341             break;
       
   342         case EAknFepHwrPropertyPenColor:
       
   343             {
       
   344             const TRgb color = *(TRgb *)(aPropertyValue.Ptr());//lint !e826
       
   345             SetBoxPenColor( color );
       
   346             }
       
   347             break;
       
   348         case EAknFepHwrPropertyStrokeEndMark:
       
   349             {
       
   350             const TPoint endMark = *(TPoint*)(aPropertyValue.Ptr());
       
   351             SetStrokeEndMark(endMark);
       
   352             }
       
   353             break;
       
   354         default:
       
   355             break;
       
   356         }
       
   357     }
       
   358 
       
   359 // -----------------------------------------------------------------------------
       
   360 // from base class MEventObserver
       
   361 // CAknFepHwrBoxGroup::HandleEvent
       
   362 // Clear current handwriting trail if any.
       
   363 // (other items were commented in a header).
       
   364 // -----------------------------------------------------------------------------
       
   365 //
       
   366 void CAknFepHwrBoxGroup::HandleControlEvent(TInt aEventType, 
       
   367                                            CFepUiBaseCtrl* aCtrl, 
       
   368                                            const TDesC& /*aEventData*/)
       
   369     {
       
   370     CTransparentHwrWnd* hwrWnd = static_cast<CTransparentHwrWnd*>( aCtrl );
       
   371 
       
   372     switch( aEventType )
       
   373         {
       
   374         case EEventHwrStrokeStarted:
       
   375             OnStrokeStarted(hwrWnd);
       
   376             break;
       
   377         case EEventHwrStrokeFinished:
       
   378             OnStrokeFinished(hwrWnd);
       
   379             break;
       
   380         case EEventHwrCharacterTimerOut:
       
   381             OnStrokeCharacterTimerOut(hwrWnd);
       
   382             break;
       
   383         case EEventHwrStrokeCanceled:
       
   384             OnStrokeCanceled(hwrWnd);
       
   385             break;
       
   386         default:
       
   387             //todo: any comments left here
       
   388             break; 
       
   389         }
       
   390     }//lint !e715
       
   391 
       
   392 // -----------------------------------------------------------------------------
       
   393 // CAknFepHwrBoxGroup::CAknFepHwrBoxGroup
       
   394 // C++ constructor.
       
   395 // (other items were commented in a header).
       
   396 // -----------------------------------------------------------------------------
       
   397 //
       
   398 CAknFepHwrBoxGroup::CAknFepHwrBoxGroup(CFepUiLayout* aUiLayout, TInt aBoxGroupId)
       
   399 : CControlGroup(aUiLayout, aBoxGroupId)
       
   400     {
       
   401     }
       
   402 
       
   403 // -----------------------------------------------------------------------------
       
   404 // CAknFepHwrBoxGroup::ConstructL
       
   405 // Symbian secode phase constructor.
       
   406 // (other items were commented in a header).
       
   407 // -----------------------------------------------------------------------------
       
   408 //
       
   409 void CAknFepHwrBoxGroup::ConstructL(TInt aBoxCount)
       
   410     {
       
   411     //leave if invalid aBoxCount
       
   412     ASSERT( aBoxCount > 0 );
       
   413 
       
   414     //call base construct
       
   415     CControlGroup::ConstructL();
       
   416     
       
   417     //create two box hwr window
       
   418     for( TInt i = 0; i < aBoxCount; ++i )
       
   419         {
       
   420         CTransparentHwrWnd* aBox = CTransparentHwrWnd::NewL(TRect(), 
       
   421                                                             UiLayout(), 
       
   422                                                             0, 
       
   423                                                             EFalse);   
       
   424         CleanupStack::PushL( aBox );
       
   425         aBox->AddEventObserver( this );
       
   426         aBox->EnableTraceOutsideWindow(EFalse);
       
   427         AddControlL(aBox);
       
   428         
       
   429         // set default stroke end mark
       
   430         aBox->SetStrokeEndMark(TPoint(KDefaultStrokeEndMarkX, KDefaultStrokeEndMarkY));
       
   431 
       
   432         CleanupStack::Pop(aBox); //aBox
       
   433        }
       
   434     }
       
   435     
       
   436 // -----------------------------------------------------------------------------
       
   437 // CAknFepHwrBoxGroup::SetWritingSpeed
       
   438 // Iterate to set each HWR box writting speed.
       
   439 // (other items were commented in a header).
       
   440 // -----------------------------------------------------------------------------
       
   441 //
       
   442 void CAknFepHwrBoxGroup::SetWritingSpeed(const TTimeIntervalMicroSeconds32& aCharDelay)
       
   443     {
       
   444     for( TInt j = 0; j < NumOfControls(); j++ )
       
   445         {
       
   446         CTransparentHwrWnd* hwrWnd = static_cast<CTransparentHwrWnd*>(At(j));
       
   447         
       
   448         if( hwrWnd )
       
   449             {
       
   450             hwrWnd->SetCharacterDelay(aCharDelay);
       
   451             }
       
   452         }    
       
   453     }
       
   454 
       
   455 // -----------------------------------------------------------------------------
       
   456 // CAknFepHwrBoxGroup::SetBoxPenSize
       
   457 // Iterate to set each HWR box trail drawing pen size.
       
   458 // (other items were commented in a header).
       
   459 // -----------------------------------------------------------------------------
       
   460 //
       
   461 void CAknFepHwrBoxGroup::SetBoxPenSize(const TSize aSize)
       
   462     {
       
   463     for( TInt j = 0; j < NumOfControls(); j++ )
       
   464         {
       
   465         At(j)->SetPenSize(aSize);
       
   466         }
       
   467     }
       
   468 
       
   469 // -----------------------------------------------------------------------------
       
   470 // CAknFepHwrBoxGroup::SetBoxPenColor
       
   471 // Iterate to set each HWR box trail drawing pen color.
       
   472 // (other items were commented in a header).
       
   473 // -----------------------------------------------------------------------------
       
   474 //
       
   475 void CAknFepHwrBoxGroup::SetBoxPenColor(const TRgb aCol)
       
   476     {
       
   477     for( TInt j = 0; j < NumOfControls(); j++ )
       
   478         {
       
   479         At(j)->SetPenColor(aCol);
       
   480         }
       
   481     }
       
   482 
       
   483 // -----------------------------------------------------------------------------
       
   484 // CAknFepHwrBoxGroup::SetStrokEndMark
       
   485 // Iterate to set each HWR box stroke end mark.
       
   486 // (other items were commented in a header).
       
   487 // -----------------------------------------------------------------------------
       
   488 //
       
   489 void CAknFepHwrBoxGroup::SetStrokeEndMark(const TPoint& aEndMard)
       
   490     {
       
   491     for( TInt j = 0; j < NumOfControls(); j++ )
       
   492         {
       
   493         static_cast<CTransparentHwrWnd*>(At(j))->SetStrokeEndMark(aEndMard);
       
   494         }
       
   495     }
       
   496 // -----------------------------------------------------------------------------
       
   497 // CAknFepHwrBoxGroup::OnStrokeStarted
       
   498 // Handle EEventHwrStrokeStarted event.
       
   499 // (other items were commented in a header).
       
   500 // -----------------------------------------------------------------------------
       
   501 //
       
   502 void CAknFepHwrBoxGroup::OnStrokeStarted(CTransparentHwrWnd* aBoxFrom)
       
   503     {
       
   504     TBool refresh = EFalse;
       
   505     
       
   506     if( !iActiveBox )
       
   507         {
       
   508         //change state from not writing to begin writing
       
   509         iActiveBox = aBoxFrom;
       
   510         refresh = ETrue;
       
   511         
       
   512         ReportEvent(EHwrEventBeginWriting);
       
   513         //set current box transparency  
       
   514         iActiveBox->SetWndTransparencyFactor(iActiveTrans);
       
   515         }
       
   516     else
       
   517         {
       
   518         if( iActiveBox != aBoxFrom )
       
   519             {
       
   520             // current active box will turn into inactive state
       
   521             iActiveBox->SetWndTransparencyFactor(iInactiveTrans);
       
   522             // user switches to another box 
       
   523             if( iActiveBox->HasNewTrace() )
       
   524                 {
       
   525                 OnStrokeFinished(iActiveBox);
       
   526                 }
       
   527             // handler of EHwrEventNewWriting submit default candidate
       
   528             // reset state
       
   529             ReportEvent(EHwrEventNewWriting);
       
   530             // clear writing of the last box
       
   531             CancelWriting();
       
   532             
       
   533             iActiveBox = aBoxFrom;
       
   534             refresh = ETrue;
       
   535             
       
   536             //set current box transparency  
       
   537             iActiveBox->SetWndTransparencyFactor(iActiveTrans);
       
   538             }
       
   539         else
       
   540             {
       
   541             ReportEvent(EHwrEventBeginWriting);
       
   542             }
       
   543         }
       
   544     
       
   545     if( refresh )
       
   546         {
       
   547         // only active box need update
       
   548         // inactive box is already update by CancelWriting
       
   549         RefreshUI(iActiveBox);
       
   550         }
       
   551     }
       
   552 
       
   553 // -----------------------------------------------------------------------------
       
   554 // CAknFepHwrBoxGroup::StrokeStrokeFinished
       
   555 // Handle EEventHwrStrokeFinished event.
       
   556 // (other items were commented in a header).
       
   557 // -----------------------------------------------------------------------------
       
   558 //
       
   559 void CAknFepHwrBoxGroup::OnStrokeFinished(CTransparentHwrWnd* /* aBoxFrom */)
       
   560     {
       
   561     // Get stroke list is called by event handler
       
   562     TPtrC ptr;
       
   563     RArray<TPoint>* strokeList = const_cast<RArray<TPoint>* >(&(StrokeList()));
       
   564     ptr.Set(reinterpret_cast<TText*>(strokeList), sizeof(strokeList));
       
   565     ReportEvent(EHwrEventEndStroke, ptr);
       
   566     }
       
   567 
       
   568 // -----------------------------------------------------------------------------
       
   569 // CAknFepHwrBoxGroup::StrokeCharacterTimerOut
       
   570 // Handle EEventHwrCharacterTimerOut event.
       
   571 // (other items were commented in a header).
       
   572 // -----------------------------------------------------------------------------
       
   573 //
       
   574 void CAknFepHwrBoxGroup::OnStrokeCharacterTimerOut(CTransparentHwrWnd* aBoxFrom)
       
   575     {
       
   576     aBoxFrom->SetWndTransparencyFactor(iInactiveTrans);
       
   577     ReportEvent(EHwrEventEndWriting);
       
   578     
       
   579     if( iActiveBox == aBoxFrom )
       
   580         {
       
   581         iActiveBox = NULL;
       
   582         }
       
   583 
       
   584     RefreshUI(aBoxFrom);
       
   585     }
       
   586 
       
   587 // -----------------------------------------------------------------------------
       
   588 // CAknFepHwrBoxGroup::OnStrokeCanceled
       
   589 // Handle EEventHwrStrokeCanceled event.
       
   590 // (other items were commented in a header).
       
   591 // -----------------------------------------------------------------------------
       
   592 //
       
   593 void CAknFepHwrBoxGroup::OnStrokeCanceled(CTransparentHwrWnd* aBoxFrom)
       
   594     {
       
   595     if( iActiveBox == aBoxFrom )
       
   596         {
       
   597         iActiveBox = NULL;
       
   598         }
       
   599     }
       
   600 // -----------------------------------------------------------------------------
       
   601 // CAknFepHwrBoxGroup::RefreshUI
       
   602 // Explicit refresh HWR boxes UI.
       
   603 // (other items were commented in a header).
       
   604 // -----------------------------------------------------------------------------
       
   605 //
       
   606 void CAknFepHwrBoxGroup::RefreshUI(CTransparentHwrWnd* aBox)
       
   607     {
       
   608     if( !aBox )
       
   609         {
       
   610         if( Hiden() )
       
   611             {
       
   612             return;
       
   613             }
       
   614             
       
   615         Draw();
       
   616         UpdateArea(Rect(), EFalse);        
       
   617         }
       
   618     else
       
   619         {
       
   620         if( !aBox->Hiden() )
       
   621             {
       
   622             aBox->Draw();
       
   623             UpdateArea(aBox->Rect(), EFalse);        
       
   624             }
       
   625         }
       
   626     }
       
   627 
       
   628 // -----------------------------------------------------------------------------
       
   629 // CAknFepHwrBoxGroup::SubmitWriting
       
   630 // Submit first candidate in candidate buffer immediatelly.
       
   631 // (other items were commented in a header).
       
   632 // -----------------------------------------------------------------------------
       
   633 //
       
   634 void CAknFepHwrBoxGroup::SubmitWriting()
       
   635     {
       
   636     if( !iActiveBox )
       
   637         {
       
   638         return;
       
   639         }
       
   640         
       
   641     //iActiveBox->SetTransparency(iInactiveTrans);
       
   642     //todo call some base method to clear and submit
       
   643     //iActiveBox->EndStrokeDirectly();
       
   644     }
       
   645 
       
   646 // -----------------------------------------------------------------------------
       
   647 // CAknFepHwrBoxGroup::StrokeEndMark
       
   648 // (other items were commented in a header).
       
   649 // -----------------------------------------------------------------------------
       
   650 //
       
   651 TPoint CAknFepHwrBoxGroup::StrokeEndMark()
       
   652     { 
       
   653     if (NumOfControls() >= 1)
       
   654         {
       
   655     	return static_cast<CTransparentHwrWnd*>(At(0))->StrokeEndMark();
       
   656         }
       
   657         
       
   658     return TPoint(KDefaultStrokeEndMarkX, KDefaultStrokeEndMarkY);
       
   659     }
       
   660 
       
   661 //End Of File