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