uifw/AvKon/src/aknindicator.cpp
changeset 0 2f259fa3e83a
child 10 9f56a4e1b8ab
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2008 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:  Implementation for status indicators.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <eikspane.h>
       
    21 #include <AknsUtils.h>
       
    22 #include <AknBidiTextUtils.h>
       
    23 #include <AknPictographInterface.h>
       
    24 #include <AknPictographDrawerInterface.h>
       
    25 #include <AknIconUtils.h>
       
    26 #include <aknlayoutscalable_avkon.cdl.h>
       
    27 #include <akniconconfig.h>
       
    28 #include <avkon.mbg>
       
    29 
       
    30 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    31 #include <uikon/eikenvinterface.h>
       
    32 #endif
       
    33 
       
    34 #include <AknTasHook.h>
       
    35 #include "AknPanic.h"
       
    36 #include "aknconsts.h"
       
    37 #include "AknIndicatorContainer.h"
       
    38 #include "AknIndicator.h"
       
    39 #include "AknUtils.h"
       
    40 #include "aknenv.h"
       
    41 #include "aknappui.h"
       
    42 #include "AknDef.h"
       
    43 #include "avkon.hrh"
       
    44 #include "AknStatuspaneUtils.h"
       
    45 #include "AknIndicatorFader.h"
       
    46 #include "AknLayoutFont.h"
       
    47 #include "layoutmetadata.cdl.h"
       
    48 #include "AknIndicatorPlugin.h"
       
    49 #include "AknIndicatorPluginImplUIDs.hrh"
       
    50 #include "AknIndicatorObserver.h"
       
    51 #include "aknstatuspanedatapublisher.h"
       
    52 #include "aknnavide.h"
       
    53 
       
    54 // Flags for indicators
       
    55 enum TIndicatorsControlFlags
       
    56     {
       
    57     EAknIndicatorsButton1DownInIndicatorRect = 0x00000001
       
    58     };
       
    59 
       
    60 // CONSTANTS
       
    61 const TInt KAknBitmapQueueGranularity = 2;
       
    62 
       
    63 // ================= Extension class ========================
       
    64 NONSHARABLE_CLASS( CAknIndicatorExtension ) : CBase
       
    65     {
       
    66 friend class CAknIndicator;
       
    67 
       
    68 public:
       
    69 
       
    70     CAknIndicatorExtension();
       
    71     ~CAknIndicatorExtension();
       
    72 
       
    73 public: // data
       
    74 
       
    75     CCoeControl*        iContainerControl;
       
    76     CAknIndicatorFader* iFader; // not owned
       
    77 
       
    78     TBool iIndicatorBitmapsCreated;
       
    79 
       
    80     typedef CArrayFixFlat<TInt> CAknIndicatorBitmapIndexQueue;
       
    81     CAknIndicatorBitmapIndexQueue* iIndicatorBitmapIndexes[2];
       
    82 
       
    83     TBool  iDynamicTextIndicator;
       
    84     HBufC* iDynamicIndicatorText;
       
    85     TBool  iMultiColorMode;
       
    86     TInt   iIndicatorPosition;
       
    87 
       
    88     TAknsItemID   iIndicatorColorGroup[2];
       
    89     TInt          iIndicatorColorIndex[2];
       
    90 
       
    91     TInt iFlags;
       
    92     };
       
    93 
       
    94 CAknIndicatorExtension::CAknIndicatorExtension() :
       
    95     iFlags( 0 )
       
    96     {
       
    97     }
       
    98 
       
    99 
       
   100 CAknIndicatorExtension::~CAknIndicatorExtension()
       
   101     {
       
   102     delete iDynamicIndicatorText;
       
   103     }
       
   104 
       
   105 
       
   106 
       
   107 // ================= MEMBER FUNCTIONS =======================
       
   108 CAknIndicator::CAknIndicator() :
       
   109                     iCountOfAnimStates(1),
       
   110                     iIndicatorTypeText(EFalse),
       
   111                     iIndicatorContext(CAknIndicatorContainer::EUniversalIndicators)
       
   112     {
       
   113     AKNTASHOOK_ADD( this, "CAknIndicator" );
       
   114     }
       
   115 
       
   116 CAknIndicator::CAknIndicator(TInt aIndicatorContext) :
       
   117                     iCountOfAnimStates(1),
       
   118                     iIndicatorTypeText(EFalse),
       
   119                     iIndicatorContext(aIndicatorContext)
       
   120     {
       
   121     AKNTASHOOK_ADD( this, "CAknIndicator" );
       
   122     }
       
   123 
       
   124 CAknIndicator::~CAknIndicator()
       
   125     {
       
   126     AKNTASHOOK_REMOVE();
       
   127     if(iExtension && iExtension->iIndicatorBitmapIndexes)
       
   128         {
       
   129         delete iExtension->iIndicatorBitmapIndexes[ELayoutModeUsual];
       
   130         delete iExtension->iIndicatorBitmapIndexes[ELayoutModeWide];
       
   131         }
       
   132 
       
   133     if ( iIndicatorBitmaps[ELayoutModeUsual] )
       
   134         {
       
   135         TInt count = iIndicatorBitmaps[ELayoutModeUsual]->Count();
       
   136         for(TInt ii = 0; ii < count; ii++)
       
   137             {
       
   138             delete iIndicatorBitmaps[ELayoutModeUsual]->At(ii);
       
   139             }
       
   140         delete iIndicatorBitmaps[ELayoutModeUsual];
       
   141         }
       
   142 
       
   143     if ( iIndicatorBitmaps[ELayoutModeWide] )
       
   144         {
       
   145         TInt count = iIndicatorBitmaps[ELayoutModeWide]->Count();
       
   146         for(TInt ii = 0; ii < count; ii++)
       
   147             {
       
   148             delete iIndicatorBitmaps[ELayoutModeWide]->At(ii);
       
   149             }
       
   150         delete iIndicatorBitmaps[ELayoutModeWide];
       
   151         }
       
   152 
       
   153     delete iBitmapFile;
       
   154     delete iIndicatorText;
       
   155     delete iExtension;
       
   156 
       
   157     }
       
   158 
       
   159 void CAknIndicator::ConstructFromResourceL(TResourceReader& aReader, CAknIndicatorContainer* aParent)
       
   160     {
       
   161     if (!iExtension)
       
   162         {
       
   163         iExtension = new (ELeave) CAknIndicatorExtension;
       
   164         }
       
   165 
       
   166     if ( !iExtension->iIndicatorBitmapIndexes[ELayoutModeUsual] )
       
   167         {
       
   168         iExtension->iIndicatorBitmapIndexes[ELayoutModeUsual] = new(ELeave)
       
   169             CArrayFixFlat<TInt>(KAknBitmapQueueGranularity);
       
   170         }
       
   171     if ( !iExtension->iIndicatorBitmapIndexes[ELayoutModeWide] )
       
   172         {
       
   173         iExtension->iIndicatorBitmapIndexes[ELayoutModeWide] = new(ELeave)
       
   174             CArrayFixFlat<TInt>(KAknBitmapQueueGranularity);
       
   175         }
       
   176 
       
   177     if ( !iIndicatorBitmaps[ELayoutModeUsual] )
       
   178         {
       
   179         iIndicatorBitmaps[ELayoutModeUsual] = new(ELeave)
       
   180             CAknBitmapQueue(KAknBitmapQueueGranularity);
       
   181         }
       
   182     if ( !iIndicatorBitmaps[ELayoutModeWide] )
       
   183         {
       
   184         iIndicatorBitmaps[ELayoutModeWide] = new(ELeave)
       
   185             CAknBitmapQueue(KAknBitmapQueueGranularity);
       
   186         }
       
   187     iParent = aParent;
       
   188 
       
   189 #ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
       
   190     SetParent( aParent );
       
   191 #endif
       
   192 
       
   193     iUid = aReader.ReadInt16();
       
   194 
       
   195     iNarrowPriority = aReader.ReadInt16();
       
   196     iWidePriority = aReader.ReadInt16();
       
   197 
       
   198     iBitmapFile = aReader.ReadHBufCL(); // bmp filename
       
   199 
       
   200     if ( !iBitmapFile )
       
   201         {
       
   202         iIndicatorTypeText = ETrue;
       
   203         }
       
   204 
       
   205     TInt count = aReader.ReadInt16();  // Number of states
       
   206 
       
   207     for (TInt ii = 0; ii < count; ii++)
       
   208         {
       
   209         TInt stateId = aReader.ReadInt16();
       
   210         switch ( stateId )
       
   211             {
       
   212             case EAknIndicatorStateOn:
       
   213                 {
       
   214 
       
   215                 TInt count = aReader.ReadInt16(); // Number of icons should be 1 in this state
       
   216                 __ASSERT_ALWAYS( count == 1, Panic(EAknPanicOutOfRange));
       
   217 
       
   218                 LoadIndicatorBitmapsL( aReader, count );
       
   219                 break;
       
   220                 }
       
   221             case EAknIndicatorStateAnimate:
       
   222                 {
       
   223                 iCountOfAnimStates = aReader.ReadInt16();
       
   224                 __ASSERT_ALWAYS( iCountOfAnimStates >= 1, Panic(EAknPanicOutOfRange));
       
   225 
       
   226                 LoadIndicatorBitmapsL( aReader, iCountOfAnimStates );
       
   227                 break;
       
   228                 }
       
   229             case EAknIndicatorStateOff: // No icons shown
       
   230                 break;
       
   231             default:
       
   232                 __ASSERT_ALWAYS( count == 1, Panic(EAknPanicOutOfRange));
       
   233                 break;
       
   234             }
       
   235         }
       
   236 
       
   237     // If default icon file is used we delete filename to save some memory
       
   238    if ( iBitmapFile && !iBitmapFile->CompareC( KAvkonBitmapFile ) )
       
   239         {
       
   240         delete iBitmapFile;
       
   241         iBitmapFile = NULL;
       
   242         }
       
   243 
       
   244 
       
   245     // Decide here how indicators are positioned by default.
       
   246     switch (iUid)
       
   247         {
       
   248         case EAknNaviPaneEditorIndicatorMessageInfo:
       
   249         case EAknNaviPaneEditorIndicatorMessageLength:
       
   250         case EAknNaviPaneEditorIndicatorWmlWindowsText:
       
   251         case EAknNaviPaneEditorIndicatorWmlWindows:
       
   252         case EAknNaviPaneEditorIndicatorSecuredConnection:
       
   253         case EAknNaviPaneEditorIndicatorProgressBar:
       
   254         case EAknNaviPaneEditorIndicatorWaitBar:
       
   255         case EAknNaviPaneEditorIndicatorWlanAvailable:
       
   256         case EAknNaviPaneEditorIndicatorWlanActive:
       
   257         case EAknNaviPaneEditorIndicatorWlanActiveSecure:
       
   258             {
       
   259             iExtension->iIndicatorPosition = CAknIndicatorContainer::ELeftSide;
       
   260             break;
       
   261             }
       
   262         case EAknNaviPaneEditorIndicatorWmlWaitGlobe:
       
   263             {
       
   264             iExtension->iIndicatorPosition = CAknIndicatorContainer::EMiddle;
       
   265             break;
       
   266             }
       
   267         default:
       
   268             {
       
   269             iExtension->iIndicatorPosition = CAknIndicatorContainer::ERightSide;
       
   270             break;
       
   271             }
       
   272         }
       
   273     }
       
   274 
       
   275 
       
   276 void CAknIndicator::SetIndicatorState(TInt aState)
       
   277     {
       
   278     iState = aState;
       
   279     if ( iState == EAknIndicatorStateOn )
       
   280         {
       
   281         iAnimState = iCountOfAnimStates - 1;
       
   282         }
       
   283     else if ( iState == EAknIndicatorStateOff )
       
   284         {
       
   285         DeleteBitmaps();
       
   286         }
       
   287     SizeChanged();
       
   288     }
       
   289 
       
   290 
       
   291 void CAknIndicator::SetIndicatorValueL(const TDesC& aString)
       
   292     {
       
   293     __ASSERT_ALWAYS( iIndicatorTypeText, Panic(EAknPanicOutOfRange));
       
   294 
       
   295     iExtension->iDynamicTextIndicator = ETrue; // Set to dynamic type by default
       
   296     delete iIndicatorText;
       
   297     iIndicatorText = NULL;
       
   298 
       
   299     // If dynamic text indicator, then do not convert to visual here...we do it later.
       
   300     if (iExtension->iDynamicTextIndicator)
       
   301         {
       
   302         HBufC* copiedString = HBufC::NewLC( aString.Length() + KAknBidiExtraSpacePerLine );
       
   303         *copiedString = aString;
       
   304         iIndicatorText = copiedString;
       
   305         CleanupStack::Pop(); // copiedString
       
   306         SizeChanged();
       
   307         }
       
   308     else
       
   309         {
       
   310         // screen
       
   311         TRect screenRect;
       
   312         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
       
   313 
       
   314         TInt  KDefaultMaxIndicatorWidth = 67; // Non-APAC layouts use this value (not in LAF yet)
       
   315         TInt  KApacMaxIndicatorWidth = 62;    // APAC layouts use this value (not in LAF yet)
       
   316 
       
   317         TInt maxIndicatorWidth = (KDefaultMaxIndicatorWidth * screenRect.Width())/176; // scale magic number
       
   318 
       
   319         TAknLayoutId layout;
       
   320         iAvkonEnv->GetCurrentLayoutId( layout );
       
   321 
       
   322         if ( layout == EAknLayoutIdAPAC )
       
   323             {
       
   324             maxIndicatorWidth = (KApacMaxIndicatorWidth * screenRect.Width())/176; // scale magic number
       
   325             }
       
   326 
       
   327         TInt statusPaneCurrentResourceId = 0;
       
   328         CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
       
   329 
       
   330         if ( statusPane )
       
   331             statusPaneCurrentResourceId = statusPane->CurrentLayoutResId();
       
   332 
       
   333         // If this indicator is in small statuspane we have more space
       
   334         if (AknStatuspaneUtils::SmallLayoutActive())
       
   335             {
       
   336             // app window
       
   337             TAknWindowComponentLayout applicationWindowLayout( AknLayoutScalable_Avkon::application_window(0) );
       
   338             TAknLayoutRect applicationWindowLayoutRect;
       
   339             applicationWindowLayoutRect.LayoutRect( screenRect, applicationWindowLayout );
       
   340             TRect applicationWindowRect( applicationWindowLayoutRect.Rect() );
       
   341 
       
   342             // top area
       
   343             TAknWindowComponentLayout topAreaLayout( AknLayoutScalable_Avkon::area_top_pane(1) );
       
   344             TAknLayoutRect topAreaLayoutRect;
       
   345             topAreaLayoutRect.LayoutRect( applicationWindowRect, topAreaLayout );
       
   346             TRect topAreaRect( topAreaLayoutRect.Rect() );
       
   347 
       
   348             // small statuspane
       
   349             TAknWindowComponentLayout smallStatusPaneLayout( AknLayoutScalable_Avkon::status_small_pane() );
       
   350             TAknLayoutRect smallStatusPaneLayoutRect;
       
   351             smallStatusPaneLayoutRect.LayoutRect( topAreaRect, smallStatusPaneLayout );
       
   352             TRect smallStatusPaneRect( smallStatusPaneLayoutRect.Rect() );
       
   353 
       
   354             // small statuspane, icons
       
   355             TAknWindowComponentLayout iconPaneLayout( AknLayoutScalable_Avkon::status_small_icon_pane() );
       
   356             TAknLayoutRect iconPaneLayoutRect;
       
   357             iconPaneLayoutRect.LayoutRect( smallStatusPaneRect, iconPaneLayout );
       
   358             TRect iconPaneRect( iconPaneLayoutRect.Rect() );
       
   359 
       
   360             // small statuspane, gprs
       
   361             TAknWindowComponentLayout gprsIndicatorLayout( AknLayoutScalable_Avkon::signal_pane_g2(0) );
       
   362             TAknLayoutRect gprsIndicatorLayoutRect;
       
   363             gprsIndicatorLayoutRect.LayoutRect( smallStatusPaneRect, gprsIndicatorLayout );
       
   364             TRect gprsIndicatorRect( gprsIndicatorLayoutRect.Rect() );
       
   365 
       
   366             // Finally calculate the available length
       
   367             maxIndicatorWidth = iconPaneRect.Width() - KMinSpaceBetweenIconsInPixels;
       
   368 
       
   369             // if gprs is visible, reduce available lenght a bit
       
   370             if ( statusPaneCurrentResourceId == AVKONENV->StatusPaneResIdForCurrentLayout(R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE) )
       
   371                 maxIndicatorWidth -= gprsIndicatorRect.Width();
       
   372             }
       
   373         // if this indicator is in staconapane we have more space
       
   374         if (AknStatuspaneUtils::StaconPaneActive())
       
   375             {
       
   376             TRect navirect = CAknNavigationDecorator::DecoratedControlRect(CAknNavigationDecorator::EEditorIndicator);
       
   377             maxIndicatorWidth = navirect.Size().iWidth;
       
   378             }
       
   379 
       
   380         TAknTextComponentLayout line;
       
   381         if (AknStatuspaneUtils::SmallLayoutActive() || AknStatuspaneUtils::StaconPaneActive())
       
   382             {
       
   383             line = AknLayoutScalable_Avkon::status_small_pane_t1(0);
       
   384             }
       
   385         else
       
   386             {
       
   387             TAknWindowComponentLayout layout( AknLayoutScalable_Avkon::navi_text_pane(0) );
       
   388             TAknTextComponentLayout l2( AknLayoutScalable_Avkon::navi_text_pane_t1() );
       
   389             line = TAknWindowComponentLayout::ComposeText( layout, l2 );
       
   390             }
       
   391 
       
   392         const CFont* fontUsed = AknLayoutUtils::FontFromId(line.LayoutLine().FontId());
       
   393 
       
   394         HBufC* clippedString = HBufC::NewLC( aString.Length() + KAknBidiExtraSpacePerLine );
       
   395         *clippedString = aString;
       
   396         TPtr clippedStringPtr = clippedString->Des();
       
   397         AknBidiTextUtils::ConvertToVisualAndClipL(
       
   398             clippedStringPtr,
       
   399             *fontUsed,
       
   400             maxIndicatorWidth,
       
   401             maxIndicatorWidth);
       
   402 
       
   403         iIndicatorText = clippedString;
       
   404         CleanupStack::Pop(); // clippedString
       
   405         SizeChanged();
       
   406         }
       
   407     }
       
   408 
       
   409 TInt CAknIndicator::IndicatorState()
       
   410     {
       
   411     return iState;
       
   412     }
       
   413 
       
   414 TBool CAknIndicator::TextIndicator()
       
   415     {
       
   416     return iIndicatorTypeText;
       
   417     }
       
   418 
       
   419 TSize CAknIndicator::IconSize()
       
   420     {
       
   421     TInt layoutMode = iLayoutMode; // Universal indicators
       
   422 
       
   423     if ( iIndicatorContext == CAknIndicatorContainer::ENaviPaneEditorIndicators )
       
   424         {
       
   425         layoutMode = ELayoutModeWide;
       
   426         }
       
   427     else if ( iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators )
       
   428         {
       
   429         layoutMode = ELayoutModeUsual;
       
   430         }
       
   431 
       
   432     if ( !iIndicatorTypeText && (iIndicatorBitmaps[layoutMode]->Count() > 0))
       
   433         {
       
   434         if ( iIndicatorBitmaps[layoutMode]->At( 0 ) )
       
   435             {
       
   436             // If bitmap is not yet rendered, do it before measuring it.
       
   437             if (iIndicatorBitmaps[layoutMode]->At( 0 )->SizeInPixels() == TSize(0,0))
       
   438                 SetSvgIconSize(iIndicatorBitmaps[layoutMode]->At( 0 ), iLayoutMode);
       
   439             return iIndicatorBitmaps[layoutMode]->At( 0 )->SizeInPixels();
       
   440             }
       
   441         else
       
   442             {
       
   443             return TSize(0,0);
       
   444             }
       
   445         }
       
   446     else if (iIndicatorText)
       
   447         {
       
   448         TAknTextComponentLayout line;
       
   449         if (AknStatuspaneUtils::SmallLayoutActive() || AknStatuspaneUtils::StaconPaneActive())
       
   450             {
       
   451             line = AknLayoutScalable_Avkon::status_small_pane_t1(0);
       
   452             }
       
   453         else
       
   454             {
       
   455             TAknWindowComponentLayout layout( AknLayoutScalable_Avkon::navi_text_pane(0) );
       
   456             TAknTextComponentLayout l2( AknLayoutScalable_Avkon::navi_text_pane_t1() );
       
   457             line = TAknWindowComponentLayout::ComposeText( layout, l2 );
       
   458             }
       
   459 
       
   460         const CFont* fontUsed = AknLayoutUtils::FontFromId( line.LayoutLine().FontId() );
       
   461 
       
   462         // The iIndicatorText is in logical order.
       
   463         CFont::TMeasureTextInput input;
       
   464         TInt textLength = fontUsed->MeasureText( *iIndicatorText, &input );
       
   465 
       
   466         const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( fontUsed );
       
   467         TInt textPaneHeight(0);
       
   468         if ( layoutFont )
       
   469             {
       
   470             textPaneHeight = layoutFont->TextPaneHeight();
       
   471             }
       
   472         else
       
   473             {
       
   474             textPaneHeight = fontUsed->HeightInPixels();
       
   475             }
       
   476 
       
   477 
       
   478         // +1 is to leave some empty space between text and the next indicator
       
   479         return TSize( textLength + 1, textPaneHeight );
       
   480         }
       
   481     else
       
   482         {
       
   483         return TSize(0,0);
       
   484         }
       
   485     }
       
   486 
       
   487 TInt CAknIndicator::Priority()
       
   488     {
       
   489     TInt layoutMode = iLayoutMode;
       
   490 
       
   491     if ( iIndicatorContext == CAknIndicatorContainer::ENaviPaneEditorIndicators )
       
   492         {
       
   493         layoutMode = ELayoutModeWide;
       
   494         }
       
   495     else if ( iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators )
       
   496         {
       
   497         layoutMode = ELayoutModeUsual;
       
   498         }
       
   499 
       
   500     return (layoutMode == ELayoutModeUsual ? iNarrowPriority : iWidePriority);
       
   501     }
       
   502 
       
   503 
       
   504 void CAknIndicator::SetLayoutMode(TLayoutMode aMode)
       
   505     {
       
   506     iLayoutMode = aMode;
       
   507     if (iState != EAknIndicatorStateOff) // Do SizeChanged only if really needed to avoid performance problems with SVG graphics
       
   508         SizeChanged();
       
   509     }
       
   510 
       
   511 TUid CAknIndicator::Uid() const
       
   512     {
       
   513     return TUid::Uid(iUid);
       
   514     }
       
   515 
       
   516 EXPORT_C void CAknIndicator::PositionChanged()
       
   517     {
       
   518     CCoeControl::PositionChanged();
       
   519     }
       
   520 
       
   521 
       
   522 // ---------------------------------------------------------------------------
       
   523 // CAknIndicator::Draw
       
   524 // Draws the indicator.
       
   525 // ---------------------------------------------------------------------------
       
   526 //
       
   527 void CAknIndicator::Draw( const TRect& /*aRect*/ ) const
       
   528     {
       
   529     CWindowGc& gc = SystemGc();
       
   530 
       
   531     TRect rect( Rect() );
       
   532 
       
   533     if ( iIndicatorTypeText )
       
   534         {
       
   535         // Draw text indicator
       
   536         if ( !iIndicatorText )
       
   537             {
       
   538             return;
       
   539             }
       
   540 
       
   541         TAknTextComponentLayout line;
       
   542         if ( AknStatuspaneUtils::SmallLayoutActive() ||
       
   543              AknStatuspaneUtils::StaconPaneActive() )
       
   544             {
       
   545             line = AknLayoutScalable_Avkon::status_small_pane_t1( 0 );
       
   546             }
       
   547         else
       
   548             {
       
   549             line = TAknWindowComponentLayout::ComposeText(
       
   550                 AknLayoutScalable_Avkon::navi_text_pane( 0 ),
       
   551                 AknLayoutScalable_Avkon::navi_text_pane_t1() );
       
   552             }
       
   553 
       
   554         const CFont* fontUsed = AknLayoutUtils::FontFromId( line.LayoutLine().FontId() );
       
   555 
       
   556 
       
   557         const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( fontUsed );
       
   558         TInt textPaneAscent( 0 );
       
   559         if ( layoutFont )
       
   560             {
       
   561             textPaneAscent = layoutFont->TextPaneTopToBaseline();
       
   562             }
       
   563         else
       
   564             {
       
   565             textPaneAscent = fontUsed->AscentInPixels();
       
   566             }
       
   567 
       
   568 
       
   569         TRgb color( SelectColor( iLayoutMode ) );
       
   570         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   571 
       
   572         CGraphicsContext::TTextAlign textAlign =
       
   573             AknLayoutUtils::LayoutMirrored() ? CGraphicsContext::ERight :
       
   574                                                CGraphicsContext::ELeft;
       
   575 
       
   576         gc.SetPenColor( color );
       
   577         gc.SetPenStyle( CGraphicsContext::ESolidPen );
       
   578         gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   579         gc.UseFont( fontUsed );
       
   580         gc.DrawText( *Text(), rect, textPaneAscent, textAlign, 0 );
       
   581 
       
   582         // Draw pictographs if required.
       
   583         CAknPictographInterface* pictoInterface = iParent->PictographInterface();
       
   584         if ( pictoInterface )
       
   585             {
       
   586             pictoInterface->Interface()->DrawPictographsInText(
       
   587                 gc,
       
   588                 *fontUsed,
       
   589                 *Text(),
       
   590                 rect,
       
   591                 textPaneAscent,
       
   592                 textAlign,
       
   593                 0 );
       
   594             }
       
   595         gc.DiscardFont();
       
   596         }
       
   597     else // indicator icon
       
   598         {
       
   599         TInt layoutMode = iLayoutMode;
       
   600 
       
   601         if ( iIndicatorContext == CAknIndicatorContainer::ENaviPaneEditorIndicators )
       
   602             {
       
   603             layoutMode = ELayoutModeWide;
       
   604             }
       
   605         else if ( iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators )
       
   606             {
       
   607             layoutMode = ELayoutModeUsual;
       
   608             }
       
   609 
       
   610         MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   611         TSize iconSize( iIndicatorBitmaps[layoutMode]->At( 0 )->SizeInPixels() );
       
   612         TInt iconWidth  = iconSize.iWidth;
       
   613         TInt iconHeight = iconSize.iHeight;
       
   614 
       
   615         if ( iState != EAknIndicatorStateOff )
       
   616             {
       
   617             // GPRS indicator is actually never drawn here, it is drawn
       
   618             // by the system to the signal pane.
       
   619             if ( iUid == EAknNaviPaneEditorIndicatorGprs )
       
   620                 {
       
   621                 return;
       
   622                 }
       
   623 
       
   624             if ( iUid == EAknNaviPaneEditorIndicatorProgressBar ||
       
   625                  iUid == EAknNaviPaneEditorIndicatorWaitBar )
       
   626                 {
       
   627                 TRgb color( SelectColor( iLayoutMode ) );
       
   628 
       
   629                 // Draw rect outside the bar.
       
   630                 gc.SetPenColor( color );
       
   631                 gc.SetPenStyle( CGraphicsContext::ESolidPen );
       
   632                 gc.DrawRect( rect );
       
   633 
       
   634                 TAknWindowComponentLayout waitPaneComponentLayout(
       
   635                     AknLayoutScalable_Avkon::status_small_wait_pane_g2() );
       
   636 
       
   637                 TAknLayoutRect waitPaneComponentLayoutRect;
       
   638                 waitPaneComponentLayoutRect.LayoutRect( rect, waitPaneComponentLayout );
       
   639                 TRect waitPaneComponentRect( waitPaneComponentLayoutRect.Rect() );
       
   640                 rect = waitPaneComponentRect;
       
   641 
       
   642                 if ( iUid == EAknNaviPaneEditorIndicatorProgressBar )
       
   643                     {
       
   644                     // Calculate the progress amount.
       
   645                     TInt progressInPixels = 0;
       
   646                     if ( iProgressBarMaxValue > 0 )
       
   647                         {
       
   648                         progressInPixels =
       
   649                             ( iconSize.iWidth * iProgressBarValue ) / iProgressBarMaxValue;
       
   650                         }
       
   651                     iconWidth = progressInPixels;
       
   652                     }
       
   653                 }
       
   654 
       
   655             if ( iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 ) &&
       
   656                  iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 + 1 ) )
       
   657                 {
       
   658                 CFbsBitmap* mask = iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 + 1 );
       
   659                 if ( iExtension && iExtension->iFader )
       
   660                     {
       
   661                     mask = iExtension->iFader->FadeMask(
       
   662                         iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 + 1 ) );
       
   663                     }
       
   664 
       
   665                 gc.SetBrushStyle( CGraphicsContext::ENullBrush );
       
   666 
       
   667                 // Draw editor indicator bitmap with mask if it exists
       
   668                 gc.BitBltMasked( TPoint( rect.iTl.iX, rect.iTl.iY ),
       
   669                                  iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 ),
       
   670                                  TRect( 0, 0, iconWidth, iconHeight),
       
   671                                  mask,
       
   672                                  ETrue );
       
   673                 }
       
   674         else if ( iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 ) )
       
   675                 {
       
   676                 // Draw editor indicator bitmap without mask
       
   677                 CFbsBitmap* mask = iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 );
       
   678                 if ( iExtension && iExtension->iFader )
       
   679                     {
       
   680                     mask = iExtension->iFader->FadeMask(
       
   681                         iIndicatorBitmaps[layoutMode]->At( iAnimState * 2 ) );
       
   682                     }
       
   683                 gc.BitBlt( TPoint( rect.iTl.iX,rect.iTl.iY ),
       
   684                            mask,
       
   685                            TRect( 0, 0, iconWidth, iconHeight ) );
       
   686                 }
       
   687             }
       
   688         }
       
   689     }
       
   690 
       
   691 
       
   692 void CAknIndicator::LoadIndicatorBitmapsL(TResourceReader& aReader, TInt aCount)
       
   693     {
       
   694     LoadIndicatorBitmapsL(aReader, aCount, EFalse);
       
   695     }
       
   696 
       
   697 void CAknIndicator::LoadIndicatorBitmapsL(TResourceReader& aReader, TInt aCount, TBool aCreateBitmaps)
       
   698     {
       
   699     TInt bitmapId;
       
   700     TInt maskId;
       
   701 
       
   702     for (TInt ii = 0; ii < aCount; ii++)
       
   703         {
       
   704         for (TInt jj = ELayoutModeUsual; jj <= ELayoutModeWide; jj++)
       
   705             {
       
   706             if ( ( (jj == ELayoutModeWide) &&
       
   707                 (iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators) )
       
   708                 ||
       
   709                 ( (jj == ELayoutModeUsual) &&
       
   710                 (iIndicatorContext == CAknIndicatorContainer::ENaviPaneEditorIndicators) ) )
       
   711                 {
       
   712                 // Do not load query editor bitmaps if navi pane editor indicators is needed
       
   713                 // and vice versa
       
   714                 aReader.ReadInt16(); // bitmaps
       
   715                 aReader.ReadInt16(); // mask
       
   716                 iExtension->iIndicatorBitmapIndexes[jj]->AppendL(0); // bitmap
       
   717                 iExtension->iIndicatorBitmapIndexes[jj]->AppendL(0); // mask
       
   718                 continue;
       
   719                 }
       
   720                 bitmapId = aReader.ReadInt16();
       
   721                 maskId = aReader.ReadInt16();
       
   722 
       
   723                 if (bitmapId == 16446)
       
   724                     {
       
   725                     TInt tmp =     bitmapId+1;
       
   726                     bitmapId = tmp-1;
       
   727                     }
       
   728 
       
   729                 if ( bitmapId == -1 ) // no bitmap
       
   730                     {
       
   731                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(0); // bitmap
       
   732                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(0); // mask
       
   733                     continue;
       
   734                     }
       
   735                 if ( maskId == -1 ) // no mask, just bitmap
       
   736                     {
       
   737                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(bitmapId); // bitmap
       
   738                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(bitmapId); // mask
       
   739                     }
       
   740                 else // both bitmap and mask
       
   741                     {
       
   742                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(bitmapId); // bitmap
       
   743                     iExtension->iIndicatorBitmapIndexes[jj]->AppendL(maskId); // mask
       
   744                     }
       
   745             }
       
   746         }
       
   747 
       
   748     if (aCreateBitmaps)
       
   749         CreateLoadedIndicatorBitmapsL();
       
   750     }
       
   751 
       
   752 
       
   753 void CAknIndicator::CreateLoadedIndicatorBitmapsL()
       
   754     {
       
   755     if (!iExtension->iIndicatorBitmapsCreated)
       
   756         {
       
   757         TInt count = 0;
       
   758         TInt bitmapId = 0;
       
   759         TInt maskId = 0;
       
   760         CFbsBitmap* bitmap = NULL;
       
   761         CFbsBitmap* mask = NULL;
       
   762 
       
   763         for (TInt jj = ELayoutModeUsual; jj <= ELayoutModeWide; jj++)
       
   764             {
       
   765             count = iExtension->iIndicatorBitmapIndexes[jj]->Count();
       
   766             for(TInt ii = 0; ii < count; ii+=2)
       
   767                 {
       
   768                 bitmapId = iExtension->iIndicatorBitmapIndexes[jj]->At(ii);
       
   769                 maskId = iExtension->iIndicatorBitmapIndexes[jj]->At(ii+1);
       
   770 
       
   771                 if (bitmapId && maskId)
       
   772                     {
       
   773                     TAknsItemID dummyId;
       
   774                     dummyId.Set( 0,0 );
       
   775 
       
   776                     TAknsItemID colorGroup;
       
   777                     colorGroup.Set(0,0);
       
   778 
       
   779                     TInt colorIndex = 0;
       
   780 
       
   781                     SelectColorSkin(jj, colorGroup, colorIndex);
       
   782 
       
   783                     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
   784 
       
   785                     if (MultiColorMode())
       
   786                         {
       
   787                         if (iBitmapFile)
       
   788                             AknIconUtils::CreateIconLC( bitmap, mask, *iBitmapFile, bitmapId, maskId );
       
   789                         else
       
   790                             AknIconUtils::CreateIconLC( bitmap, mask, KAvkonBitmapFile, bitmapId, maskId );
       
   791                         }
       
   792                     else
       
   793                         {
       
   794                         if (iBitmapFile)
       
   795                             AknsUtils::CreateColorIconLC( skin, dummyId, colorGroup, colorIndex,
       
   796                                 bitmap, mask, *iBitmapFile, bitmapId, maskId, KRgbGray );
       
   797                         else
       
   798                             AknsUtils::CreateColorIconLC( skin, dummyId, colorGroup, colorIndex,
       
   799                                 bitmap, mask, AknIconUtils::AvkonIconFileName(), bitmapId, maskId, KRgbGray );
       
   800 
       
   801                         iExtension->iIndicatorColorGroup[jj] = colorGroup;
       
   802                         iExtension->iIndicatorColorIndex[jj] = colorIndex;
       
   803                         }
       
   804 
       
   805                     iIndicatorBitmaps[jj]->AppendL(bitmap);
       
   806                     iIndicatorBitmaps[jj]->AppendL(mask);
       
   807                     CleanupStack::Pop(2); // bitmap, mask
       
   808                     }
       
   809                 }
       
   810             }
       
   811         }
       
   812     iExtension->iIndicatorBitmapsCreated = ETrue;
       
   813     }
       
   814 
       
   815 
       
   816 void CAknIndicator::Animate()
       
   817     {
       
   818     iAnimState += 1;
       
   819     if (iAnimState >= iCountOfAnimStates)
       
   820         {
       
   821         iAnimState = 0;
       
   822         }
       
   823     }
       
   824 
       
   825 void CAknIndicator::SetAnimateState(TInt aAnimState)
       
   826     {
       
   827     iAnimState = aAnimState % iCountOfAnimStates;
       
   828     }
       
   829 
       
   830 void CAknIndicator::SetIndicatorValue( TInt aValue, TInt aMaxValue )
       
   831     {
       
   832     // check that values are not insane
       
   833     if ( aValue >= 0    &&
       
   834          aMaxValue >= 0 &&
       
   835          aMaxValue >= aValue )
       
   836         {
       
   837         iProgressBarValue    = aValue;
       
   838         iProgressBarMaxValue = aMaxValue;
       
   839         }
       
   840     SizeChanged();
       
   841     }
       
   842 
       
   843 
       
   844 void CAknIndicator::SetSvgIconSize( CFbsBitmap*& aBitmap, TInt aLayoutMode )
       
   845     {
       
   846     TRect rect( Rect() );
       
   847 
       
   848     TInt indicatorUid = iUid;
       
   849     if (indicatorUid >= EAknNaviPaneEditorIndicatorDynamicUidRangeFirst &&
       
   850         indicatorUid <= EAknNaviPaneEditorIndicatorDynamicUidRangeLast)
       
   851         {
       
   852         indicatorUid = EAknNaviPaneEditorIndicatorDynamicUidRangeFirst;
       
   853         }
       
   854 
       
   855     TSize size(10,10); // default size (every SVG icon needs to be initialized)
       
   856     TScaleMode aspectRatio = EAspectRatioPreservedAndUnusedSpaceRemoved;
       
   857 
       
   858     TRect navipaneRect(0,0,0,0);
       
   859     CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
       
   860     if (statusPane)
       
   861         {
       
   862         CCoeControl* control = NULL;
       
   863         TRAP_IGNORE(control = statusPane->ControlL(TUid::Uid( EEikStatusPaneUidNavi )));
       
   864         if (control)
       
   865             {
       
   866             navipaneRect.SetSize( control->Size() );
       
   867             }
       
   868         }
       
   869 
       
   870     // If navipane is not found, we get portrait normal navipanerect frop laf data which is usually right enough.
       
   871     if (navipaneRect.Size() == TSize(0,0))
       
   872         {
       
   873         TInt battery = 0;
       
   874         TRect statusPaneRect;
       
   875         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
       
   876 
       
   877         if ( AknStatuspaneUtils::IdleLayoutActive() )
       
   878             {
       
   879             if ( ( iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators )
       
   880                 && ( statusPaneRect.Size() == TSize(0,0) ) )
       
   881                 {
       
   882                 battery = 0;
       
   883                 }
       
   884             else
       
   885                 {
       
   886                 battery = 1;
       
   887                 }
       
   888             }
       
   889 
       
   890 
       
   891         // Navi pane
       
   892         TAknWindowComponentLayout naviPaneLayout( AknLayoutScalable_Avkon::navi_pane(battery) );
       
   893         TAknLayoutRect naviPaneLayoutRect;
       
   894         naviPaneLayoutRect.LayoutRect(statusPaneRect, naviPaneLayout);
       
   895         navipaneRect.SetSize( naviPaneLayoutRect.Rect().Size() );
       
   896         }
       
   897 
       
   898     // Screen
       
   899     TRect screenRect;
       
   900     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
       
   901 
       
   902     switch (indicatorUid)
       
   903         {
       
   904         // Status pane's indicators
       
   905         case EAknIndicatorIrActive:
       
   906         case EAknIndicatorEnvelope:
       
   907         case EAknIndicatorEmailMessage:
       
   908         case EAknIndicatorDataMessage:
       
   909         case EAknIndicatorFaxMessage:
       
   910         case EAknIndicatorOtherMessage:
       
   911         case EAknIndicatorSecuredConnection:
       
   912         case EAknIndicatorVoiceMailWaiting:
       
   913         case EAknIndicatorVoiceMailWaitingOnLine1:
       
   914         case EAknIndicatorVoiceMailWaitingOnLine2:
       
   915         case EAknIndicatorVoiceMailWaitingOnBothLines:
       
   916         case EAknIndicatorHomeZone:
       
   917         case EAknIndicatorBluetooth:
       
   918         case EAknIndicatorBluetoothVisible:
       
   919         case EAknIndicatorBluetoothModuleOn:
       
   920         case EAknIndicatorBluetoothModuleOnVisible:
       
   921         case EAknIndicatorOutbox:
       
   922         case EAknIndicatorKeyguard:
       
   923         case EAknIndicatorAllCallsForwarded:
       
   924         case EAknIndicatorCallsForwardedOnLine1:
       
   925         case EAknIndicatorCallsForwardedOnLine2:
       
   926         case EAknIndicatorCallsForwardedOnBothLines:
       
   927         case EAknIndicatorCallsForwardedToVoiceMailbox:
       
   928         case EAknIndicatorSelectedLine:
       
   929         case EAknIndicatorAlarmClock:
       
   930         case EAknIndicatorHeadset:
       
   931         case EAknIndicatorLoopset:
       
   932         case EAknIndicatorIHFActive:
       
   933         case EAknIndicatorInstantMessage:
       
   934         case EAknIndicatorTTY:
       
   935         case EAknIndicatorUSBConnection:
       
   936         case EAknIndicatorMissedCalls:
       
   937         case EAknIndicatorRemoteMailboxEmailMessage:
       
   938         case EAknIndicatorLocation:
       
   939         case EAknIndicatorHeadsetUnavailable:
       
   940         case EAknIndicatorRoaming:
       
   941         case EAknIndicatorLocationOn:
       
   942         case EAknIndicatorLocationOff:
       
   943         case EAknIndicatorPoC:
       
   944         case EAknIndicatorPoCMissed:
       
   945         case EAknIndicatorPoCDnD:
       
   946         case EAknIndicatorVoIP:
       
   947         case EAknIndicatorWlanAvailable:
       
   948         case EAknIndicatorWlanActive:
       
   949         case EAknIndicatorWlanActiveSecure:
       
   950         case EAknIndicatorCarkit:
       
   951         case EAknIndicatorTvOut:
       
   952         case EAknIndicatorHDMI:
       
   953         case EAknIndicatorMobileTV:
       
   954         case EAknIndicatorMobileTVRec:
       
   955         case EAknIndicatorHAC:
       
   956         case EAknIndicatorMemoryCard:
       
   957         case EAknIndicatorTARM:
       
   958         case EAknIndicatorTARMModuleOn:
       
   959         case EAknIndicatorVideoSharing:
       
   960         case EAknIndicatorSynchronization:
       
   961         case EAknIndicatorGPS:
       
   962         case EAknIndicatorFMTxSending:
       
   963         case EAknIndicatorFMTxEnabled:
       
   964         case EAknIndicatorMissedCalendarAlarm:
       
   965         case EAknIndicatorUSBMemConnected:
       
   966         case EAknIndicatorUSBMemActive:
       
   967         case EAknIndicatorStopWatch:
       
   968         case EAknIndicatorMecoServiceTab:
       
   969             {
       
   970             // Main pane
       
   971             TRect mainPaneRect;
       
   972             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
       
   973                                                mainPaneRect );
       
   974 
       
   975             // statuspane, usual
       
   976             TRect usualStatusPaneRect;
       
   977             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane,
       
   978                                                usualStatusPaneRect );
       
   979 
       
   980             // status indicator pane elements
       
   981             TRect statusIndicatorPaneElementsRect;
       
   982             AknLayoutUtils::LayoutMetricsRect(
       
   983                 AknLayoutUtils::EIndicatorPane,
       
   984                 statusIndicatorPaneElementsRect );
       
   985 
       
   986             // universal indicator pane (note statuspane as parent)
       
   987             TAknLayoutRect universalIndicatorPaneLayoutRect;
       
   988             universalIndicatorPaneLayoutRect.LayoutRect(
       
   989                 usualStatusPaneRect,
       
   990                 AknLayoutScalable_Avkon::uni_indicator_pane( 0 ) );
       
   991             TRect universalIndicatorPaneRect(
       
   992                 universalIndicatorPaneLayoutRect.Rect() );
       
   993 
       
   994             // universal indicator pane elements
       
   995             TAknLayoutRect universalIndicatorPaneElementsLayoutRect;
       
   996             universalIndicatorPaneElementsLayoutRect.LayoutRect(
       
   997                 universalIndicatorPaneRect,
       
   998                 AknLayoutScalable_Avkon::uni_indicator_pane_g1() );
       
   999             TRect universalIndicatorPaneElementsRect(
       
  1000                 universalIndicatorPaneElementsLayoutRect.Rect() );
       
  1001 
       
  1002             if ( aLayoutMode == ELayoutModeUsual )
       
  1003                 {
       
  1004                 size = universalIndicatorPaneElementsRect.Size();
       
  1005                 }
       
  1006 
       
  1007             if ( aLayoutMode == ELayoutModeWide )
       
  1008                 {
       
  1009                 size = statusIndicatorPaneElementsRect.Size();
       
  1010                 }
       
  1011 
       
  1012             // Stacon special cases
       
  1013             if ( AknStatuspaneUtils::StaconPaneActive() &&
       
  1014                  !AknStatuspaneUtils::IdleLayoutActive() &&
       
  1015                  !AknStatuspaneUtils::ExtendedStaconPaneActive())
       
  1016                 {
       
  1017                 size = Size();
       
  1018                 }
       
  1019             else if ( AknStatuspaneUtils::ExtendedStaconPaneActive() )
       
  1020                 {
       
  1021                 size = Size();
       
  1022                 }
       
  1023 
       
  1024             // Flat special cases
       
  1025             if ( AknStatuspaneUtils::FlatLayoutActive() )
       
  1026                 {
       
  1027                 size = Size();
       
  1028                 }
       
  1029 
       
  1030             // Portrait extended cases
       
  1031             if ( AknStatuspaneUtils::ExtendedLayoutActive() )
       
  1032                 {
       
  1033                 size = Size();
       
  1034                 if ( AknStatuspaneUtils::IdleLayoutActive() &&
       
  1035                      !AknStatuspaneUtils::HDLayoutActive() )
       
  1036                     {
       
  1037                     aspectRatio = EAspectRatioPreserved;
       
  1038                     }
       
  1039                 }
       
  1040 
       
  1041             // In landscape idle we use vertical indicators if parent
       
  1042             // is in vertical mode, otherwise horizontal.
       
  1043             if ( AknStatuspaneUtils::IdleLayoutActive() &&
       
  1044                  Layout_Meta_Data::IsLandscapeOrientation() &&
       
  1045                  iParent->Size().iWidth < iParent->Size().iHeight )
       
  1046                 {
       
  1047                 size = Size();
       
  1048                 }
       
  1049 
       
  1050             break;
       
  1051             }
       
  1052 
       
  1053         // Navi pane editor indicators
       
  1054         case EAknNaviPaneEditorIndicatorT9:
       
  1055         case EAknNaviPaneEditorIndicatorUpperCase:
       
  1056         case EAknNaviPaneEditorIndicatorLowerCase:
       
  1057         case EAknNaviPaneEditorIndicatorTextCase:
       
  1058         case EAknNaviPaneEditorIndicatorNumberCase:
       
  1059         case EAknNaviPaneEditorIndicatorQuery:
       
  1060         case EAknNaviPaneEditorIndicatorQwertyShift:
       
  1061 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1062         case EAknNaviPaneEditorIndicatorAutoComplete:
       
  1063 #endif //RD_INTELLIGENT_TEXT_INPUT
       
  1064 
       
  1065         // select mode variants
       
  1066         case EAknNaviPaneEditorIndicatorUpperCaseSelect:
       
  1067         case EAknNaviPaneEditorIndicatorLowerCaseSelect:
       
  1068         case EAknNaviPaneEditorIndicatorTextCaseSelect:
       
  1069         case EAknNaviPaneEditorIndicatorNumberCaseSelect:
       
  1070 
       
  1071         case EAknNaviPaneEditorIndicatorArabicCase:
       
  1072         case EAknNaviPaneEditorIndicatorHebrewCase:
       
  1073         case EAknNaviPaneEditorIndicatorArabicIndicNumberCase:
       
  1074 
       
  1075         // FARSI AND URDU
       
  1076         case EAknNaviPaneEditorIndicatorFarsiAndUrduCase:
       
  1077 
       
  1078         // APAC
       
  1079         case EAknNaviPaneEditorIndicatorPinyin:
       
  1080         case EAknNaviPaneEditorIndicatorZhuyin:
       
  1081         case EAknNaviPaneEditorIndicatorStroke: // Stroke editor indicator for simplified Chinese.
       
  1082         case EAknNaviPaneEditorIndicatorCangJie:
       
  1083 
       
  1084         case EAknNaviPaneEditorIndicatorZhuyinFind:
       
  1085         case EAknNaviPaneEditorIndicatorStrokeFind:
       
  1086         case EAknNaviPaneEditorIndicatorPinyinPhrase:
       
  1087         case EAknNaviPaneEditorIndicatorZhuyinPhrase:
       
  1088         case EAknNaviPaneEditorIndicatorStrokePhrase:
       
  1089         case EAknNaviPaneEditorIndicatorStrokeTradPhrase:
       
  1090 
       
  1091         // THAI
       
  1092         case EAknNaviPaneEditorIndicatorThai:
       
  1093         // HINDI
       
  1094 //        #ifdef RD_HINDI
       
  1095         case EAknNaviPaneEditorIndicatorDevanagariCase:
       
  1096         case EAknNaviPaneEditorIndicatorDevanagariIndicNumberCase:
       
  1097 //        #endif //RD_HINDI
       
  1098 #ifdef RD_HINDI_PHONETIC_INPUT
       
  1099         case EAknNaviPaneEditorIndicatorDevanagariPhoneticUpperCase:
       
  1100         case EAknNaviPaneEditorIndicatorDevanagariPhoneticLowerCase:
       
  1101 #endif
       
  1102         case EAknNaviPaneEditorIndicatorStrokeTrad:  // Stroke editor indicator for traditional Chinese.
       
  1103 
       
  1104         // Vietnamese
       
  1105         case EAknNaviPaneEditorIndicatorVietnameseUpperCase:
       
  1106         case EAknNaviPaneEditorIndicatorVietnameseLowerCase:
       
  1107         case EAknNaviPaneEditorIndicatorVietnameseTextCase:
       
  1108         
       
  1109         // Greek   
       
  1110         case EAknNaviPaneEditorIndicatorGreekUpperCase:
       
  1111         case EAknNaviPaneEditorIndicatorGreekLowerCase:
       
  1112         case EAknNaviPaneEditorIndicatorGreekTextCase:
       
  1113         
       
  1114         // Cyrillic   
       
  1115         case EAknNaviPaneEditorIndicatorCyrillicUpperCase:
       
  1116         case EAknNaviPaneEditorIndicatorCyrillicLowerCase:
       
  1117         case EAknNaviPaneEditorIndicatorCyrillicTextCase:
       
  1118         
       
  1119         // Navi pane editor indicators for Japanese
       
  1120         case EAknNaviPaneEditorIndicatorJapaneseHiraganaKanji:      // Hiragana/Kanji
       
  1121         case EAknNaviPaneEditorIndicatorJapaneseHiragana:           // Hiragana
       
  1122         case EAknNaviPaneEditorIndicatorJapaneseFullKatakana:       // Full-width Katakana
       
  1123         case EAknNaviPaneEditorIndicatorJapaneseHalfKatakana:       // Half-width Katakana
       
  1124         case EAknNaviPaneEditorIndicatorJapaneseFullUpperAlphabet:  // Full-width Upper Case alphabet
       
  1125         case EAknNaviPaneEditorIndicatorJapaneseFullLowerAlphabet:  // Full-width Lower Case alphabet
       
  1126         case EAknNaviPaneEditorIndicatorJapaneseFullTextAlphabet:   // Full-width Text Case alphabet
       
  1127         case EAknNaviPaneEditorIndicatorJapaneseFullNumeric:        // Full-width numeric
       
  1128 
       
  1129 		// Navi pane editor indicators for Korean
       
  1130         case EAknNaviPaneEditorIndicatorKoreanHangul:
       
  1131         case EAknNaviPaneEditorIndicatorKoreanHangulSelect:
       
  1132 
       
  1133         // Application indicators to editor indicator pane
       
  1134         case EAknNaviPaneEditorIndicatorAudioAttached:
       
  1135         case EAknNaviPaneEditorIndicatorImageAttached:
       
  1136         case EAknNaviPaneEditorIndicatorObjects:
       
  1137         case EAknNaviPaneEditorIndicatorAttachment:
       
  1138         case EAknNaviPaneEditorIndicatorMcePriorityHigh:
       
  1139         case EAknNaviPaneEditorIndicatorMcePriorityLow:
       
  1140         case EAknNaviPaneEditorIndicatorMessageLength:
       
  1141         case EAknNaviPaneEditorIndicatorMessageInfo:
       
  1142         case EAknNaviPaneEditorIndicatorDynamicUidRangeFirst: // all custom indicators use this
       
  1143 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1144         case EAknNaviPaneEditorIndicatorFnKeyPressed:
       
  1145         case EAknNaviPaneEditorIndicatorFnKeyLocked:
       
  1146 #endif
       
  1147             {
       
  1148             TAknWindowComponentLayout l1 = AknLayoutScalable_Avkon::navi_icon_pane(0);
       
  1149             TAknWindowComponentLayout l2 = AknLayoutScalable_Avkon::navi_icon_pane_g1();
       
  1150             TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( l1, l2 );
       
  1151 
       
  1152             TAknLayoutRect layoutRect;
       
  1153             layoutRect.LayoutRect( navipaneRect, layout );
       
  1154             TRect rect( layoutRect.Rect() );
       
  1155             size = rect.Size();
       
  1156             break;
       
  1157             }
       
  1158 
       
  1159         // Extra application indicators to editor indicator pane
       
  1160         // in small or nHD status pane layout.
       
  1161         case EAknNaviPaneEditorIndicatorWaitBar:
       
  1162         case EAknNaviPaneEditorIndicatorProgressBar:
       
  1163             {
       
  1164             TAknLayoutRect waitPaneComponentLayoutRect;
       
  1165             waitPaneComponentLayoutRect.LayoutRect(
       
  1166                 rect,
       
  1167                 AknLayoutScalable_Avkon::status_small_wait_pane_g2() );
       
  1168             TRect waitPaneComponentRect( waitPaneComponentLayoutRect.Rect() );
       
  1169 
       
  1170             size        = waitPaneComponentRect.Size();
       
  1171             aspectRatio = EAspectRatioNotPreserved;
       
  1172             break;
       
  1173             }
       
  1174 
       
  1175         case EAknNaviPaneEditorIndicatorWmlWindows:
       
  1176         case EAknNaviPaneEditorIndicatorWmlWaitGlobe:
       
  1177         case EAknNaviPaneEditorIndicatorSecuredConnection:
       
  1178         case EAknNaviPaneEditorIndicatorGprs:
       
  1179         case EAknNaviPaneEditorIndicatorFileSize:
       
  1180         case EAknNaviPaneEditorIndicatorWlanAvailable:
       
  1181         case EAknNaviPaneEditorIndicatorWlanActive:
       
  1182         case EAknNaviPaneEditorIndicatorWlanActiveSecure:
       
  1183             {
       
  1184             // app window
       
  1185             TAknWindowComponentLayout applicationWindowLayout( AknLayoutScalable_Avkon::application_window(0) );
       
  1186             TAknLayoutRect applicationWindowLayoutRect;
       
  1187             applicationWindowLayoutRect.LayoutRect( screenRect, applicationWindowLayout );
       
  1188             TRect applicationWindowRect( applicationWindowLayoutRect.Rect() );
       
  1189 
       
  1190             // top area
       
  1191             TAknWindowComponentLayout topAreaLayout( AknLayoutScalable_Avkon::area_top_pane(1) );
       
  1192             TAknLayoutRect topAreaLayoutRect;
       
  1193             topAreaLayoutRect.LayoutRect( applicationWindowRect, topAreaLayout );
       
  1194             TRect topAreaRect( topAreaLayoutRect.Rect() );
       
  1195 
       
  1196             // small statuspane
       
  1197             TAknWindowComponentLayout smallStatusPaneLayout( AknLayoutScalable_Avkon::status_small_pane() );
       
  1198             TAknLayoutRect smallStatusPaneLayoutRect;
       
  1199             smallStatusPaneLayoutRect.LayoutRect( topAreaRect, smallStatusPaneLayout );
       
  1200             TRect smallStatusPaneRect( smallStatusPaneLayoutRect.Rect() );
       
  1201 
       
  1202             // icon pane
       
  1203             TAknWindowComponentLayout iconPaneLayout( AknLayoutScalable_Avkon::status_small_icon_pane() );
       
  1204             TAknLayoutRect iconPaneLayoutRect;
       
  1205             iconPaneLayoutRect.LayoutRect( smallStatusPaneRect, iconPaneLayout );
       
  1206             TRect iconPaneRect( iconPaneLayoutRect.Rect() );
       
  1207 
       
  1208             size = iconPaneRect.Size();
       
  1209             break;
       
  1210             }
       
  1211 
       
  1212         default:
       
  1213             {
       
  1214             break; // default size (10,10) used - no indicator should get this
       
  1215             }
       
  1216         }
       
  1217 
       
  1218     AknIconUtils::SetSize( aBitmap, size, aspectRatio );
       
  1219     }
       
  1220 
       
  1221 
       
  1222 void CAknIndicator::SizeChanged()
       
  1223     {
       
  1224     // Optimization, we do not set sizes etc. if state is off.
       
  1225     if (iState == EAknIndicatorStateOff)
       
  1226         return;
       
  1227 
       
  1228     // Check for skin color change (because of layout might have changed)
       
  1229     TAknsItemID selectedColorGroup;
       
  1230     selectedColorGroup.Set(0,0);
       
  1231     TInt selectedColorIndex = 0;
       
  1232     SelectColorSkin(iLayoutMode, selectedColorGroup, selectedColorIndex);
       
  1233 
       
  1234     TAknsItemID activeColorGroup;
       
  1235     activeColorGroup.Set(0,0);
       
  1236     TInt activeColorIndex   = 0;
       
  1237     ActiveColorSkin(iLayoutMode, activeColorGroup, activeColorIndex);
       
  1238 
       
  1239     TBool colorMode = MultiColorMode();
       
  1240     if ( !colorMode && ( activeColorGroup != selectedColorGroup
       
  1241             || activeColorIndex != selectedColorIndex ))
       
  1242         DeleteBitmaps();
       
  1243 
       
  1244     // This method creates actual bitmaps if not yet created.
       
  1245     TRAP_IGNORE(CreateLoadedIndicatorBitmapsL());
       
  1246 
       
  1247     if ( iIndicatorBitmaps[iLayoutMode] && Size() != TSize(0,0))
       
  1248         {
       
  1249         TInt count = iIndicatorBitmaps[iLayoutMode]->Count();
       
  1250         for(TInt ii = 0; ii < count; ii++)
       
  1251             {
       
  1252             SetSvgIconSize(iIndicatorBitmaps[iLayoutMode]->At(ii),iLayoutMode);
       
  1253             }
       
  1254         }
       
  1255 
       
  1256     if (DynamicTextIndicator())
       
  1257         {
       
  1258         TRAP_IGNORE(SetupDynamicIndicatorTextL(Size().iWidth));
       
  1259         }
       
  1260     }
       
  1261 
       
  1262 void CAknIndicator::SetIndicatorFader(CAknIndicatorFader* aFader)
       
  1263     {
       
  1264     if (iExtension)
       
  1265         {
       
  1266         iExtension->iFader = aFader;
       
  1267         }
       
  1268     }
       
  1269 /**
       
  1270  *
       
  1271  */
       
  1272 void CAknIndicator::HandleResourceChange( TInt aType )
       
  1273     {
       
  1274     CCoeControl::HandleResourceChange( aType );
       
  1275     if ( aType == KEikDynamicLayoutVariantSwitch || aType == KEikColorResourceChange ||
       
  1276         aType == KAknsMessageSkinChange )
       
  1277         {
       
  1278         DeleteBitmaps();
       
  1279         SizeChanged(); // reloads bitmaps if needed.
       
  1280         DrawDeferred();
       
  1281         }
       
  1282     }
       
  1283 
       
  1284 TRgb CAknIndicator::SelectColor(TInt aLayoutMode) const
       
  1285     {
       
  1286     TRgb color( KRgbGray );
       
  1287     TAknsItemID colorGroup;
       
  1288     colorGroup.Set(0,0);
       
  1289     TInt colorIndex = 0;
       
  1290     SelectColorSkin(aLayoutMode, colorGroup, colorIndex);
       
  1291     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1292     AknsUtils::GetCachedColor( skin, color, colorGroup, colorIndex );
       
  1293     return color;
       
  1294     }
       
  1295 
       
  1296 TRgb CAknIndicator::ActiveColor(TInt aLayoutMode)
       
  1297     {
       
  1298     TRgb color( KRgbGray );
       
  1299     TAknsItemID colorGroup;
       
  1300     colorGroup.Set(0,0);
       
  1301     TInt colorIndex = 0;
       
  1302     ActiveColorSkin(aLayoutMode, colorGroup, colorIndex);
       
  1303     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1304     AknsUtils::GetCachedColor( skin, color, colorGroup, colorIndex );
       
  1305     return color;
       
  1306     }
       
  1307 
       
  1308 EXPORT_C void CAknIndicator::HandlePointerEventL(
       
  1309     const TPointerEvent& aPointerEvent )
       
  1310     {
       
  1311     CCoeControl::HandlePointerEventL( aPointerEvent );
       
  1312     }
       
  1313 
       
  1314 EXPORT_C void CAknIndicator::SetIndicatorObserver(
       
  1315     MAknIndicatorObserver* /*aIndicatorObserver*/ )
       
  1316     {
       
  1317     // Use of this method is deprecated.
       
  1318     // Empty implementation is left here just for preserving binary compatibility
       
  1319     }
       
  1320 
       
  1321 void CAknIndicator::SetupDynamicIndicatorTextL(TInt aWidth)
       
  1322     {
       
  1323     __ASSERT_ALWAYS( iIndicatorTypeText, Panic(EAknPanicOutOfRange));
       
  1324 
       
  1325     if (DynamicTextIndicator())
       
  1326         {
       
  1327         delete iExtension->iDynamicIndicatorText;
       
  1328         iExtension->iDynamicIndicatorText = NULL;
       
  1329 
       
  1330         if (iIndicatorText)
       
  1331             {
       
  1332             TAknTextComponentLayout line;
       
  1333             if (AknStatuspaneUtils::SmallLayoutActive() || AknStatuspaneUtils::StaconPaneActive())
       
  1334                 {
       
  1335                 line = AknLayoutScalable_Avkon::status_small_pane_t1(0);
       
  1336                 }
       
  1337             else
       
  1338                 {
       
  1339                 TAknWindowComponentLayout layout( AknLayoutScalable_Avkon::navi_text_pane(0) );
       
  1340                 TAknTextComponentLayout l2( AknLayoutScalable_Avkon::navi_text_pane_t1() );
       
  1341                 line = TAknWindowComponentLayout::ComposeText( layout, l2 );
       
  1342                 }
       
  1343 
       
  1344             const CFont* fontUsed = AknLayoutUtils::FontFromId( line.LayoutLine().FontId() );
       
  1345 
       
  1346             HBufC* clippedString = HBufC::NewLC( iIndicatorText->Length() + KAknBidiExtraSpacePerLine );
       
  1347             *clippedString = *iIndicatorText;
       
  1348             TPtr clippedStringPtr = clippedString->Des();
       
  1349             AknBidiTextUtils::ConvertToVisualAndClipL(
       
  1350                 clippedStringPtr,
       
  1351                 *fontUsed,
       
  1352                 aWidth,
       
  1353                 aWidth);
       
  1354 
       
  1355             iExtension->iDynamicIndicatorText = clippedString;
       
  1356             CleanupStack::Pop(); // clippedString
       
  1357             }
       
  1358         }
       
  1359     }
       
  1360 
       
  1361 TBool CAknIndicator::DynamicTextIndicator() const
       
  1362     {
       
  1363     return (iIndicatorTypeText && iExtension->iDynamicTextIndicator);
       
  1364     }
       
  1365 
       
  1366 HBufC* CAknIndicator::Text() const
       
  1367     {
       
  1368     if (DynamicTextIndicator() && iExtension->iDynamicIndicatorText)
       
  1369         {
       
  1370         return iExtension->iDynamicIndicatorText;
       
  1371         }
       
  1372     else
       
  1373         {
       
  1374         return iIndicatorText;
       
  1375         }
       
  1376     }
       
  1377 
       
  1378 void CAknIndicator::SetMultiColorMode(TBool aMultiColor)
       
  1379     {
       
  1380     iExtension->iMultiColorMode = aMultiColor;
       
  1381     }
       
  1382 
       
  1383 TBool CAknIndicator::MultiColorMode() const
       
  1384     {
       
  1385     return iExtension->iMultiColorMode;
       
  1386     }
       
  1387 
       
  1388 void CAknIndicator::SetIndicatorPosition(TInt aPosition)
       
  1389     {
       
  1390     iExtension->iIndicatorPosition = aPosition;
       
  1391     }
       
  1392 
       
  1393 TInt CAknIndicator::IndicatorPosition() const
       
  1394     {
       
  1395     return iExtension->iIndicatorPosition;
       
  1396     }
       
  1397 
       
  1398 
       
  1399 // ---------------------------------------------------------------------------
       
  1400 // static CAknIndicator::GetBitmapIndex
       
  1401 // ---------------------------------------------------------------------------
       
  1402 //
       
  1403 EXPORT_C void CAknIndicator::GetBitmapIndexL( TInt  aIndicatorContext,
       
  1404                                               TInt aIndicatorID,
       
  1405                                               TInt& aBitmapIndex,
       
  1406                                               TInt& aMaskIndex )
       
  1407     {
       
  1408     TResourceReader reader;
       
  1409 
       
  1410     TInt resourceID = 0;
       
  1411     switch ( aIndicatorContext )
       
  1412         {
       
  1413         case CAknIndicatorContainer::EUniversalIndicators:
       
  1414             {
       
  1415             resourceID = R_AVKON_STATUS_PANE_INDICATOR_DEFAULT;
       
  1416             break;
       
  1417             }
       
  1418         case CAknIndicatorContainer::ENaviPaneEditorIndicators:
       
  1419         case CAknIndicatorContainer::EQueryEditorIndicators: // fallthrough
       
  1420             {
       
  1421             resourceID = R_AVKON_NAVI_PANE_EDITOR_INDICATORS;
       
  1422             break;
       
  1423             }
       
  1424         default:
       
  1425             {
       
  1426             resourceID = KErrNotFound;
       
  1427             break;
       
  1428             }
       
  1429         }
       
  1430 
       
  1431     TInt indicatorCount = 0;
       
  1432     if ( resourceID != KErrNotFound )
       
  1433         {
       
  1434         CCoeEnv::Static()->CreateResourceReaderLC(
       
  1435             reader,
       
  1436             resourceID );
       
  1437         indicatorCount = reader.ReadInt16();
       
  1438         }
       
  1439     else
       
  1440         {
       
  1441         aBitmapIndex = KErrNotFound;
       
  1442         aMaskIndex = KErrNotFound;
       
  1443         }
       
  1444 
       
  1445     for ( TInt ii = 0; ii < indicatorCount; ii++ )
       
  1446         {
       
  1447         TInt foundUid = reader.ReadInt16();
       
  1448         if ( foundUid == aIndicatorID )
       
  1449             {
       
  1450             reader.ReadInt16(); // narrow priority
       
  1451             reader.ReadInt16(); // wide priority
       
  1452             HBufC* bitmapFile = reader.ReadHBufCL();
       
  1453             CleanupStack::PushL( bitmapFile );
       
  1454 
       
  1455             TInt stateCount = reader.ReadInt16();
       
  1456             TInt state      = reader.ReadInt16();
       
  1457             TInt iconCount  = reader.ReadInt16();
       
  1458 
       
  1459             if ( state == EAknIndicatorStateAnimate )
       
  1460                 {
       
  1461                 for ( TInt j = 0; j < iconCount - 1; j++ )
       
  1462                     {
       
  1463                     // Use the last animation frame
       
  1464                     // in case of animated indicator.
       
  1465                     reader.ReadInt16();
       
  1466                     reader.ReadInt16();
       
  1467                     reader.ReadInt16();
       
  1468                     reader.ReadInt16();
       
  1469                     }
       
  1470                 }
       
  1471 
       
  1472             aBitmapIndex = reader.ReadInt16();
       
  1473             aMaskIndex   = reader.ReadInt16();
       
  1474 
       
  1475 
       
  1476             if ( aBitmapIndex == KErrNotFound )
       
  1477                 {
       
  1478                 aBitmapIndex = reader.ReadInt16();
       
  1479                 aMaskIndex   = reader.ReadInt16();
       
  1480                 }
       
  1481 
       
  1482             CleanupStack::PopAndDestroy( bitmapFile );
       
  1483             break;
       
  1484             }
       
  1485         else
       
  1486 		 	{
       
  1487 	    	reader.ReadInt16();
       
  1488 	    	reader.ReadInt16();
       
  1489 	    	HBufC* bitmapFile = reader.ReadHBufCL(); // bmp filename
       
  1490 	    	delete bitmapFile;
       
  1491 	    	bitmapFile = NULL;
       
  1492 		    TInt numberOfStates = reader.ReadInt16();  // Number of states
       
  1493 	    	for ( TInt j = 0; j < numberOfStates; j++ )
       
  1494 	        	{
       
  1495 	        	reader.ReadInt16(); // State id
       
  1496 				TInt numberOfIcons = reader.ReadInt16();
       
  1497 			    for ( TInt jj = 0; jj < numberOfIcons; jj++ )
       
  1498 			        {
       
  1499 			        for ( TInt jjj = CAknIndicator::ELayoutModeUsual; jjj <= CAknIndicator::ELayoutModeWide; jjj++ )
       
  1500 			            {
       
  1501 		                reader.ReadInt16(); // bitmaps
       
  1502 		                reader.ReadInt16(); // mask
       
  1503 			            }
       
  1504 	                }
       
  1505 	            }
       
  1506 	        }
       
  1507         }
       
  1508 
       
  1509     if ( resourceID != KErrNotFound )
       
  1510         {
       
  1511         CleanupStack::PopAndDestroy(); // reader
       
  1512         }
       
  1513     }
       
  1514 
       
  1515 void CAknIndicator::SelectColorSkin( TInt aLayoutMode,
       
  1516                                      TAknsItemID& aColorGroup,
       
  1517                                      TInt& aColorIndex ) const
       
  1518     {
       
  1519     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1520 
       
  1521     switch( iIndicatorContext )
       
  1522         {
       
  1523         case CAknIndicatorContainer::ENaviPaneEditorIndicators:
       
  1524             if ( AknStatuspaneUtils::StaconPaneActive() ||
       
  1525                  ( AknStatuspaneUtils::SmallLayoutActive() &&
       
  1526                    Layout_Meta_Data::IsLandscapeOrientation() ) )
       
  1527                 {
       
  1528                 if (iIndicatorTypeText)
       
  1529                     {
       
  1530                     aColorGroup = KAknsIIDQsnTextColors;
       
  1531                     aColorIndex = EAknsCIQsnTextColorsCG43;
       
  1532                     }
       
  1533                 else
       
  1534                     {
       
  1535                     aColorGroup = KAknsIIDQsnIconColors;
       
  1536                     aColorIndex = EAknsCIQsnIconColorsCG22;
       
  1537                     }
       
  1538                 }
       
  1539             else
       
  1540                 {
       
  1541                 if (iIndicatorTypeText)
       
  1542                     {
       
  1543                     aColorGroup = KAknsIIDQsnTextColors;
       
  1544                     aColorIndex = EAknsCIQsnTextColorsCG2;
       
  1545                     }
       
  1546                 else
       
  1547                     {
       
  1548                     aColorGroup = KAknsIIDQsnIconColors;
       
  1549                     aColorIndex = EAknsCIQsnIconColorsCG4;
       
  1550                     }
       
  1551                 }
       
  1552             break;
       
  1553 
       
  1554         case CAknIndicatorContainer::EUniversalIndicators:
       
  1555             if (AknStatuspaneUtils::StaconPaneActive())
       
  1556                 {
       
  1557                 // Status indicators in stacon pane
       
  1558                 if (AknStatuspaneUtils::IdleLayoutActive() && !AknStatuspaneUtils::ExtendedStaconPaneActive())
       
  1559                     {
       
  1560                     // Idle is similar to portraid, but it is not used if extended stacon is active.
       
  1561                     aColorGroup = KAknsIIDQsnIconColors;
       
  1562                     aColorIndex = EAknsCIQsnIconColorsCG1;
       
  1563                     }
       
  1564                 else
       
  1565                     {
       
  1566                     // usual has own color group
       
  1567                     aColorGroup = KAknsIIDQsnIconColors;
       
  1568                     aColorIndex = EAknsCIQsnIconColorsCG20;
       
  1569                     }
       
  1570                 }
       
  1571             else if (AknStatuspaneUtils::FlatLayoutActive())
       
  1572                 {
       
  1573                 if (AknStatuspaneUtils::ExtendedFlatLayoutActive())
       
  1574                     {
       
  1575                     // TODO: NO colors specified yet, use left cba colors
       
  1576                     if (AknStatuspaneUtils::IdleLayoutActive())
       
  1577                         {
       
  1578                         aColorGroup = KAknsIIDQsnTextColors;
       
  1579                         aColorIndex = EAknsCIQsnTextColorsCG15;
       
  1580                         }
       
  1581                     else
       
  1582                         {
       
  1583                         aColorGroup = KAknsIIDQsnTextColors;
       
  1584                         aColorIndex = EAknsCIQsnTextColorsCG13;
       
  1585                         }
       
  1586 
       
  1587                     }
       
  1588                 else
       
  1589                     {
       
  1590                     if (AknStatuspaneUtils::IdleLayoutActive())
       
  1591                         {
       
  1592                         // Idle is similar to portraid
       
  1593                         aColorGroup = KAknsIIDQsnIconColors;
       
  1594                         aColorIndex = EAknsCIQsnIconColorsCG1;
       
  1595                         }
       
  1596                     else
       
  1597                         {
       
  1598                         // Flat usual uses stacon pane color group
       
  1599                         aColorGroup = KAknsIIDQsnIconColors;
       
  1600                         aColorIndex = EAknsCIQsnIconColorsCG20;
       
  1601                         }
       
  1602                     }
       
  1603                 }
       
  1604             else if ( AknStatuspaneUtils::HDLayoutActive() )
       
  1605                 {
       
  1606                 aColorGroup = KAknsIIDQsnIconColors;
       
  1607                 aColorIndex = EAknsCIQsnIconColorsCG20;
       
  1608                 }
       
  1609             else
       
  1610                 {
       
  1611                 if( aLayoutMode == ELayoutModeWide )
       
  1612                     {
       
  1613                     // Status indicators (in idle)
       
  1614                     aColorGroup = KAknsIIDQsnIconColors;
       
  1615                     aColorIndex = EAknsCIQsnIconColorsCG1;
       
  1616                     }
       
  1617                 else
       
  1618                     {
       
  1619                     // Universal indicators
       
  1620                     aColorGroup = KAknsIIDQsnIconColors;
       
  1621                     aColorIndex = EAknsCIQsnIconColorsCG2;
       
  1622                     }
       
  1623                 }
       
  1624             break;
       
  1625 
       
  1626         case CAknIndicatorContainer::EQueryEditorIndicators:
       
  1627         case CAknIndicatorContainer::EFindIndicators:
       
  1628             {
       
  1629             aColorGroup = KAknsIIDQsnIconColors;
       
  1630             aColorIndex = EAknsCIQsnIconColorsCG10;
       
  1631             }
       
  1632             break;
       
  1633 
       
  1634         default:
       
  1635             return;
       
  1636         }
       
  1637     }
       
  1638 
       
  1639 
       
  1640 void CAknIndicator::ActiveColorSkin( TInt aLayoutMode,
       
  1641                                      TAknsItemID& aColorGroup,
       
  1642                                      TInt& aColorIndex ) const
       
  1643     {
       
  1644     aColorGroup = iExtension->iIndicatorColorGroup[aLayoutMode];
       
  1645     aColorIndex = iExtension->iIndicatorColorIndex[aLayoutMode];
       
  1646     }
       
  1647 
       
  1648 
       
  1649 void CAknIndicator::DeleteBitmaps()
       
  1650     {
       
  1651     if ( iIndicatorBitmaps[ELayoutModeUsual] )
       
  1652         {
       
  1653         TInt count = iIndicatorBitmaps[ELayoutModeUsual]->Count();
       
  1654         for ( TInt ii = 0; ii < count; ii++ )
       
  1655             {
       
  1656             delete iIndicatorBitmaps[ELayoutModeUsual]->At( ii );
       
  1657             }
       
  1658         iIndicatorBitmaps[ELayoutModeUsual]->Reset();
       
  1659         }
       
  1660 
       
  1661     if ( iIndicatorBitmaps[ELayoutModeWide] )
       
  1662         {
       
  1663         TInt count = iIndicatorBitmaps[ELayoutModeWide]->Count();
       
  1664         for ( TInt ii = 0; ii < count; ii++ )
       
  1665             {
       
  1666             delete iIndicatorBitmaps[ELayoutModeWide]->At( ii );
       
  1667             }
       
  1668         iIndicatorBitmaps[ELayoutModeWide]->Reset();
       
  1669         }
       
  1670     iExtension->iIndicatorBitmapsCreated = EFalse;
       
  1671     }
       
  1672 
       
  1673 //  End of File