|
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: Interface for text viewer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MIMCVAPPTEXTVIEW_H |
|
21 #define MIMCVAPPTEXTVIEW_H |
|
22 |
|
23 // CLASS DECLARATION |
|
24 class TPointerEvent; |
|
25 |
|
26 /** |
|
27 * Interface for text viewer |
|
28 * |
|
29 * imcvuiapp.exe |
|
30 * @since Series 60 5.0 |
|
31 */ |
|
32 class MIMCVAppTextView |
|
33 { |
|
34 public: // Enumerations |
|
35 |
|
36 enum TPenBehaviour |
|
37 { |
|
38 EPenForwardToChild = 0, |
|
39 EPenForwardToParent, |
|
40 EPenProcessEvent, |
|
41 EPenIgnoreEvent |
|
42 }; |
|
43 |
|
44 public: // New functions |
|
45 |
|
46 /** |
|
47 * Update the view |
|
48 */ |
|
49 virtual void UpdateChatViewL() = 0; |
|
50 |
|
51 |
|
52 /** |
|
53 * Handles changed format. |
|
54 * @param aChanged Changed section of rich text |
|
55 * @param aPreserveFocus ETrue : Keeps focus of text control in place |
|
56 * EFalse : Focus moves with changes |
|
57 */ |
|
58 virtual void HandleFormatChangedL( TCursorSelection& aChanged, |
|
59 TBool aPreserveFocus = EFalse ) = 0; |
|
60 |
|
61 /** |
|
62 * Handles insertion and deletion |
|
63 * @param aChanged Changed section of rich text. If this function is |
|
64 * being used to handle deletion only, this argument |
|
65 * should be of length zero and its start position |
|
66 * should be the beginning of the deletion. |
|
67 * @param aDeletedChars The number of deleted characters. Specify zero |
|
68 * if this function is being used to handle insertion |
|
69 * only. |
|
70 */ |
|
71 virtual void HandleInsertDeleteL( TCursorSelection& aChanged, |
|
72 TInt aDeletedChars ) = 0; |
|
73 |
|
74 /** |
|
75 * Handles addition of text |
|
76 * @param aFirst Should be set to ETrue if |
|
77 * this is the first addition of text |
|
78 * @param aSelection Selection |
|
79 * @param aTop If selection doesn't fit to screen, should the top of the |
|
80 * selection be visible. I.e. If ETrue, top of the message is shown. |
|
81 * if EFalse, bottom of the message is shown. |
|
82 */ |
|
83 virtual void HandleAdditionL( TBool aFirst, TCursorSelection& aSelection, |
|
84 TBool aTop ) = 0; |
|
85 |
|
86 /** |
|
87 * Scrolls selection to screen and updates scroll bars |
|
88 * @param aSelection Selection |
|
89 * @param aTop If selection doesn't fit to screen, should the top of the |
|
90 * selection be visible. I.e. If ETrue, top of the message is shown. |
|
91 * if EFalse, bottom of the message is shown. |
|
92 */ |
|
93 virtual void ScrollVisibleL( TCursorSelection& aSelection, TBool aTop ) = 0; |
|
94 |
|
95 /** |
|
96 * @return Current scroll selection (i.e. the visible part) |
|
97 */ |
|
98 virtual TCursorSelection ScrollSelection() = 0; |
|
99 |
|
100 /** |
|
101 * Scrolls view up or down |
|
102 * @param aAmount Amount of lines to be scrolled |
|
103 * Use negative values for scrolling up |
|
104 */ |
|
105 virtual void ScrollLinesL( TInt aAmount ) = 0; |
|
106 |
|
107 /** |
|
108 * @return ETrue if aPos is visible on screen, EFalse otherwise. |
|
109 */ |
|
110 virtual TBool IsVisible( TInt aPos ) = 0; |
|
111 |
|
112 /** |
|
113 * @return ETrue if the paragraph in aPos fits to screen |
|
114 */ |
|
115 virtual TBool ParagraphFits( TInt aPos ) = 0; |
|
116 |
|
117 /** |
|
118 * Redraws the view |
|
119 */ |
|
120 virtual void Redraw() = 0; |
|
121 |
|
122 /** |
|
123 * Sets the behaviour of this control to pointer events. |
|
124 * see TPenBehaviour for more detailed info. |
|
125 * @param aPen How this control should react to pointer events |
|
126 */ |
|
127 virtual void SetPenBehaviour( TPenBehaviour aPen ) = 0; |
|
128 |
|
129 /** |
|
130 * Return current pen behaviour state. Determines how this control |
|
131 * reacts to pointer events. |
|
132 * @return Current pen behaviour |
|
133 */ |
|
134 virtual TPenBehaviour PenBehaviour() = 0; |
|
135 |
|
136 /** |
|
137 * Reformats the view after a global change has been made to the layout, |
|
138 * but without causing a redraw. |
|
139 * @since S60 v3.2 |
|
140 * @param aYPosQualifier Specifies whether the visible area is to be |
|
141 * filled and whether the top line should be made |
|
142 * fully visible if possible. |
|
143 */ |
|
144 virtual void HandleGlobalChangeNoRedrawL( |
|
145 TViewYPosQualifier aYPosQualifier = TViewYPosQualifier() ) = 0; |
|
146 |
|
147 protected: |
|
148 |
|
149 /** |
|
150 * This gets called when the pointer event is inside the text message. |
|
151 * @param aPointerEvent Pointer event |
|
152 */ |
|
153 virtual void ProcessStylusEventL( |
|
154 const TPointerEvent& aPointerEvent ) = 0; |
|
155 |
|
156 /** |
|
157 * Destructor. |
|
158 */ |
|
159 virtual ~MIMCVAppTextView() {}; |
|
160 |
|
161 }; |
|
162 |
|
163 #endif // MIMCVAPPTEXTVIEW_H |
|
164 |
|
165 // End of File |