imstutils/imconversationview/imcvuiapp/inc/cimcvapppicture.h
branchRCL_3
changeset 23 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
22:3104fc151679 23:9a48e301e94b
       
     1 /*
       
     2 * Copyright (c) 2007-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:  Private
       
    15 *  Description : Handles statuspane, context pane, navi pane
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CIMCVAPPPICTURE_H
       
    21 #define CIMCVAPPPICTURE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <gdi.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class TSize;
       
    28 class CGulIcon;
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Picture wrapper for icons and smileys
       
    35 *
       
    36 *  @since Series 60 Platform 3.0
       
    37 */
       
    38 class CIMCVAppPicture :public CPicture
       
    39     {
       
    40 
       
    41     public:  // Constructors and destructor
       
    42                
       
    43         /**
       
    44          * Constructor.
       
    45          * @param aMap Graphics device map for converting pixels to twips
       
    46 		 * @param aBitmap Bitmap
       
    47 		 * @param aBitmapMask Mask. Can be NULL
       
    48 		 * @param aIndex Index of the picture, used for the rich text icons.
       
    49          */
       
    50         CIMCVAppPicture( MGraphicsDeviceMap& aMap, CGulIcon* aIcon, TInt aIndex = -1,
       
    51             TBool aExternalIcon = ETrue );        
       
    52         /**
       
    53          * Destructor.
       
    54          */
       
    55         ~CIMCVAppPicture();
       
    56         
       
    57 	public: // From CPicture
       
    58 
       
    59 		/**
       
    60 		 * Prohibit linebreaks.
       
    61 		 */
       
    62 		TBool LineBreakPossible( TUint aClass,
       
    63 								 TBool aBeforePicture,
       
    64 								 TBool aHaveSpaces ) const;
       
    65 								 
       
    66 		/**
       
    67          * Draw the picture
       
    68          */
       
    69 		void Draw( CGraphicsContext& aGc,
       
    70 						   const TPoint& aTopLeft,
       
    71 						   const TRect& aClipRect,
       
    72 						   MGraphicsDeviceMap* aMap ) const;
       
    73 						   
       
    74 		/**
       
    75          * Does nothing. There's no need for it, but must be implemented.
       
    76          */
       
    77 		void ExternalizeL( RWriteStream& aStream ) const;
       
    78 		
       
    79         /**
       
    80          * Returns the picture's size in twips.
       
    81 		 * @param aSize Size.
       
    82          */
       
    83 		void GetOriginalSizeInTwips( TSize& aSize ) const;
       
    84 
       
    85 		/**
       
    86 		* Gets the index of the picture, if it is set in the constructor
       
    87 		* @return TInt The index of the picture, -1 if not set in the 
       
    88 		* 	           constructor.
       
    89 		*/
       
    90 		TInt Index() const;
       
    91 		
       
    92     private:
       
    93         
       
    94         /**
       
    95          * Sets the size of the picture in twips.
       
    96          * according to the size in pixels.
       
    97          */ 
       
    98          void SetTwips() const;
       
    99 		
       
   100 	protected:	// Data
       
   101 
       
   102 		// Index of a smiley icon
       
   103 		TInt iIndex;
       
   104 		
       
   105         // we might own		
       
   106 		CGulIcon* iIcon;
       
   107 		
       
   108 		TBool iExternalIcon;
       
   109 		
       
   110 		MGraphicsDeviceMap& iGfxMap;
       
   111     };
       
   112 
       
   113 #endif 		// CIMCVAPPPICTURE_H
       
   114             
       
   115 // End of File