|
1 /* |
|
2 * Copyright (c) 2007-2008 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: cimcvappviewcontrol.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _CIMCVAPPVIEWCONTROL_H |
|
21 #define _CIMCVAPPVIEWCONTROL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "cimcvapprichtextcontainercache.h" |
|
25 #include "cimcvapptextviewcontrol.h" |
|
26 #include "cimcvapprichtextcontainer.h" |
|
27 #include "cimcvengine.h" |
|
28 // FORWARD DECLARATIONS |
|
29 class CIMCVAppMessageFlowHandler; |
|
30 class MIMCVEngineMessageReadInterface; |
|
31 class CIMCVAppMessageExtensionsHandler; |
|
32 class MIMCVTapEventObserver; |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * @imcvuiapp.exe |
|
37 * @since 5.0 |
|
38 */ |
|
39 class CIMCVAppViewControl : public CIMCVAppTextViewControl |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aRect Draw area |
|
46 * @param aParent Parent control |
|
47 * @param aReadInterface Message read interface |
|
48 * @param aExtensionsHandler Message extensions handler |
|
49 * @param aMessageUtils Message utils |
|
50 * @param aRTContainerCache - cache |
|
51 * @param aScrollOver Should we scroll over the top and bottom, |
|
52 * i.e. disabling highlight when pressing up at top. |
|
53 * EFalse used with recorded chats. |
|
54 * @return Instance of this class |
|
55 */ |
|
56 static CIMCVAppViewControl* NewL( const TRect& aRect, |
|
57 const CCoeControl& aParent, |
|
58 MIMCVEngineMessageReadInterface& aReadInterface, |
|
59 CIMCVAppMessageExtensionsHandler& aExtensionsHandler, |
|
60 CGulIcon* aFromMe, |
|
61 CGulIcon* aToMe, |
|
62 CIMCVAppRichTextContainerCache& aRTContainerCache, |
|
63 CIMCVEngine& aActiveEngine, |
|
64 TBool aScrollOver = ETrue); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 virtual ~CIMCVAppViewControl(); |
|
70 |
|
71 public: // New functions |
|
72 |
|
73 |
|
74 /** |
|
75 * Returns buffer containing the currently selected text |
|
76 * (or empty buffer if nothing selected) |
|
77 */ |
|
78 HBufC* SelectedItemL(); |
|
79 |
|
80 /** |
|
81 * @return Type of selected item |
|
82 */ |
|
83 TInt SelectedItemType(); |
|
84 |
|
85 |
|
86 /** |
|
87 * Disable all highlighting |
|
88 */ |
|
89 void DisableHighlightL(); |
|
90 |
|
91 /** |
|
92 * @return ETrue if some item is highlighted |
|
93 */ |
|
94 TBool Highlighted(); |
|
95 |
|
96 /** |
|
97 * Move text's highlight up and down. |
|
98 * @param aMovement In which direction we move the higlight |
|
99 */ |
|
100 void MoveHighlightL( |
|
101 CIMCVAppRichTextContainer::THighlightMovement aMovement); |
|
102 |
|
103 |
|
104 /** |
|
105 * @returns the total messages in the view |
|
106 */ |
|
107 TInt GetMessageCount(); |
|
108 |
|
109 /** |
|
110 * Set scrolling method |
|
111 * @param aHihghlight If ETrue, scroll by highlighting items |
|
112 * otherwise scroll by rows |
|
113 */ |
|
114 void SetHighlight( TBool aHighlight ); |
|
115 |
|
116 /** |
|
117 * Set observer for handling tap events. |
|
118 * Supports only single observer. |
|
119 * @param aObserver observer to handle tap events |
|
120 * @param aId control id which is used by the observer to |
|
121 * identify this object. |
|
122 */ |
|
123 void SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ); |
|
124 |
|
125 |
|
126 /** |
|
127 * Should we fetch new messages or not |
|
128 * @param aFetch ETrue if this chat is in foreground and should receive |
|
129 * messages, EFalse otherwise. |
|
130 */ |
|
131 void FetchMessages( TBool aFetch ); |
|
132 |
|
133 |
|
134 protected: // Functions from CIMCVAppTextViewControl |
|
135 |
|
136 /** |
|
137 * @see CIMCVAppTextViewControl |
|
138 */ |
|
139 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
140 TEventCode aType ); |
|
141 |
|
142 /** |
|
143 * @see CIMCVAppTextViewControl |
|
144 */ |
|
145 void ProcessStylusEventL( const TPointerEvent& aPointerEvent ); |
|
146 |
|
147 /** |
|
148 * @see CIMCVAppTextViewControl |
|
149 */ |
|
150 void SizeChanged(); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * C++ default constructor. |
|
156 */ |
|
157 CIMCVAppViewControl(); |
|
158 |
|
159 /** |
|
160 * By default Symbian 2nd phase constructor is private. |
|
161 * @param aRect Draw area |
|
162 * @param aParent Parent control |
|
163 * @param aReadInterface Message read interface |
|
164 * @param aExtensionsHandler Message extensions handler |
|
165 * @param aMessageUtils Message utils |
|
166 * @param aRTContainerCache - cache |
|
167 * @param aScrollOver Should we scroll over the top and bottom, |
|
168 * i.e. disabling highlight when pressing up at top. |
|
169 */ |
|
170 void ConstructL( const TRect& aRect, const CCoeControl& aParent, |
|
171 MIMCVEngineMessageReadInterface& aReadInterface, |
|
172 CIMCVAppMessageExtensionsHandler& aExtensionsHandler, |
|
173 CGulIcon* aFromMe, |
|
174 CGulIcon* aToMe, |
|
175 CIMCVAppRichTextContainerCache& aRTContainerCache, |
|
176 CIMCVEngine& aActiveEngine, |
|
177 TBool aScrollOver ); |
|
178 |
|
179 |
|
180 private: // Data |
|
181 |
|
182 // owns. Text container |
|
183 CIMCVAppRichTextContainer* iTextContainer; |
|
184 |
|
185 // owns. Message flow handler |
|
186 CIMCVAppMessageFlowHandler* iFlowHandler; |
|
187 |
|
188 // Not owned. Pointer to observer |
|
189 MIMCVTapEventObserver* iTapObserver; |
|
190 |
|
191 // ID which needs to be reported back to TapObserver |
|
192 TUint iTapControlId; |
|
193 |
|
194 // Tap waiting flags touch screen. |
|
195 TBool iWaitForDoubleTap; |
|
196 TBool iWaitForSingleTap; |
|
197 }; |
|
198 |
|
199 #endif // _CIMCVAPPVIEWCONTROL_H |
|
200 |
|
201 // End of File |