|
1 /* |
|
2 * Copyright (c) 2002 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: The OutputSheet sub-pane class, CCalcOutputSheet |
|
15 * Derived from CCoeControl |
|
16 * The CCalcOutputSheet displays histroy data. |
|
17 * History data is scroll up and down. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef CALCOUTSHEET_H |
|
23 #define CALCOUTSHEET_H |
|
24 |
|
25 |
|
26 // INCLUDES |
|
27 #include <coecntrl.h> |
|
28 #include <AknUtils.h> |
|
29 #include <e32std.h> |
|
30 |
|
31 #include <eikscrlb.h> |
|
32 #include <eiksbobs.h> |
|
33 |
|
34 #include <eiksbfrm.h> |
|
35 |
|
36 |
|
37 // CONSTANTS |
|
38 const TInt KCountOfPaperBitmaps(9); |
|
39 // FORWARD DECLARATIONS |
|
40 class CCalcHistory; |
|
41 class CCalcContainer; |
|
42 class CCalcAppEnv; |
|
43 |
|
44 // CLASS DEFINITIONS |
|
45 |
|
46 /** |
|
47 CCalcOutputSheet : 'OutputSheet Sub-Pane' class |
|
48 */ |
|
49 //New scrollbar used for Touch UI layout |
|
50 class CEikScrollBarFrame; |
|
51 class CCalcOutputSheet |
|
52 : public CCoeControl , public MEikScrollBarObserver |
|
53 {/*Class also derived from scrollbarobserver to capture scrollbar events*/ |
|
54 public: // Constructors and destructor |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 * @param aContainer : Pointer of CCalcContainer class |
|
58 */ |
|
59 static CCalcOutputSheet* NewL(CCalcContainer* aContainer); |
|
60 |
|
61 /** |
|
62 * Destructor. |
|
63 */ |
|
64 virtual ~CCalcOutputSheet(); |
|
65 |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 |
|
70 /** |
|
71 * Scroll to bottom line. |
|
72 */ |
|
73 void ScrollToBottomL(); |
|
74 |
|
75 /** |
|
76 * Called after clearing calculation history. |
|
77 */ |
|
78 void NotifyClearHistoryL(); |
|
79 |
|
80 /** |
|
81 * It returns whether it can scroll up or not. |
|
82 * @return ETrue : Scroll up can be done. |
|
83 * EFalse: Scroll up cannot be done. |
|
84 */ |
|
85 TBool CanUp() const; |
|
86 |
|
87 /** |
|
88 * It returns whether it can scroll down or not. |
|
89 * @return ETrue : Scroll up can be done. |
|
90 * EFalse: Scroll up cannot be done. |
|
91 */ |
|
92 TBool CanDown() const; |
|
93 |
|
94 /** |
|
95 * Output Sheet is scrolled up. |
|
96 */ |
|
97 void ScrollUp(); |
|
98 |
|
99 /** |
|
100 * Output Sheet is scrolled down. |
|
101 */ |
|
102 void ScrollDown(); |
|
103 |
|
104 /** |
|
105 * Refresh PaperBitmap Icon when the skin change event has occured. |
|
106 */ |
|
107 inline void RefreshPaperBitmap() ; |
|
108 /** |
|
109 * Refresh ScalablePaperBitmap Icon when the skin change event has occured. |
|
110 */ |
|
111 inline void RefreshScalablePaperBitmap() ; |
|
112 |
|
113 |
|
114 inline void RefreshResultsLineBitmap() ; |
|
115 |
|
116 /** |
|
117 * From MEikScrollBarObserver: to Handle scrollbar events |
|
118 * @param CEikScrollBar* : Pointer to the scrollbar |
|
119 * @param TEikScrollEvent : Event on the Scrollbar |
|
120 */ |
|
121 void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType); |
|
122 |
|
123 |
|
124 /** |
|
125 * From CCoeControl : Notifier for changing language |
|
126 * @param aType : Type of resource change |
|
127 */ |
|
128 void HandleResourceChange(TInt aType); |
|
129 void HandleResourceChangeOutSheetL(TInt aType); |
|
130 |
|
131 |
|
132 private: // New functions |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 CCalcOutputSheet(); |
|
137 |
|
138 /** |
|
139 * Second-phase constructor. |
|
140 */ |
|
141 void ConstructL(CCalcContainer* aContainer); |
|
142 |
|
143 |
|
144 private: |
|
145 |
|
146 |
|
147 /** |
|
148 * From CCoeControl : Set control size |
|
149 */ |
|
150 void SizeChanged(); |
|
151 |
|
152 void SizeChangedOutSheetL(); |
|
153 |
|
154 /** |
|
155 * From CCoeControl : Draw Output Sheet |
|
156 * @param aRect : rectangle of Output Sheet |
|
157 */ |
|
158 void Draw(const TRect& aRect) const; |
|
159 |
|
160 /** |
|
161 * Function used to dynamically update scrollbar indicators. |
|
162 */ |
|
163 void UpdateScrollIndicatorL(); |
|
164 |
|
165 |
|
166 private: // Data |
|
167 TInt iScrollOffset; // Scroll position |
|
168 const CGulIcon* iCalcPaper; // Not own |
|
169 const CGulIcon* iCalcScalablePaper[KCountOfPaperBitmaps]; |
|
170 const CGulIcon* iCalcResultsLine; |
|
171 CCalcHistory* iCalcHistory; // Not own |
|
172 CCalcContainer* iCalcContainer; // Not own |
|
173 CCalcAppEnv* iCalcAppEnv; // Not own |
|
174 TAknLayoutRect iCalcPaperLayout[KCountOfPaperBitmaps]; |
|
175 TInt iCalcOutputSheetLines; |
|
176 CAknsBasicBackgroundControlContext* iOpSheetContext; |
|
177 CArrayFixFlat<TAknLayoutText>* iOperatorLayout; |
|
178 CArrayFixFlat<TAknLayoutText>* iOperandLayout; |
|
179 CArrayFixFlat<TAknLayoutRect>* iResultsLineLayout; |
|
180 CArrayFixFlat<TAknLayoutRect>* iEqualLineLayout; |
|
181 CRepository* iCRKey; |
|
182 TInt iLanguage; |
|
183 TInt iUiLanguage; |
|
184 CEikScrollBarFrame *iSBFrame; //own -> pointer used for scrollbar frame |
|
185 TAknLayoutRect iPaperPaneRect; |
|
186 TInt iPrevThumbPosition; |
|
187 |
|
188 |
|
189 }; |
|
190 |
|
191 #include "CalcOutSheet.inl" |
|
192 |
|
193 #endif // CALCOUTSHEET_H |
|
194 |
|
195 // End of File |