|
1 // Copyright (c) 2005-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 // CImgDisplayAppView |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef TIMAGEDISPLAYAPPVIEW_H |
|
19 |
|
20 #define TIMAGEDISPLAYAPPVIEW_H |
|
21 |
|
22 #include <coecntrl.h> |
|
23 #include <coeccntx.h> |
|
24 |
|
25 class CImgDisplayAppView : public CCoeControl, public MCoeControlBrushContext |
|
26 { |
|
27 public: |
|
28 static CImgDisplayAppView* NewL(const TRect& aRect); |
|
29 ~CImgDisplayAppView(); |
|
30 void Reset(TDrawNow aDrawNow=EDrawNow); |
|
31 void DrawImage(const CFbsBitmap* aBitmap, const TPoint& aOffset, TDrawNow aDrawNow=EDrawNow); |
|
32 void DrawImage(const CFbsBitmap* aBitmap, const CFbsBitmap* aMask, const TPoint& aOffset, TDrawNow aDrawNow=EDrawNow); |
|
33 TBool ResizeL(const TSize& aNewSize, TBool aClear=ETrue, TDrawNow aDrawNow=EDrawNow); |
|
34 void Clear(TBool aClearFull=ETrue, TDrawNow aDrawNow=EDrawNow); |
|
35 void MoveBy(const TPoint& aRelMove, TDrawNow aDrawNow=EDrawNow); |
|
36 void Center(TDrawNow aDrawNow=EDrawNow); |
|
37 TBool SetBackgroundColor(const TRgb& aColor, TDrawNow aDrawNow=EDrawNow); |
|
38 void SetDisplayModeL(TDisplayMode aDisplayMode, TDrawNow aDrawNow=EDrawNow); |
|
39 TDisplayMode DisplayMode() const { return iDisplayMode; } |
|
40 protected: |
|
41 CImgDisplayAppView(); |
|
42 void ConstructL(const TRect& aRect); |
|
43 void ResizeBufferL(const TSize& aNewSize, TDisplayMode aDisplayMode); |
|
44 void EnsureSizeInTwipsSet(CFbsBitmap* aBitmap) const; |
|
45 // from CCoeControl |
|
46 void Draw(const TRect& aRect) const; |
|
47 protected: |
|
48 CFbsBitmap* iBmBuffer; |
|
49 CFbsDevice* iBmDevice; |
|
50 CFbsBitGc* iBmGc; |
|
51 TRect iBmRect; |
|
52 TRgb iBackgroundColor; |
|
53 TBool iBitmapValid; |
|
54 TDisplayMode iDisplayMode; |
|
55 }; |
|
56 |
|
57 #endif // ndef TIMAGEDISPLAYAPPVIEW_H |
|
58 |