phone_plat/telephony_bubble_extension_api/inc/telbubblecallimage.h
branchGCC_SURGE
changeset 51 f39ed5e045e0
parent 40 bab96b7ed1a4
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
40:bab96b7ed1a4 51:f39ed5e045e0
     1 /*
       
     2 * Copyright (c) 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:  Extension control for displaying call image.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TELBUBBLECALLIMAGE_H
       
    20 #define TELBUBBLECALLIMAGE_H
       
    21 
       
    22 #include <coecntrl.h>
       
    23 
       
    24 class CFbsBitmap;
       
    25 
       
    26 /**
       
    27  *  Extension control for displaying call image.
       
    28  *
       
    29  *
       
    30  *  @lib BMCustomization.lib
       
    31  *  @since S60 v5.0
       
    32  */
       
    33 class CTelBubbleCallImage : public CCoeControl
       
    34     {
       
    35 public:
       
    36     /** Two phase constructor */
       
    37     IMPORT_C static CTelBubbleCallImage* NewL();
       
    38 
       
    39     /** destructor */
       
    40     IMPORT_C virtual ~CTelBubbleCallImage();
       
    41 
       
    42 public:
       
    43     /**
       
    44      * Set call image. The bitmaps are set by Phone application,
       
    45      * when it has created bitmaps from the call image.
       
    46      * @param aImage Call image bitmap.
       
    47      * @param aImageOwnership ETrue, if ownership is transferred.
       
    48      * @param aMask  Mask bitmap when exists.
       
    49      * @param aMaskOwnership  ETrue, if ownership is transferred.  
       
    50      */
       
    51     IMPORT_C void SetImage( CFbsBitmap* aImage, 
       
    52                             TBool aImageOwnership = EFalse,
       
    53                             CFbsBitmap* aMask = NULL,
       
    54                             TBool aMaskOwnership = EFalse );
       
    55     
       
    56     /**
       
    57      * Set image placing area. This is set by Phone application.
       
    58      * @param aRect 
       
    59      */
       
    60     IMPORT_C void SetImagePlacingArea( TRect& aRect );
       
    61     
       
    62 protected:    
       
    63     /**
       
    64      * Called when image is changed.
       
    65      */
       
    66     IMPORT_C virtual void ImageChanged();
       
    67 
       
    68     /**
       
    69      * Returns pointer to image bitmap.
       
    70      */
       
    71     IMPORT_C const CFbsBitmap* Image() const;
       
    72 
       
    73     /**
       
    74      * Returns pointer to mask bitmap.
       
    75      */
       
    76     IMPORT_C const CFbsBitmap* Mask() const;
       
    77     
       
    78     /**
       
    79      * Returns ETrue if image covers this control entirely.
       
    80      */
       
    81     IMPORT_C TBool IsFullScreenImage() const;
       
    82     
       
    83     /**
       
    84      * Returns offset centering image to this control.
       
    85      * For non fullscreen images this offset is relative
       
    86      * to image placing area.
       
    87      */
       
    88     IMPORT_C const TPoint& Offset() const;
       
    89     
       
    90     /**
       
    91      * Returns source rect centering image to this control.
       
    92      * For non-fullscreen images this offset is relative
       
    93      * to image placing area.
       
    94      */
       
    95     IMPORT_C const TRect& SourceRect() const;
       
    96     
       
    97     /**
       
    98      * Returns image placing area. Can be used to position
       
    99      * non-fullscreen sized images. 
       
   100      * @return Image placing area.
       
   101      */
       
   102     IMPORT_C const TRect& ImagePlacingArea() const;
       
   103     
       
   104 protected: // from CCoeControl
       
   105     IMPORT_C virtual void Draw( const TRect& /*aRect*/ ) const;
       
   106     IMPORT_C virtual void SizeChanged();
       
   107 
       
   108 protected:
       
   109     IMPORT_C virtual void ConstructL();
       
   110     IMPORT_C CTelBubbleCallImage();
       
   111     
       
   112 private:
       
   113     TRect iSourceRect;
       
   114     TPoint iOffset;
       
   115     TRect iImagePlacingArea;
       
   116     CFbsBitmap *iImage;
       
   117     CFbsBitmap *iMask;
       
   118     TBool iImageOwnership;
       
   119     TBool iMaskOwnership;
       
   120     };
       
   121 
       
   122 #endif // TELBUBBLECALLIMAGE_H
       
   123 
       
   124 // end of file