phoneuis/BubbleManager/Src/BMBubbleImage.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2003-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CEikImage wrapper.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "BMBubbleImage.h"  //definition
       
    21 #include    <AknsUtils.h>
       
    22 #include    <AknIconUtils.h>
       
    23 
       
    24 // ========================= MEMBER FUNCTIONS ================================
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CBubbleImage::CBubbleImage
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CBubbleImage::CBubbleImage()
       
    31 : iIsBackgroundImage ( EFalse )
       
    32     {
       
    33     }
       
    34 
       
    35 // Destructor
       
    36 CBubbleImage::~CBubbleImage()
       
    37     {
       
    38     AknsUtils::DeregisterControlPosition( this );
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // CBubbleImage::SetAsBackgroundImage
       
    43 // Set the image as background image
       
    44 //  
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void CBubbleImage::SetAsBackgroundImage( TBool aIsBackground )
       
    48     {
       
    49     iIsBackgroundImage = aIsBackground;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // CBubbleImage::SizeChanged
       
    54 // called by framework when the view size is changed
       
    55 //  
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 void CBubbleImage::SizeChanged()
       
    59     { 
       
    60     AknsUtils::RegisterControlPosition( this );
       
    61 
       
    62     if ( this->Bitmap() )
       
    63         {
       
    64         if ( iIsBackgroundImage )
       
    65             {
       
    66             // For background call bubble graphic, 
       
    67             // aspect ratio can not be preserved.
       
    68             AknIconUtils::SetSize( 
       
    69                 const_cast<CFbsBitmap*> ( this->Bitmap() ), 
       
    70                 Rect().Size(), EAspectRatioNotPreserved );
       
    71             }
       
    72         else
       
    73             {
       
    74             AknIconUtils::SetSize( 
       
    75                 const_cast<CFbsBitmap*> ( this->Bitmap() ), 
       
    76                 Rect().Size() );
       
    77             }
       
    78         }
       
    79 
       
    80     CEikImage::SizeChanged();
       
    81     }
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // CBubbleImage::PositionChanged
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 void CBubbleImage::PositionChanged()
       
    88     {
       
    89     AknsUtils::RegisterControlPosition( this );
       
    90     CEikImage::PositionChanged();
       
    91     }
       
    92 
       
    93 // End of File