|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LAUNCHERCONTAINEROUTPUT_H |
|
20 #define LAUNCHERCONTAINEROUTPUT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <eiksbobs.h> |
|
25 |
|
26 class CEikRichTextEditor; |
|
27 class CEikScrollBarFrame; |
|
28 class CLauncherEngine; |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CLauncherContainerOutput container control class. |
|
38 * |
|
39 */ |
|
40 class CLauncherContainerOutput : public CCoeControl, MCoeControlObserver, MEikScrollBarObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * EPOC default constructor. |
|
46 * @param aRect Frame rectangle for container. |
|
47 */ |
|
48 void ConstructL(const TRect& aRect, CLauncherEngine* aEngine); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CLauncherContainerOutput(); |
|
54 |
|
55 public: // New functions |
|
56 |
|
57 void PrintTextL(const TDesC& aDes); |
|
58 void ClearOutputWindowL(); |
|
59 |
|
60 |
|
61 public: // Functions from base classes |
|
62 |
|
63 private: // Functions from base classes |
|
64 |
|
65 void Draw(const TRect& aRect) const; |
|
66 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
67 void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); // From MEikScrollBarObserver |
|
68 |
|
69 public: |
|
70 void HandleResourceChange(TInt aType); |
|
71 |
|
72 private: |
|
73 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/); |
|
74 |
|
75 private: |
|
76 /** |
|
77 * Updates the containers content in screen. |
|
78 * @param aScrollToBottom If true, screen is scrolled to bottom. |
|
79 * @param aScrollToTop If true, screen is scrolled to top. Ignored if |
|
80 * aScrollToBottom is set true. |
|
81 */ |
|
82 void UpdateVisualContentL(TBool aScrollToBottom, TBool aScrollToTop = EFalse); |
|
83 |
|
84 private: //data |
|
85 CEikScrollBarFrame* iScrollBarFrame; |
|
86 HBufC* iText; |
|
87 const CFont* iFont; |
|
88 HBufC* iWrapperString; |
|
89 CArrayFix<TPtrC>* iWrappedArray; |
|
90 TInt iCurrentLine; |
|
91 TInt iLineCount; |
|
92 TInt iNumberOfLinesFitsScreen; |
|
93 TInt iLeftDrawingPosition; |
|
94 TReal iX_factor; |
|
95 TReal iY_factor; |
|
96 |
|
97 CLauncherEngine* iEngine; |
|
98 |
|
99 }; |
|
100 |
|
101 #endif |
|
102 |
|
103 // End of File |