idlehomescreen/exths/inc/pluginif/extrstandbyscrutil.inl
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Define the Util API for a external standby screen
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDES
       
    21 #include <aknlayout.cdl.h>
       
    22 #include <skinlayout.cdl.h>
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // CExtrStandbyScr::Draw
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 inline void CExtrStandbyScr::Draw(const TRect& /*aRect*/) const
       
    29      {
       
    30      if (IsDimmed())
       
    31         {
       
    32         return ;
       
    33         }
       
    34 
       
    35     TRect rect( Rect() );
       
    36 
       
    37     CWindowGc& gc = SystemGc();
       
    38 
       
    39     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
       
    40     MAknsSkinInstance* aknsInst = AknsUtils::SkinInstance();
       
    41 
       
    42     // draw(clear) background
       
    43     //AknsDrawUtils::Background( aknsInst, cc, gc, rect );
       
    44     // Draw background starting from correct offset. May cause flicker if derived class
       
    45     // has not registered control position with AknsUtils::RegisterControlPosition
       
    46     AknsDrawUtils::Background( aknsInst, cc, this, gc, rect );
       
    47 
       
    48     if( IsFocused() )
       
    49         {
       
    50         // draw highlight
       
    51         TAknLayoutRect highlightParentRect;
       
    52         highlightParentRect.LayoutRect( rect,
       
    53                                         AknLayout::Highlight_for_other_Active_Idle_items_Line_1( rect ) );
       
    54 
       
    55         TAknLayoutRect highlightRectCenter;
       
    56         highlightRectCenter.LayoutRect( highlightParentRect.Rect(),
       
    57                                         SkinLayout::List_highlight_skin_placing__general__Line_1( highlightParentRect.Rect() ) );
       
    58 
       
    59         TAknLayoutRect highlightRectTl;
       
    60         highlightRectTl.LayoutRect( highlightParentRect.Rect(),
       
    61                                     SkinLayout::List_highlight_skin_placing__general__Line_2() );
       
    62 
       
    63         TAknLayoutRect highlightRectBr;
       
    64         highlightRectBr.LayoutRect( highlightParentRect.Rect(),
       
    65                                     SkinLayout::List_highlight_skin_placing__general__Line_5() );
       
    66 
       
    67         TRect highlightRect( highlightRectTl.Rect().iTl, highlightRectBr.Rect().iBr );
       
    68 
       
    69         if( !AknsDrawUtils::DrawFrame( aknsInst,
       
    70                                        gc,
       
    71                                        highlightRect,
       
    72                                        highlightRectCenter.Rect(),
       
    73                                        KAknsIIDQsnFrList,
       
    74                                        KAknsIIDQsnFrListCenter ) )
       
    75             {
       
    76             // no skin - draw normal list pane highlight
       
    77             TAknLayoutRect highlighRect;
       
    78 
       
    79             // shadow
       
    80             highlighRect.LayoutRect( highlightParentRect.Rect(),
       
    81                                      AknLayout::List_pane_highlight_graphics__various__Line_1( highlightParentRect.Rect() ) );
       
    82             highlighRect.DrawRect( gc );
       
    83 
       
    84             // highlight
       
    85             highlighRect.LayoutRect( highlightParentRect.Rect(),
       
    86                                      AknLayout::List_pane_highlight_graphics__various__Line_2( highlightParentRect.Rect() ) );
       
    87             highlighRect.DrawRect( gc );
       
    88             }
       
    89         }
       
    90 
       
    91     TAknLayoutRect separatorRect;
       
    92     separatorRect.LayoutRect( rect, AknLayout::First_general_event_elements_Line_1() );
       
    93 
       
    94     TRgb lineColour( separatorRect.Color() );
       
    95 
       
    96     AknsUtils::GetCachedColor( aknsInst,
       
    97                                lineColour,
       
    98                                KAknsIIDQsnLineColors,
       
    99                                EAknsCIQsnLineColorsCG6 /* column separator lines */ );
       
   100 
       
   101     gc.SetPenColor( lineColour );
       
   102     gc.SetPenStyle( CWindowGc::ESolidPen );
       
   103 
       
   104     TInt separatorWidth( separatorRect.Rect().Width() -1 );
       
   105     TPoint dot( separatorRect.Rect().iTl );
       
   106 
       
   107     for( ; dot.iX < separatorWidth; dot.iX+=2 )
       
   108         {
       
   109         // draw the dots
       
   110         gc.Plot( dot );
       
   111         }
       
   112     }