|
1 // GuiConsAppView.h |
|
2 // |
|
3 // Copyright (c) 2009 - 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 |
|
13 #ifndef __GUICONSAPPVIEW_H__ |
|
14 #define __GUICONSAPPVIEW_H__ |
|
15 |
|
16 #include <coecntrl.h> |
|
17 class CEikEdwin; |
|
18 class CEikLabel; |
|
19 class CImageDecoder; |
|
20 class CImageDecodeAo; |
|
21 |
|
22 enum TGuiConsViewPanic |
|
23 { |
|
24 EGuiConsControlAlreadyExists = 0, |
|
25 EGuiConsBadControlIndex, |
|
26 }; |
|
27 |
|
28 class CGuiConsAppView : public CCoeControl |
|
29 { |
|
30 public: |
|
31 static CGuiConsAppView* NewL(const TRect& aRect); |
|
32 static CGuiConsAppView* NewLC(const TRect& aRect); |
|
33 virtual ~CGuiConsAppView(); |
|
34 |
|
35 void SetLargeControlL(CCoeControl* aControl); |
|
36 void ClearLargeControl(); |
|
37 void ShowLabelL(const TDesC& aText); |
|
38 void ShowEditor(); |
|
39 void FocusEditor(TBool aFocus); |
|
40 void AddEditorToStackL(CCoeAppUi* aAppUi); |
|
41 void RemoveEditorFromStack(CCoeAppUi* aAppUi); |
|
42 HBufC* GetEditorTextL(); |
|
43 void SetEditorTextL(const TDesC* aText); |
|
44 |
|
45 void Draw(const TRect& aRect) const; |
|
46 virtual void SizeChanged(); |
|
47 TInt CountComponentControls() const; |
|
48 CCoeControl* ComponentControl(TInt aIndex) const; |
|
49 |
|
50 void Layout(); |
|
51 |
|
52 void BgImageReady(); |
|
53 private: |
|
54 void ConstructL(const TRect& aRect); |
|
55 CGuiConsAppView(); |
|
56 |
|
57 private: |
|
58 CCoeControl* iLargeControl; |
|
59 CEikEdwin* iEditor; |
|
60 CEikLabel* iLabel; |
|
61 CImageDecodeAo* iBgImage; |
|
62 }; |
|
63 |
|
64 class CImageDecodeAo : public CActive |
|
65 { |
|
66 public: |
|
67 static CImageDecodeAo* NewL(CGuiConsAppView& aOwner, const TDesC& aFileName); |
|
68 ~CImageDecodeAo(); |
|
69 CFbsBitmap* Bitmap(); |
|
70 void Bitblt(CWindowGc& aGc, TPoint aPosition); |
|
71 |
|
72 private: |
|
73 CImageDecodeAo(CGuiConsAppView& aOwner); |
|
74 void ConstructL(const TDesC& aFileName); |
|
75 virtual void RunL(); |
|
76 virtual void DoCancel(); |
|
77 private: |
|
78 CGuiConsAppView& iOwner; |
|
79 RFs iFs; |
|
80 CImageDecoder* iDecoder; |
|
81 TBool iBitmapReady; |
|
82 CFbsBitmap* iBitmap; |
|
83 CFbsBitmap* iMask; |
|
84 }; |
|
85 |
|
86 |
|
87 |
|
88 #endif // __GUICONSAPPVIEW_H__ |