symhelp/helpmodel/inc/hlppict.h
changeset 0 1f04cf54edd8
equal deleted inserted replaced
-1:000000000000 0:1f04cf54edd8
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __HLPPICT_H__
       
    17 #define __HLPPICT_H__
       
    18 
       
    19 // System includes
       
    20 #include <e32std.h>
       
    21 #include <d32dbms.h>
       
    22 #include <s32file.h>
       
    23 #include <badesca.h>
       
    24 #include <gdi.h> // for CPicture
       
    25 
       
    26 // User includes
       
    27 #include "HLPMODEL.H"
       
    28 
       
    29 // Classes Referenced
       
    30 class CHlpDatabase;
       
    31 
       
    32 // Constants
       
    33 const TUid KUidHelpImage = { 0x100068D4 };
       
    34 
       
    35 
       
    36 
       
    37 //
       
    38 // ----> CHlpPicture (header)
       
    39 //
       
    40 class CHlpPicture : public CPicture
       
    41 	/**
       
    42 	This class provides the means for restoring bitmaps from a multiple
       
    43 	bitmap file, scaling them and drawing them on the screen.
       
    44 	@publishedAll
       
    45 	@class CHlpPicture
       
    46 	@since 7.0
       
    47 	@see CPicture, CStreamStore, TStreamId, CHlpModel,
       
    48 				  CGraphicsContext, RWriteStream, CHlpDatabase
       
    49 	*/
       
    50 	{
       
    51 //
       
    52 public: // CONSTRUCT / DESTRUCT
       
    53 //
       
    54 	static CHlpPicture* NewLC(const CStreamStore& aStore, TStreamId aStreamId, CHlpDatabase& aDatabase, CHlpModel& aHlpModel);
       
    55 	~CHlpPicture();
       
    56 	void HandleHelpModelDestruction();
       
    57 
       
    58 //
       
    59 public: // FROM CPicture
       
    60 //
       
    61 	void Draw(CGraphicsContext& aGc, const TPoint& aTopLeft, const TRect& aClipRect, MGraphicsDeviceMap* aMap) const;
       
    62 	void ExternalizeL(RWriteStream& aStream) const;
       
    63 	void GetCropInTwips(TMargins& aMargins) const;
       
    64 	void GetOriginalSizeInTwips(TSize& aSize) const;
       
    65 	void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight);
       
    66 	void SetCropInTwips(const TMargins& aMargins);
       
    67 	TInt ScaleFactorWidth() const;
       
    68 	TInt ScaleFactorHeight() const;
       
    69 
       
    70 //
       
    71 public: // Handles changes in zoom size
       
    72 //
       
    73 	void HandleZoomChangedL(THlpZoomState aNewZoom);
       
    74 
       
    75 //
       
    76 private: // INTERNAL CONSTRUCT
       
    77 //
       
    78 	CHlpPicture(CHlpDatabase& aDatabase, CHlpModel& aHlpModel);
       
    79 	void ConstructL(const CStreamStore& aStore, TStreamId aStreamId);
       
    80 
       
    81 //
       
    82 private: // INTERNAL METHODS
       
    83 //
       
    84 	void RestoreL(const CStreamStore& aStore, TStreamId aStreamId, CHlpDatabase& aDatabase, THlpZoomState aZoomState);
       
    85 
       
    86 //
       
    87 private: // MEMBER DATA
       
    88 //
       
    89 
       
    90 	// Variable to represent the bitmap to be restored from the image table
       
    91 	CFbsBitmap* iImage;
       
    92 
       
    93 	// Reference to a 'CHlpDatabase' object
       
    94 	CHlpDatabase& iDatabase;
       
    95 
       
    96 	// Stores the ID of every image that is accessed
       
    97 	TInt iImageId;
       
    98 
       
    99 	// Pointer to a 'hlpmodel' object
       
   100 	CHlpModel* iHlpModel;
       
   101 
       
   102 	// Stores the number of bitmaps per picture
       
   103 	TInt iImageCountForPicture;
       
   104 	};
       
   105 
       
   106 
       
   107 
       
   108 #endif