javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdateeditor.cpp
branchRCL_3
changeset 19 04becd199f91
child 23 98ccebc37403
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*******************************************************************************
       
     2  * Copyright (c) 2005, 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved. This program and the accompanying materials
       
     4  * are made available under the terms of the Eclipse Public License v1.0
       
     5  * which accompanies this distribution, and is available at
       
     6  * http://www.eclipse.org/legal/epl-v10.html
       
     7  *
       
     8  * Contributors:
       
     9  *     Nokia Corporation - S60 implementation
       
    10  *******************************************************************************/
       
    11 
       
    12 
       
    13 #include <eswtcore.rsg>
       
    14 #include <AknLayoutFont.h>
       
    15 #include <AknsControlContext.h>
       
    16 #include <AknsDrawUtils.h>
       
    17 #include <avkon.rsg>
       
    18 #include <AknUtils.h>
       
    19 #include <AknDef.h>
       
    20 #include <swtlaffacade.h>
       
    21 #if defined( RD_SCALABLE_UI_V2 )
       
    22 #include <swtbuttonproxy.h>
       
    23 #include <aknconsts.h>
       
    24 #include <avkon.mbg>
       
    25 #endif // RD_SCALABLE_UI_V2
       
    26 #include "swteditindicator.h"
       
    27 #include "swtfont.h"
       
    28 #include "swtdateeditor.h"
       
    29 
       
    30 
       
    31 // ======== MEMBER FUNCTIONS ========
       
    32 
       
    33 
       
    34 // ---------------------------------------------------------------------------------------------
       
    35 // CSwtDateEditor::NewL
       
    36 // ---------------------------------------------------------------------------------------------
       
    37 //
       
    38 CSwtDateEditor* CSwtDateEditor::NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer,
       
    39                                      MSwtComposite& aParent, TInt aStyle)
       
    40 {
       
    41     CSwtDateEditor* self = new(ELeave) CSwtDateEditor(aDisplay, aPeer, aParent, aStyle);
       
    42     CleanupStack::PushL(self);
       
    43     self->ConstructL();
       
    44     self->InitControlBaseL();
       
    45     CleanupStack::Pop(self);
       
    46     return self;
       
    47 }
       
    48 
       
    49 // ---------------------------------------------------------------------------------------------
       
    50 // CSwtDateEditor::CSwtDateEditor
       
    51 // ---------------------------------------------------------------------------------------------
       
    52 //
       
    53 CSwtDateEditor::CSwtDateEditor(MSwtDisplay& aDisplay,
       
    54                                TSwtPeer aPeer,
       
    55                                MSwtComposite& aParent,
       
    56                                TInt aStyle)
       
    57         : ASwtControlBase(aDisplay, aPeer, &aParent, aStyle)
       
    58         , iCurrentFieldLength(0)
       
    59         , iCurrentFieldDecimalPlacesCount(0)
       
    60         , iLastField(0)
       
    61 {
       
    62 }
       
    63 
       
    64 // ---------------------------------------------------------------------------------------------
       
    65 // CSwtDateEditor::~CSwtDateEditor
       
    66 // ---------------------------------------------------------------------------------------------
       
    67 //
       
    68 CSwtDateEditor::~CSwtDateEditor()
       
    69 {
       
    70     iEikonEnv->SyncNotifyFocusObserversOfChangeInFocus();
       
    71     delete iEditor;
       
    72     delete iIndicator;
       
    73     if (iDefaultFont)
       
    74     {
       
    75         iDefaultFont->RemoveRef();
       
    76     }
       
    77 
       
    78 #ifdef _lint
       
    79     iEditor      = NULL;
       
    80     iDefaultFont = NULL;
       
    81 #endif
       
    82 }
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------------------------
       
    86 // CSwtDateEditor::ConstructL
       
    87 // ---------------------------------------------------------------------------------------------
       
    88 //
       
    89 void CSwtDateEditor::ConstructL()
       
    90 {
       
    91     ASSERT(iParent);
       
    92     CCoeControl& coeParent = iParent->Control()->CoeControl();
       
    93     SetContainerWindowL(coeParent);
       
    94     CCoeControl::MakeVisible(coeParent.IsVisible());
       
    95     CCoeControl::SetDimmed(coeParent.IsDimmed());
       
    96     SetComponentsToInheritVisibility(ETrue);
       
    97 
       
    98     CSwtEditIndicatorRedictor* redirector = MopGetObject(redirector);
       
    99     if (redirector)
       
   100     {
       
   101         iIndicator = CSwtEditIndicator::NewL(CoeControl());
       
   102     }
       
   103 
       
   104     // Read the Java Epoc date in the resource file
       
   105     HBufC* minDateString = iEikonEnv->AllocReadResourceLC(R_SWT_DATEEDITOR_MIN_DATE);
       
   106     iEpocDateInMicroSec = TTime(minDateString->Des()).Int64();
       
   107     CleanupStack::PopAndDestroy(minDateString);
       
   108 
       
   109     SetBackground(this);   // Back will be drawn by ASwtControlBase::Draw
       
   110 }
       
   111 
       
   112 // ---------------------------------------------------------------------------------------------
       
   113 // CSwtDateEditor::RetrieveDefaultFontL
       
   114 // ---------------------------------------------------------------------------------------------
       
   115 //
       
   116 void CSwtDateEditor::RetrieveDefaultFontL()
       
   117 {
       
   118     if (iDefaultFont)
       
   119     {
       
   120         iDefaultFont->RemoveRef();
       
   121         iDefaultFont = NULL;
       
   122     }
       
   123     // Not same but similar to Text's font. Height most probably the same.
       
   124     const CFont* font = AknLayoutUtils::FontFromId(CSwtLafFacade::GetFontId(
       
   125                             CSwtLafFacade::EFont2MidpTimePaneT1Font));
       
   126     ASSERT(font);
       
   127     iDefaultFont = CSwtFont::NewL(iDisplay.Device(), *font);
       
   128 
       
   129     if (!iFont)
       
   130     {
       
   131         // to avoid the default font of CEikEdwin
       
   132         ProcessFontUpdate();
       
   133     }
       
   134 }
       
   135 
       
   136 // ---------------------------------------------------------------------------------------------
       
   137 // CSwtDateEditor::ProcessFontUpdate
       
   138 // ---------------------------------------------------------------------------------------------
       
   139 //
       
   140 void CSwtDateEditor::ProcessFontUpdate()
       
   141 {
       
   142     const MSwtFont* swtFont=GetFont();
       
   143     ASSERT(swtFont);
       
   144     const CFont& font = (swtFont->Font());
       
   145     iEditor->SetFont(&font);
       
   146 }
       
   147 
       
   148 // ---------------------------------------------------------------------------------------------
       
   149 // CSwtDateEditor::PrepareForFocusChangeL
       
   150 // ---------------------------------------------------------------------------------------------
       
   151 //
       
   152 void CSwtDateEditor::PrepareForFocusChangeL()
       
   153 {
       
   154     if (IsFocused())
       
   155     {
       
   156         iEditor->PrepareForFocusGainL();
       
   157     }
       
   158     else
       
   159     {
       
   160         iEditor->PrepareForFocusLossL();
       
   161         if (iIndicator)
       
   162         {
       
   163             iIndicator->SetState(EStateNone);
       
   164         }
       
   165     }
       
   166 }
       
   167 
       
   168 // ---------------------------------------------------------------------------------------------
       
   169 // CSwtDateEditor::CountComponentControls
       
   170 // ---------------------------------------------------------------------------------------------
       
   171 //
       
   172 TInt CSwtDateEditor::CountComponentControls() const
       
   173 {
       
   174     TInt count(0);
       
   175     if (iEditor)
       
   176     {
       
   177         count = 1;
       
   178         if (iIndicator)
       
   179         {
       
   180             count++;
       
   181         }
       
   182     }
       
   183     return count;
       
   184 }
       
   185 
       
   186 // ---------------------------------------------------------------------------------------------
       
   187 // CSwtDateEditor::ComponentControl
       
   188 // ---------------------------------------------------------------------------------------------
       
   189 //
       
   190 CCoeControl* CSwtDateEditor::ComponentControl(TInt aIndex) const
       
   191 {
       
   192     ASSERT(iEditor);
       
   193     if (aIndex == 0)
       
   194     {
       
   195         return iEditor;
       
   196     }
       
   197     return iIndicator->IndicatorContainer();
       
   198 }
       
   199 
       
   200 // ---------------------------------------------------------------------------------------------
       
   201 // CSwtDateEditor::FocusChanged
       
   202 // ---------------------------------------------------------------------------------------------
       
   203 //
       
   204 void CSwtDateEditor::FocusChanged(TDrawNow aDrawNow)
       
   205 {
       
   206     if (iEditor)
       
   207     {
       
   208         TRAP_IGNORE(PrepareForFocusChangeL());
       
   209         iEditor->SetFocus(IsFocused());
       
   210     }
       
   211 
       
   212     HandleFocusChanged(aDrawNow);
       
   213 }
       
   214 
       
   215 // ---------------------------------------------------------------------------------------------
       
   216 // CSwtDateEditor::MakeVisible
       
   217 // ---------------------------------------------------------------------------------------------
       
   218 //
       
   219 void CSwtDateEditor::MakeVisible(TBool aVisible)
       
   220 {
       
   221     CCoeControl::MakeVisible(aVisible);
       
   222     FocusabilityChanged();
       
   223 }
       
   224 
       
   225 // ---------------------------------------------------------------------------------------------
       
   226 // CSwtDateEditor::SetBackgroundL
       
   227 // ---------------------------------------------------------------------------------------------
       
   228 //
       
   229 void CSwtDateEditor::SetBackgroundL(const MSwtColor* aColor)
       
   230 {
       
   231     ASwtControlBase::DoSetBackgroundL(aColor);
       
   232     TRgb color((aColor) ? aColor->RgbValue() : iEikonEnv->Color(EColorControlBackground));
       
   233     iEditor->OverrideColorL(EColorControlBackground, color);
       
   234 
       
   235     // While background color is set, the editor's control context must be null,
       
   236     // otherwise there will be ugly background drawing problems while typing.
       
   237     // It looks like there is no need to override FocusBackgroundPolicy,
       
   238     // SetUseOverrideColors causes the editor to ignore the skin back.
       
   239     // If a foreground color has been set, cannot go back to skin colors yet.
       
   240     if (!iFgColorIsCustom)
       
   241     {
       
   242         if (aColor)
       
   243         {
       
   244             iEditor->SetUseOverrideColors(ETrue);
       
   245         }
       
   246         else
       
   247         {
       
   248             iEditor->SetUseOverrideColors(EFalse);
       
   249         }
       
   250     }
       
   251 
       
   252     if (aColor)
       
   253     {
       
   254         iBgColorIsCustom = ETrue;
       
   255     }
       
   256     else
       
   257     {
       
   258         iBgColorIsCustom = EFalse;
       
   259     }
       
   260     
       
   261     Redraw();
       
   262 }
       
   263 
       
   264 // ---------------------------------------------------------------------------------------------
       
   265 // CSwtDateEditor::SetForegroundL
       
   266 // ---------------------------------------------------------------------------------------------
       
   267 //
       
   268 void CSwtDateEditor::SetForegroundL(const MSwtColor* aColor)
       
   269 {
       
   270     ASwtControlBase::DoSetForegroundL(aColor);
       
   271     
       
   272     TRgb color((aColor) ? aColor->RgbValue() : iEikonEnv->Color(EColorControlText));
       
   273     iEditor->OverrideColorL(EColorControlText, color);
       
   274 
       
   275     // If a back color has been set, cannot go back to skin colors yet.
       
   276     if (!iBgColorIsCustom)
       
   277     {
       
   278         if (aColor)
       
   279         {
       
   280             iEditor->SetUseOverrideColors(ETrue);
       
   281         }
       
   282         else
       
   283         {
       
   284             iEditor->SetUseOverrideColors(EFalse);
       
   285         }
       
   286     }
       
   287 
       
   288     if (aColor)
       
   289     {
       
   290         iFgColorIsCustom = ETrue;
       
   291     }
       
   292     else
       
   293     {
       
   294         iFgColorIsCustom = EFalse;
       
   295     }
       
   296     
       
   297     Redraw();
       
   298 }
       
   299 
       
   300 // ---------------------------------------------------------------------------------------------
       
   301 // CSwtDateEditor::OfferKeyEventL
       
   302 // ---------------------------------------------------------------------------------------------
       
   303 //
       
   304 TKeyResponse CSwtDateEditor::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
       
   305 {
       
   306     TBool traversalDoIt = ETrue;
       
   307 
       
   308     if (iEditor)
       
   309     {
       
   310         switch (aKeyEvent.iCode)
       
   311         {
       
   312         case EKeyUpArrow:
       
   313             traversalDoIt = ETrue;
       
   314             break;
       
   315         case EKeyDownArrow:
       
   316             traversalDoIt = ETrue;
       
   317             break;
       
   318         case EKeyRightArrow:
       
   319             traversalDoIt = ((iEditor->CurrentField() == iEditor->NumFields()-1) &&
       
   320                              (GetShell().FindTraversalTargetL(ESwtTraverseArrowNext, *this)));
       
   321             break;
       
   322         case EKeyLeftArrow:
       
   323             traversalDoIt = (iEditor->CurrentField() == 0 &&
       
   324                              GetShell().FindTraversalTargetL(ESwtTraverseArrowNext, *this));
       
   325             break;
       
   326         default:
       
   327             traversalDoIt = ETrue;
       
   328         }
       
   329     }
       
   330 
       
   331     return ASwtControlBase::HandleKeyL(aKeyEvent, aType, traversalDoIt);
       
   332 }
       
   333 
       
   334 // ---------------------------------------------------------------------------------------------
       
   335 // CSwtDateEditor::ProcessKeyEventL
       
   336 // ---------------------------------------------------------------------------------------------
       
   337 //
       
   338 void CSwtDateEditor::ProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
       
   339 {
       
   340     if (!iEditor)
       
   341     {
       
   342         return;
       
   343     }
       
   344 
       
   345     if (aType != EEventKey)
       
   346         return;
       
   347 
       
   348     TInt code = aKeyEvent.iCode;
       
   349     TBool amPmField = IsFieldAmPmField(iEditor->CurrentField());
       
   350     TBool offsetStyleField = IsFieldOffsetStyleField(iEditor->CurrentField());
       
   351 
       
   352     TBool isFieldNumeric = !amPmField && !offsetStyleField;
       
   353     TBool wasFieldChangedAlready = IsCurrentFieldChanged(isFieldNumeric);
       
   354     UpdateFieldCounters(isFieldNumeric, wasFieldChangedAlready);
       
   355 
       
   356     iEditor->OfferKeyEventL(aKeyEvent, aType);
       
   357     //MSK label update may be needed.
       
   358     if (AknLayoutUtils::MSKEnabled())
       
   359     {
       
   360         MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
       
   361         if (commandArranger)
       
   362         {
       
   363             commandArranger->UpdateMSKLabelL();
       
   364         }
       
   365     }
       
   366     // End MSK
       
   367     if (aKeyEvent.iCode == EKeyEnter)
       
   368     {
       
   369         iDisplay.PostDefaultSelectionEventL(iPeer);
       
   370     }
       
   371 
       
   372     TBool isModifyEventAllowed = IsModifyEventAllowed(code, wasFieldChangedAlready);
       
   373 
       
   374     if (isModifyEventAllowed || amPmField || offsetStyleField)
       
   375     {
       
   376         iDisplay.PostModifyEventL(iPeer);
       
   377     }
       
   378 }
       
   379 
       
   380 
       
   381 // ---------------------------------------------------------------------------------------------
       
   382 // CSwtDateEditor::IsFieldChanged
       
   383 // ---------------------------------------------------------------------------------------------
       
   384 //
       
   385 
       
   386 TBool CSwtDateEditor::IsCurrentFieldChanged(TBool aIsFieldNumeric)
       
   387 {
       
   388     TBool isFieldChangedAlready = ETrue;
       
   389     if (aIsFieldNumeric)
       
   390     {
       
   391         isFieldChangedAlready = CEikMfneField::EInverseVideo !=
       
   392                                 iEditor->Field(iEditor->CurrentField())->HighlightType();
       
   393     }
       
   394     return isFieldChangedAlready;
       
   395 }
       
   396 
       
   397 // ---------------------------------------------------------------------------------------------
       
   398 // CSwtDateEditor::IsFieldChanged
       
   399 // ---------------------------------------------------------------------------------------------
       
   400 //
       
   401 
       
   402 void CSwtDateEditor::UpdateFieldCounters(TBool aIsFieldNumeric, TBool aIsFieldChanged)
       
   403 {
       
   404     if (aIsFieldNumeric)
       
   405     {
       
   406         if (!aIsFieldChanged)
       
   407         {
       
   408             TBuf<16> actualText;
       
   409             actualText.AppendNum(
       
   410                 static_cast<CEikMfneNumber*>(iEditor->Field(iEditor->CurrentField()))->Value());
       
   411             iCurrentFieldDecimalPlacesCount = actualText.Length();
       
   412             iCurrentFieldLength = 0;
       
   413         }
       
   414     }
       
   415     else
       
   416     {
       
   417         iCurrentFieldLength = 0;
       
   418         iCurrentFieldDecimalPlacesCount = 0;
       
   419     }
       
   420 }
       
   421 
       
   422 // ---------------------------------------------------------------------------------------------
       
   423 // CSwtDateEditor::IsModifyEventAllowed
       
   424 // ---------------------------------------------------------------------------------------------
       
   425 //
       
   426 TBool CSwtDateEditor::IsModifyEventAllowed(TInt aKeyCode, TBool aWasFieldChangedAlready)
       
   427 {
       
   428     TInt fieldMinimumValue = 0;
       
   429     TInt fieldMaximumValue = 0;
       
   430     CEikMfneNumber* currentField = static_cast<CEikMfneNumber*>(iEditor->Field(iEditor->CurrentField()));
       
   431     currentField->GetMinimumAndMaximum(fieldMaximumValue, fieldMaximumValue);
       
   432     TBuf<16> minText;
       
   433     minText.AppendNum(fieldMinimumValue);
       
   434     TBuf<16> maxText;
       
   435     maxText.AppendNum(fieldMaximumValue);
       
   436     TInt maxDigits = Max(2, Max(minText.Length(), maxText.Length()));
       
   437     TBool isZeroChar = 0 == (aKeyCode - TText(currentField->DigitType()));
       
   438     TBool raiseEvent = ETrue;
       
   439     TBool isArrowKey = (aKeyCode == EKeyLeftArrow) || (aKeyCode == EKeyRightArrow);
       
   440     TChar ch = TChar(aKeyCode);
       
   441 
       
   442     if (iEditor->CurrentField() != iLastField || isArrowKey)
       
   443     {
       
   444         iCurrentFieldLength = 0;
       
   445         iCurrentFieldDecimalPlacesCount = 0;
       
   446         if (isArrowKey && !aWasFieldChangedAlready)
       
   447         {
       
   448             raiseEvent = EFalse;
       
   449         }
       
   450     }
       
   451     else if (EKeyBackspace == aKeyCode)
       
   452     {
       
   453         if (!aWasFieldChangedAlready)
       
   454         {
       
   455             iCurrentFieldLength = maxDigits;
       
   456         }
       
   457 
       
   458         iCurrentFieldLength--;
       
   459         iCurrentFieldDecimalPlacesCount--;
       
   460         if (iCurrentFieldDecimalPlacesCount < 1)
       
   461         {
       
   462             raiseEvent = EFalse;
       
   463         }
       
   464     }
       
   465     else if (ch.IsDigit())
       
   466     {
       
   467         iCurrentFieldLength++;
       
   468         if (iCurrentFieldLength >= maxDigits)
       
   469         {
       
   470             iCurrentFieldLength = 0;
       
   471             iCurrentFieldDecimalPlacesCount = 0;
       
   472         }
       
   473         else
       
   474         {
       
   475             raiseEvent = !isZeroChar || (iCurrentFieldDecimalPlacesCount > 0);
       
   476         }
       
   477         if (!aWasFieldChangedAlready)
       
   478         {
       
   479             iCurrentFieldDecimalPlacesCount = 0;
       
   480         }
       
   481         if (!isZeroChar || (iCurrentFieldDecimalPlacesCount > 0 && isZeroChar))
       
   482         {
       
   483             iCurrentFieldDecimalPlacesCount++;
       
   484         }
       
   485     }
       
   486     else
       
   487     {
       
   488         raiseEvent = false;
       
   489     }
       
   490 
       
   491     iLastField = iEditor->CurrentField();
       
   492 
       
   493     return raiseEvent;
       
   494 }
       
   495 
       
   496 // ---------------------------------------------------------------------------------------------
       
   497 // CSwtDateEditor::IsFieldAmPmField
       
   498 // ---------------------------------------------------------------------------------------------
       
   499 //
       
   500 TBool CSwtDateEditor::IsFieldAmPmField(TInt fieldIndex) const
       
   501 {
       
   502     // current field is am/pm field if it accepts something else than positive integers
       
   503     TBool amPmField = (iDateEditorStyle == MSwtDateEditor::ESwtTime ||
       
   504                        iDateEditorStyle == MSwtDateEditor::ESwtDateTime)  &&
       
   505                       (iEditor->Field(fieldIndex)->InputCapabilities().Capabilities() &
       
   506                        ~TCoeInputCapabilities::EWesternNumericIntegerPositive);
       
   507     return amPmField;
       
   508 }
       
   509 
       
   510 // ---------------------------------------------------------------------------------------------
       
   511 // CSwtDateEditor::IsFieldOffsetStyleField
       
   512 // ---------------------------------------------------------------------------------------------
       
   513 //
       
   514 TBool CSwtDateEditor::IsFieldOffsetStyleField(TInt fieldIndex) const
       
   515 {
       
   516     // current field is +/- field if it accepts something else than positive integers
       
   517     TBool offsetStyleField = (iDateEditorStyle == MSwtDateEditor::ESwtOffset)  &&
       
   518                              (iEditor->Field(fieldIndex)->InputCapabilities().Capabilities() &
       
   519                               ~TCoeInputCapabilities::EWesternNumericIntegerPositive);
       
   520     return offsetStyleField;
       
   521 }
       
   522 
       
   523 // ---------------------------------------------------------------------------------------------
       
   524 // CSwtDateEditor::SetDimmed
       
   525 // ---------------------------------------------------------------------------------------------
       
   526 //
       
   527 void CSwtDateEditor::SetDimmed(TBool aDimmed)
       
   528 {
       
   529     ASSERT(iEditor);
       
   530     CCoeControl::SetDimmed(aDimmed);
       
   531     iEditor->SetDimmed(aDimmed);
       
   532 
       
   533     FocusabilityChanged();
       
   534 }
       
   535 
       
   536 // ---------------------------------------------------------------------------------------------
       
   537 // CSwtDateEditor::HandleResourceChange
       
   538 // ---------------------------------------------------------------------------------------------
       
   539 //
       
   540 void CSwtDateEditor::HandleResourceChange(TInt aType)
       
   541 {
       
   542     TRAP_IGNORE(SwtHandleResourceChangeL(aType));
       
   543 }
       
   544 
       
   545 // ---------------------------------------------------------------------------------------------
       
   546 // CSwtDateEditor::SwtHandleResourceChangeL
       
   547 // ---------------------------------------------------------------------------------------------
       
   548 //
       
   549 void CSwtDateEditor::SwtHandleResourceChangeL(TInt aType)
       
   550 {
       
   551     CAknControl::HandleResourceChange(aType);
       
   552 
       
   553     if (aType == KAknsMessageSkinChange
       
   554             || aType == KEikDynamicLayoutVariantSwitch)
       
   555     {
       
   556         if (!iFont)
       
   557         {
       
   558             RetrieveDefaultFontL();
       
   559         }
       
   560         else
       
   561         {
       
   562             ProcessFontUpdate();
       
   563         }
       
   564         SizeChanged();
       
   565     }
       
   566 }
       
   567 
       
   568 // ---------------------------------------------------------------------------------------------
       
   569 // CSwtDateEditor::SizeChanged
       
   570 // ---------------------------------------------------------------------------------------------
       
   571 //
       
   572 void CSwtDateEditor::SizeChanged()
       
   573 {
       
   574     if (!iEditor)
       
   575     {
       
   576         return;
       
   577     }
       
   578 
       
   579     // Update component size
       
   580     // Place the Editor at the center of the SwtDateEditor
       
   581     TSize swtSize(BorderInnerRect().Size());
       
   582     TPoint swtPos(Position());
       
   583 
       
   584     if (iIndicator)
       
   585     {
       
   586         const TPoint indPos(swtPos.iX + GetBorderWidth(),
       
   587                             swtPos.iY + GetBorderWidth());
       
   588         iIndicator->IndicatorContainer()->SetPosition(indPos);
       
   589 
       
   590         const TSize indicatorSize(swtSize.iWidth, KSWTEditIndicatorHeight);
       
   591         iIndicator->IndicatorContainer()->SetSize(indicatorSize);
       
   592         swtSize.iHeight -= indicatorSize.iHeight;
       
   593         swtPos.iY += indicatorSize.iHeight;
       
   594     }
       
   595 
       
   596     // The native editor adds these margins, so we have to consider them also.
       
   597     TInt topMargin(0);
       
   598     TInt bottomMargin(0);
       
   599     TAknTextDecorationMetrics metrics(iEditor->Font());
       
   600     metrics.GetTopAndBottomMargins(topMargin, bottomMargin);
       
   601 
       
   602     // MinimumSize returns the actual size of the control, so we need to set its size,
       
   603     // otherwise we will always receive 0.
       
   604     iEditor->SetSize(TSize(iEditor->Size().iWidth,
       
   605                            iEditor->Font()->FontMaxHeight() + topMargin + bottomMargin));
       
   606     TSize editorSize(iEditor->MinimumSize());
       
   607 
       
   608     TSize buttonEdSiz(editorSize);
       
   609     TPoint editorPos(0, 0);
       
   610 
       
   611     // calculates horizontal alignment of date in the editor
       
   612     if (swtSize.iWidth > buttonEdSiz.iWidth)
       
   613     {
       
   614         editorPos.iX += swtPos.iX + static_cast<TInt>((swtSize.iWidth-
       
   615                         buttonEdSiz.iWidth)/2.0) ;
       
   616     }
       
   617     else
       
   618     {
       
   619         editorPos.iX += swtPos.iX;
       
   620     }
       
   621 
       
   622     // calculates vertical alignment of date in the editor
       
   623     if (swtSize.iHeight > buttonEdSiz.iHeight)
       
   624     {
       
   625         editorPos.iY = swtPos.iY + static_cast<TInt>((swtSize.iHeight-
       
   626                        buttonEdSiz.iHeight)/2.0) ;
       
   627     }
       
   628     else
       
   629     {
       
   630         editorPos.iY = swtPos.iY;
       
   631     }
       
   632 
       
   633     iEditor->SetPosition(TPoint(editorPos.iX + GetBorderWidth(), editorPos.iY + GetBorderWidth()));
       
   634 
       
   635     if (iEditor->SupportsFeature(CEikMfne::EClipGcToRect))
       
   636     {
       
   637         iEditor->SetFeature(CEikMfne::EClipGcToRect, ETrue);
       
   638     }
       
   639 
       
   640     // places the editor on the center
       
   641     TSize newEditorSize(
       
   642         (swtSize.iWidth > editorSize.iWidth) ? editorSize.iWidth : swtSize.iWidth,
       
   643         (swtSize.iHeight > editorSize.iHeight) ? editorSize.iHeight : swtSize.iHeight);
       
   644 
       
   645     iEditor->SetSize(newEditorSize);
       
   646 
       
   647     HandleSizeChanged();
       
   648 }
       
   649 
       
   650 // ---------------------------------------------------------------------------------------------
       
   651 // CSwtDateEditor::PositionChanged
       
   652 // ---------------------------------------------------------------------------------------------
       
   653 //
       
   654 void CSwtDateEditor::PositionChanged()
       
   655 {
       
   656     HandlePositionChanged();
       
   657 }
       
   658 
       
   659 // ---------------------------------------------------------------------------------------------
       
   660 // CSwtDateEditor::MopSupplyObject
       
   661 // ---------------------------------------------------------------------------------------------
       
   662 //
       
   663 TTypeUid::Ptr CSwtDateEditor::MopSupplyObject(TTypeUid aId)
       
   664 {
       
   665     if (iIndicator && aId.iUid == MAknEditingStateIndicator::ETypeId)
       
   666     {
       
   667         return aId.MakePtr(static_cast<MAknEditingStateIndicator*>(iIndicator));
       
   668     }
       
   669     TTypeUid::Ptr id = ASwtControlBase::SwtMopSupplyObject(aId);
       
   670     if (!id.Pointer())
       
   671     {
       
   672         return CCoeControl::MopSupplyObject(aId);
       
   673     }
       
   674     return id;
       
   675 }
       
   676 
       
   677 // ---------------------------------------------------------------------------------------------
       
   678 // CSwtDateEditor::CoeControl
       
   679 // ---------------------------------------------------------------------------------------------
       
   680 //
       
   681 CCoeControl& CSwtDateEditor::CoeControl()
       
   682 {
       
   683     return *this;
       
   684 }
       
   685 
       
   686 // ---------------------------------------------------------------------------------------------
       
   687 // CSwtDateEditor::CoeControl
       
   688 // ---------------------------------------------------------------------------------------------
       
   689 //
       
   690 const CCoeControl& CSwtDateEditor::CoeControl() const
       
   691 {
       
   692     return *this;
       
   693 }
       
   694 
       
   695 // ---------------------------------------------------------------------------------------------
       
   696 // CSwtDateEditor::ComputeSizeL
       
   697 // ---------------------------------------------------------------------------------------------
       
   698 //
       
   699 TSize CSwtDateEditor::ComputeSizeL(TInt aWHint, TInt aHHint)
       
   700 {
       
   701     if (!iEditor)
       
   702     {
       
   703         // iEditor could be null if the CSwtDateEditor is contained in a CaptionedControl.
       
   704         // When the method CaptionedControl::RegisterChildL() is called,
       
   705         // a SetSize() is made on its children, hence a call to ComputeSizeL().
       
   706         return TSize(0, 0);
       
   707     }
       
   708 
       
   709     if (aWHint != KSwtDefault && aHHint != KSwtDefault)
       
   710     {
       
   711         return TSize(aWHint, aHHint);
       
   712     }
       
   713 
       
   714     TSize size(iEditor->MinimumSize());
       
   715     if (iIndicator)
       
   716     {
       
   717         size.iHeight += KSWTEditIndicatorHeight;
       
   718     }
       
   719     size.iHeight = Max(iEditor->Font()->FontMaxHeight(), size.iHeight);
       
   720     if (GetFont() == &DefaultFont())
       
   721     {
       
   722         size.iHeight = Max(iDisplay.UiUtils().InlineReferenceFontHeight(), size.iHeight);
       
   723     }
       
   724     size += iDisplay.UiUtils().InlineReferencePadding().SizeDelta();
       
   725     size += BorderSizeDelta();
       
   726 
       
   727     if (aWHint != KSwtDefault)
       
   728     {
       
   729         size.iWidth = aWHint;
       
   730     }
       
   731     if (aHHint != KSwtDefault)
       
   732     {
       
   733         size.iHeight = aHHint;
       
   734     }
       
   735 
       
   736     return size;
       
   737 }
       
   738 
       
   739 // ---------------------------------------------------------------------------------------------
       
   740 // CSwtDateEditor::SetFontL
       
   741 // ---------------------------------------------------------------------------------------------
       
   742 //
       
   743 void CSwtDateEditor::SetFontL(const MSwtFont* aFont)
       
   744 {
       
   745     // Does nothing. The font of the native editor is managed by the system.
       
   746     // It can't be modified.
       
   747     ASwtControlBase::DoSetFontL(aFont);
       
   748     if (iEditor)
       
   749     {
       
   750         ProcessFontUpdate();
       
   751     }
       
   752     SizeChanged();
       
   753     Redraw();
       
   754 }
       
   755 
       
   756 // ---------------------------------------------------------------------------------------------
       
   757 // CSwtDateEditor::DefaultFont
       
   758 // ---------------------------------------------------------------------------------------------
       
   759 //
       
   760 const MSwtFont& CSwtDateEditor::DefaultFont() const
       
   761 {
       
   762     return *iDefaultFont;
       
   763 }
       
   764 
       
   765 // ---------------------------------------------------------------------------------------------
       
   766 // CSwtDateEditor::Control
       
   767 // ---------------------------------------------------------------------------------------------
       
   768 //
       
   769 MSwtControl* CSwtDateEditor::Control()
       
   770 {
       
   771     return static_cast<MSwtControl*>(this);
       
   772 }
       
   773 
       
   774 // ---------------------------------------------------------------------------------------------
       
   775 // CSwtDateEditor::GetDate
       
   776 // ---------------------------------------------------------------------------------------------
       
   777 //
       
   778 TInt64 CSwtDateEditor::GetDate()
       
   779 {
       
   780     ASSERT(iEditor);
       
   781     TInt64 result(0);
       
   782 
       
   783     switch (iDateEditorStyle)
       
   784     {
       
   785     case ESwtDate:
       
   786     {
       
   787         // The Date style contains only day infos. No time infos.
       
   788         // So we get the original time set in Java, and update only the day.
       
   789         // Thus, no need to take TimeZone into account.
       
   790         TTime getDate(static_cast<CEikDateEditor*>(iEditor)->Date());
       
   791         TDateTime javaDateTime(TTime(iJavaDateInMicroSec).DateTime());
       
   792         TDateTime onlyTime(0, EJanuary, 0, javaDateTime.Hour(), javaDateTime.Minute(),
       
   793                            javaDateTime.Second(), javaDateTime.MicroSecond());
       
   794         TTime clockInTTime(onlyTime);
       
   795         result = clockInTTime.Int64() + getDate.Int64() - iEpocDateInMicroSec;
       
   796     }
       
   797     break;
       
   798 
       
   799     case ESwtTime:
       
   800     {
       
   801         TTime getTime(static_cast<CEikTimeEditor*>(iEditor)->Time());
       
   802         TDateTime javaDateTime(TTime(iJavaDateInMicroSec).DateTime());
       
   803         TDateTime onlyDay(javaDateTime.Year(), javaDateTime.Month(),
       
   804                           javaDateTime.Day(), 0, 0, 0, 0);
       
   805         TTime dayInTTime(onlyDay);
       
   806         result = dayInTTime.Int64() + getTime.Int64();
       
   807     }
       
   808     break;
       
   809 
       
   810     case ESwtDateTime:
       
   811         result = static_cast<CEikTimeAndDateEditor*>(iEditor)->TimeAndDate().Int64()
       
   812                  - iEpocDateInMicroSec;
       
   813         break;
       
   814 
       
   815     default:
       
   816         break;
       
   817     }
       
   818 
       
   819     return result;
       
   820 }
       
   821 
       
   822 // ---------------------------------------------------------------------------------------------
       
   823 // CSwtDateEditor::GetOffset
       
   824 // ---------------------------------------------------------------------------------------------
       
   825 //
       
   826 TInt CSwtDateEditor::GetOffset() const
       
   827 {
       
   828     ASSERT(iEditor);
       
   829 
       
   830     switch (iDateEditorStyle)
       
   831     {
       
   832     case ESwtDuration:
       
   833         return static_cast<CEikDurationEditor*>(iEditor)->Duration().Int();
       
   834 
       
   835     case ESwtOffset:
       
   836         return static_cast<CEikTimeOffsetEditor*>(iEditor)->TimeOffset().Int();
       
   837 
       
   838     case ESwtTime:
       
   839         return static_cast<TInt64>(static_cast<CEikTimeEditor*>(
       
   840                                        iEditor)->Time().Int64() / 1000000);
       
   841 
       
   842     default:
       
   843         break;
       
   844     }
       
   845 
       
   846     return 0;
       
   847 }
       
   848 
       
   849 // ---------------------------------------------------------------------------------------------
       
   850 // CSwtDateEditor::SetDate
       
   851 // ---------------------------------------------------------------------------------------------
       
   852 //
       
   853 void CSwtDateEditor::SetDate(const TInt64& aJavaDate)
       
   854 {
       
   855     ASSERT(iEditor);
       
   856 
       
   857     iJavaDateInMicroSec = aJavaDate;
       
   858     TTime date(iEpocDateInMicroSec + iJavaDateInMicroSec);
       
   859 
       
   860     switch (iDateEditorStyle)
       
   861     {
       
   862     case ESwtDate:
       
   863         static_cast<CEikDateEditor*>(iEditor)->SetDate(date);
       
   864         break;
       
   865 
       
   866     case ESwtTime:
       
   867     {
       
   868         TDateTime dateTime(date.DateTime());
       
   869         TInt64 onlyTimeInMicroSec(dateTime.Hour() * 3600
       
   870                                   + dateTime.Minute() * 60
       
   871                                   + dateTime.Second());
       
   872         onlyTimeInMicroSec = onlyTimeInMicroSec * 1000000;
       
   873         onlyTimeInMicroSec += dateTime.MicroSecond();
       
   874         static_cast<CEikTimeEditor*>(iEditor)->SetTime(TTime(onlyTimeInMicroSec));
       
   875     }
       
   876     break;
       
   877 
       
   878     case ESwtDateTime:
       
   879         static_cast<CEikTimeAndDateEditor*>(iEditor)->SetTimeAndDate(date);
       
   880 
       
   881         break;
       
   882 
       
   883     default:
       
   884         break;
       
   885     }
       
   886     Redraw();
       
   887 }
       
   888 
       
   889 // ---------------------------------------------------------------------------------------------
       
   890 // CSwtDateEditor::SetDateEditorStyleL
       
   891 // ---------------------------------------------------------------------------------------------
       
   892 //
       
   893 void CSwtDateEditor::SetDateEditorStyleL(TInt aDateEditorStyle)
       
   894 {
       
   895     TTime initialDate;
       
   896     initialDate.HomeTime();
       
   897     iJavaDateInMicroSec = initialDate.Int64() - iEpocDateInMicroSec;
       
   898 
       
   899     // Create the editor, according to the style
       
   900     iDateEditorStyle  = aDateEditorStyle & 0xf;
       
   901     iDateEditorFormat = aDateEditorStyle & 0xf0;
       
   902 
       
   903     //Clear field counters
       
   904     iCurrentFieldLength = 0;
       
   905     iLastField = 0;
       
   906     iCurrentFieldDecimalPlacesCount = 0;
       
   907 
       
   908     TUint32 editorFlags = 0;
       
   909     if (iDateEditorFormat == ESwtCompact)
       
   910     {
       
   911         editorFlags = EEikTimeWithoutSecondsField;
       
   912     }
       
   913 
       
   914     switch (iDateEditorStyle)
       
   915     {
       
   916     case ESwtDate:
       
   917     {
       
   918         TBool withoutPopoutCalendar = EFalse;
       
   919         if (iDateEditorFormat == ESwtCompact)
       
   920         {
       
   921             withoutPopoutCalendar = ETrue;
       
   922         }
       
   923         iEditor = new(ELeave) CEikDateEditor();
       
   924         static_cast<CEikDateEditor*>(iEditor)->ConstructL(
       
   925             KAknMinimumDate, KAknMaximumDate, initialDate, withoutPopoutCalendar);
       
   926     }
       
   927     break;
       
   928 
       
   929     case ESwtTime:
       
   930     {
       
   931         iEditor = new(ELeave) CEikTimeEditor();
       
   932         static_cast<CEikTimeEditor*>(iEditor)->ConstructL(
       
   933             TTime(TInt64(0)),
       
   934             TTime(TInt64(KSwtSecondsInOneDay)*1000000), initialDate, editorFlags);
       
   935     }
       
   936     break;
       
   937 
       
   938     case ESwtDateTime:
       
   939     {
       
   940         iEditor = new(ELeave) CEikTimeAndDateEditor();
       
   941         static_cast<CEikTimeAndDateEditor*>(iEditor)->ConstructL(
       
   942             KAknMinimumDate, KAknMaximumDate, initialDate, editorFlags);
       
   943     }
       
   944     break;
       
   945 
       
   946     case ESwtDuration:
       
   947     {
       
   948         iEditor = new(ELeave) CEikDurationEditor();
       
   949         static_cast<CEikDurationEditor*>(iEditor)->ConstructL(
       
   950             TTimeIntervalSeconds(0),
       
   951             TTimeIntervalSeconds(KSwtSecondsInOneDay),
       
   952             TTimeIntervalSeconds(0), editorFlags);
       
   953     }
       
   954     break;
       
   955 
       
   956     case ESwtOffset:
       
   957     {
       
   958         iEditor = new(ELeave) CEikTimeOffsetEditor();
       
   959         static_cast<CEikTimeOffsetEditor*>(iEditor)->ConstructL(
       
   960             TTimeIntervalSeconds(-KSwtSecondsInOneDay),
       
   961             TTimeIntervalSeconds(KSwtSecondsInOneDay),
       
   962             TTimeIntervalSeconds(0), editorFlags);
       
   963     }
       
   964     break;
       
   965 
       
   966     default:
       
   967         break;
       
   968     }
       
   969 
       
   970     if (iEditor)
       
   971     {
       
   972         iEditor->SetContainerWindowL(*this);
       
   973         iEditor->SetFocusing(ETrue);
       
   974         iEditor->MakeVisible(IsVisible());
       
   975         iEditor->SetFocus(IsFocused());
       
   976         iEditor->SetDimmed(IsDimmed());
       
   977         RetrieveDefaultFontL();
       
   978         iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG6);
       
   979     }
       
   980     ActivateL();
       
   981 }
       
   982 
       
   983 // ---------------------------------------------------------------------------------------------
       
   984 // CSwtDateEditor::SetOffset
       
   985 // ---------------------------------------------------------------------------------------------
       
   986 //
       
   987 void CSwtDateEditor::SetOffset(TInt aSeconds)
       
   988 {
       
   989     switch (iDateEditorStyle)
       
   990     {
       
   991     case ESwtDuration:
       
   992         static_cast<CEikDurationEditor*>(iEditor)->SetDuration(
       
   993             TTimeIntervalSeconds(aSeconds));
       
   994         break;
       
   995 
       
   996     case ESwtOffset:
       
   997         static_cast<CEikTimeOffsetEditor*>(iEditor)->SetTimeOffset(
       
   998             TTimeIntervalSeconds(aSeconds));
       
   999         break;
       
  1000 
       
  1001     case ESwtTime:
       
  1002     {
       
  1003         aSeconds = aSeconds % 86400; // 24 hours.
       
  1004         TInt hour = aSeconds / 3600;
       
  1005         TInt minute = (aSeconds - hour * 3600) / 60;
       
  1006         TInt second = aSeconds - 3600*hour - 60*minute;
       
  1007         TDateTime datetime(0, EJanuary, 0, hour, minute, second, 0);
       
  1008         TTime time(datetime);
       
  1009         static_cast<CEikTimeEditor*>(iEditor)->SetTime(time);
       
  1010     }
       
  1011     break;
       
  1012 
       
  1013     default:
       
  1014         break;
       
  1015     }
       
  1016     Redraw();
       
  1017 
       
  1018 }
       
  1019 
       
  1020 // ---------------------------------------------------------------------------------------------
       
  1021 // CSwtDateEditor::GetMinimumAndMaximumAndInitialDatesForCalendarL
       
  1022 // ---------------------------------------------------------------------------------------------
       
  1023 //
       
  1024 void CSwtDateEditor::GetMinimumAndMaximumAndInitialDatesForCalendarL(
       
  1025     TTime &aMinimumDate,
       
  1026     TTime &aMaximumDate,
       
  1027     TTime &aInitialDate) const
       
  1028 {
       
  1029     ASSERT(iEditor);
       
  1030 
       
  1031     switch (iDateEditorStyle)
       
  1032     {
       
  1033     case ESwtDateTime:
       
  1034         static_cast<CEikTimeAndDateEditor*>(iEditor)->GetMinimumAndMaximum(
       
  1035             aMinimumDate, aMaximumDate);
       
  1036         aInitialDate = static_cast<CEikTimeAndDateEditor*>(iEditor)->TimeAndDate();
       
  1037         break;
       
  1038 
       
  1039     default:
       
  1040         break;
       
  1041     }
       
  1042 }
       
  1043 
       
  1044 // ---------------------------------------------------------------------------------------------
       
  1045 // CSwtDateEditor::SetDateFromCalendarAndDrawNow
       
  1046 // ---------------------------------------------------------------------------------------------
       
  1047 //
       
  1048 void CSwtDateEditor::SetDateFromCalendarAndDrawNow(const TTime &aDate)
       
  1049 {
       
  1050     ASSERT(iEditor);
       
  1051 
       
  1052     switch (iDateEditorStyle)
       
  1053     {
       
  1054     case ESwtDateTime:
       
  1055     {
       
  1056         TDateTime current(static_cast<CEikTimeAndDateEditor*>(
       
  1057                               iEditor)->TimeAndDate().DateTime());
       
  1058         TDateTime setDateTime(aDate.DateTime());
       
  1059         setDateTime.SetHour(current.Hour());
       
  1060         setDateTime.SetMinute(current.Minute());
       
  1061         setDateTime.SetSecond(current.Second());
       
  1062         setDateTime.SetMicroSecond(current.MicroSecond());
       
  1063         static_cast<CEikTimeAndDateEditor*>(iEditor)->SetTimeAndDate(
       
  1064             TTime(setDateTime));
       
  1065     }
       
  1066     break;
       
  1067 
       
  1068     default:
       
  1069         break;
       
  1070     }
       
  1071 }
       
  1072 
       
  1073 // ---------------------------------------------------------------------------------------------
       
  1074 // CSwtDateEditor::MSKLabelL
       
  1075 // ---------------------------------------------------------------------------------------------
       
  1076 //
       
  1077 HBufC* CSwtDateEditor::MSKLabelL() const
       
  1078 {
       
  1079     if (iEditor && (IsFieldAmPmField(iEditor->CurrentField()) ||
       
  1080                     IsFieldOffsetStyleField(iEditor->CurrentField())))
       
  1081     {
       
  1082         HBufC* label = iEikonEnv->AllocReadResourceL(R_QTN_MSK_CHANGE);
       
  1083         return label ;
       
  1084     }
       
  1085     return ASwtControlBase::MSKLabelL();
       
  1086 }
       
  1087 
       
  1088 // ---------------------------------------------------------------------------------------------
       
  1089 // CSwtDateEditor::IsKeyUsed
       
  1090 // ---------------------------------------------------------------------------------------------
       
  1091 //
       
  1092 TBool CSwtDateEditor::IsKeyUsed(TUint aKeyCode) const
       
  1093 {
       
  1094     if (iEditor && (IsFieldAmPmField(iEditor->CurrentField()) ||
       
  1095                     IsFieldOffsetStyleField(iEditor->CurrentField())) && aKeyCode == EKeyOK)
       
  1096     {
       
  1097         return ETrue;
       
  1098     }
       
  1099     return EFalse;
       
  1100 }
       
  1101 
       
  1102 // ---------------------------------------------------------------------------------------------
       
  1103 // CSwtDateEditor::HandlePointerEventL
       
  1104 // ---------------------------------------------------------------------------------------------
       
  1105 //
       
  1106 #if defined( RD_SCALABLE_UI_V2 )
       
  1107 void CSwtDateEditor::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
  1108 {
       
  1109     TBool hit = ETrue;
       
  1110     
       
  1111 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  1112     TBool pressed = iPressed;
       
  1113     hit = Rect().Contains(aPointerEvent.iPosition);
       
  1114 
       
  1115     if (aPointerEvent.iType == TPointerEvent::EButton1Down)
       
  1116         iPressed = ETrue;
       
  1117     else if (aPointerEvent.iType == TPointerEvent::EButton1Up)
       
  1118         iPressed = EFalse;
       
  1119     else if (aPointerEvent.iType == TPointerEvent::EDrag)
       
  1120         iPressed = hit;
       
  1121 #endif
       
  1122     
       
  1123     if (!(aPointerEvent.iType == TPointerEvent::EButton1Up 
       
  1124         && (iDisplay.RevertPointerEvent() || !hit)))
       
  1125     {
       
  1126         iEditor->HandlePointerEventL(aPointerEvent);
       
  1127 
       
  1128         //MSK label update may be needed.
       
  1129         if (AknLayoutUtils::MSKEnabled())
       
  1130         {
       
  1131             MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
       
  1132             if (commandArranger)
       
  1133             {
       
  1134                 commandArranger->UpdateMSKLabelL();
       
  1135             }
       
  1136         }
       
  1137         // End MSK
       
  1138     }
       
  1139 
       
  1140     //Selected field might changed
       
  1141     iCurrentFieldLength = 0;
       
  1142     iCurrentFieldDecimalPlacesCount = 0;
       
  1143     iLastField = iEditor->CurrentField();
       
  1144     
       
  1145 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  1146     if (pressed != iPressed)
       
  1147         Redraw();
       
  1148 #endif
       
  1149 }
       
  1150 
       
  1151 // ---------------------------------------------------------------------------------------------
       
  1152 // CSwtDateEditor::HandleControlEventL
       
  1153 // ---------------------------------------------------------------------------------------------
       
  1154 //
       
  1155 void CSwtDateEditor::HandleControlEventL(CCoeControl* /*aControl*/, TCoeEvent /*aEventType*/)
       
  1156 {
       
  1157 }
       
  1158 #endif // RD_SCALABLE_UI_V2