|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================ 00003 * Name : CMyPicture from MyPicture.h 00004 * Part of : RichTextEditor 00005 * Created : 05/08/2006 by Forum Nokia 00006 * Version : 2.0 00007 * 00008 * Copyright (c) 2006 - 2007 Nokia Corporation. 00009 * This material, including documentation and any related 00010 * computer programs, is protected by copyright controlled by 00011 * Nokia Corporation. 00012 * ============================================================================ 00013 */ 00014 00015 #ifndef CMYPICTURE_H 00016 #define CMYPICTURE_H 00017 00018 // INCLUDES 00019 #include <gdi.h> 00020 00021 // FORWARD DECLARATIONS 00022 class TSize; 00023 class CFbsBitmap; 00024 00025 // CLASS DECLARATION 00026 /** 00027 * CMyPicture the class which draw the image. 00028 */ 00029 class CMyPicture :public CPicture 00030 { 00031 public: // Constructors and NO destructor (bitmap not owned) 00032 00033 /** 00034 * C++ default constructor. 00035 * @param aSize Size of the picture in twips. 00036 * @param aBitmap Bitmap 00037 */ 00038 CMyPicture( TSize aSize, CFbsBitmap& aBitmap ); 00039 00040 public: // From CPicture 00041 00042 /** 00043 * Prohibit linebreaks. 00044 */ 00045 TBool LineBreakPossible( TUint aClass, 00046 TBool aBeforePicture, 00047 TBool aHaveSpaces ) const; 00048 /** 00049 * Draw the picture 00050 */ 00051 void Draw( CGraphicsContext& aGc, 00052 const TPoint& aTopLeft, 00053 const TRect& aClipRect, 00054 MGraphicsDeviceMap* aMap ) const; 00055 /** 00056 * There's no need for it in this , but must be implemented. 00057 */ 00058 void ExternalizeL( RWriteStream& aStream ) const; 00059 00060 /** 00061 * Sets the picture's size in twips. 00062 * @param aSize Size. 00063 */ 00064 void SetOriginalSizeInTwips( TSize aSize ); 00065 00066 /** 00067 * Returns the picture's size in twips. 00068 * @param aSize Size. 00069 */ 00070 void GetOriginalSizeInTwips( TSize& aSize ) const; 00071 00072 protected: // Data 00073 00074 TSize iSizeInTwips; // Size of the bitmap data 00075 CFbsBitmap* iBitmap; // reference to the Bitmap data 00076 }; 00077 00078 #endif 00079
|
© Nokia 2009 |