satui/satapp/SATUISrc/CSatUiMessageQueryIcon.cpp
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 *     CPicture derived class. For DisplayText to show icon and text
       
    16 *     
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <fbs.h>
       
    23 
       
    24 #include "CSatUiMessageQueryIcon.h"
       
    25 #include    "tflogger.h"
       
    26 
       
    27 
       
    28 // ---------------------------------------------------------
       
    29 // CSatUiMessageQueryIcon::CSatUiMessageQueryIcon
       
    30 // Constructor
       
    31 // (other items were commented in a header).
       
    32 // ---------------------------------------------------------
       
    33 //
       
    34 CSatUiMessageQueryIcon::CSatUiMessageQueryIcon( TSize aSize, 
       
    35     CFbsBitmap& aBitmap ): 
       
    36     iSizeInTwips( aSize ), 
       
    37     iBitmap( &aBitmap )
       
    38     {
       
    39     }
       
    40     
       
    41 // Destructor
       
    42 CSatUiMessageQueryIcon::~CSatUiMessageQueryIcon()
       
    43     {
       
    44     delete iBitmap;
       
    45     iBitmap = NULL;
       
    46     }
       
    47 
       
    48 // ---------------------------------------------------------
       
    49 // CSatUiMessageQueryIcon::Draw
       
    50 // Draw the picture.
       
    51 // (other items were commented in a header).
       
    52 // ---------------------------------------------------------
       
    53 //
       
    54 void CSatUiMessageQueryIcon::Draw( CGraphicsContext& aGc,
       
    55     const TPoint& aTopLeft, const TRect& aClipRect, 
       
    56     MGraphicsDeviceMap* aMap ) const
       
    57 	{
       
    58     TFLOGSTRING( "CSatUiMessageQueryIcon::Draw called" )
       
    59 	TRect bitmapRect=aMap->TwipsToPixels( TRect(TPoint(), iSizeInTwips ) );
       
    60 	bitmapRect.Move( aTopLeft );
       
    61 	aGc.Reset();
       
    62 	aGc.SetClippingRect( aClipRect );
       
    63 	aGc.DrawBitmap( bitmapRect, iBitmap );    
       
    64 	TFLOGSTRING( "CSatUiMessageQueryIcon::Draw exit" )    
       
    65 	}
       
    66 
       
    67 // ---------------------------------------------------------
       
    68 // CSatUiMessageQueryIcon::ExternalizeL
       
    69 // From CPicture
       
    70 // (other items were commented in a header).
       
    71 // ---------------------------------------------------------
       
    72 //
       
    73 void CSatUiMessageQueryIcon::ExternalizeL( RWriteStream& /*aStream*/ ) const
       
    74 	{
       
    75 	}
       
    76 
       
    77 // ---------------------------------------------------------
       
    78 // CSatUiMessageQueryIcon::GetOriginalSizeInTwips
       
    79 // Get the picture's size in twips..
       
    80 // (other items were commented in a header).
       
    81 // ---------------------------------------------------------
       
    82 //
       
    83 void CSatUiMessageQueryIcon::GetOriginalSizeInTwips( TSize& aSize ) const
       
    84 	{
       
    85 	TFLOGSTRING( "CSatUiMessageQueryIcon::GetOriginalSizeInTwips called" )
       
    86 	aSize = iSizeInTwips;
       
    87 	TFLOGSTRING( "CSatUiMessageQueryIcon::GetOriginalSizeInTwips exit" )
       
    88 	}
       
    89