|
1 // Copyright (c) 2006-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 // CWsWindowRedraw and associated classes definitions |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __BACKEDUPWINDOW_H__ |
|
19 #define __BACKEDUPWINDOW_H__ |
|
20 |
|
21 #include "wnredraw.h" |
|
22 #include "window.h" |
|
23 |
|
24 class CWsBackedUpWindow : public CWsWindowRedraw |
|
25 { |
|
26 public: |
|
27 static void StaticInitL(); |
|
28 static void StaticDestroy(); |
|
29 public: |
|
30 CWsBackedUpWindow(CWsWindow *aWin, TDisplayMode aDisplayMode); |
|
31 void ConstructL(); |
|
32 ~CWsBackedUpWindow(); |
|
33 TBool CommandL(TInt aOpcode, TWsWinCmdUnion &aCmd); |
|
34 void Resize(const TSize &aSize, const TSize &aOldSize); |
|
35 inline TDisplayMode DisplayMode() const; |
|
36 void PrepareForResizeL(const TSize &aSize, TSize &aOldSize); |
|
37 void DrawWindow(); |
|
38 virtual CFbsDevice* OutputDevice() const; |
|
39 virtual TBool DrawCommand(CWsGc*,const TAny*); |
|
40 |
|
41 private: |
|
42 void ActivateGc(); |
|
43 void SetSizeInTwips(); |
|
44 |
|
45 //from CWsWindowRedraw |
|
46 TRgb BackColor() const; |
|
47 TBool NeedsRedraw() const; |
|
48 TBool GetRedrawRect(TRect &aRect) const; |
|
49 CWsBackedUpWindow *Backup() const; |
|
50 void Scroll(const TRect &aClipRect, const TPoint &aOffset,const TRect &aRect); |
|
51 |
|
52 private: |
|
53 static CFbsBitGc *iBitGc; |
|
54 TBool iGcActive; |
|
55 CFbsBitmapDevice *iBitmapDevice; |
|
56 CFbsBitmap *iBitmap; |
|
57 TDisplayMode iDisplayMode; |
|
58 }; |
|
59 |
|
60 inline TDisplayMode CWsBackedUpWindow::DisplayMode() const |
|
61 { |
|
62 return iDisplayMode; |
|
63 } |
|
64 |
|
65 #endif |