1 /* |
|
2 * Copyright (c) 2007 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: Contents of the exact word tooltip shown above inline editor |
|
15 * when the exact word differs from the inline word in Western |
|
16 * QWERTY predictive mode. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 #ifndef __AKN_FEP_EXACT_WORD_POPUP_CONTENT_H |
|
32 #define __AKN_FEP_EXACT_WORD_POPUP_CONTENT_H |
|
33 #include <coecntrl.h> |
|
34 #include "AknFepUiWordPopupContent.h" |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CAknPreviewPopUpController; |
|
38 |
|
39 |
|
40 // CLASS DECLARATION |
|
41 class CAknFepExactWordPopupContent : public CCoeControl, public MAknFepUiWordPopupContent |
|
42 { |
|
43 public: // construction and destruction |
|
44 |
|
45 /** |
|
46 * Two phased constructor |
|
47 */ |
|
48 static CAknFepExactWordPopupContent* NewL(); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 ~CAknFepExactWordPopupContent(); |
|
54 |
|
55 private: // construction |
|
56 |
|
57 /** |
|
58 * C++ constructor |
|
59 */ |
|
60 CAknFepExactWordPopupContent(); |
|
61 |
|
62 /** |
|
63 * Second phase constructor |
|
64 */ |
|
65 void ConstructL(); |
|
66 |
|
67 public: // new interface functions |
|
68 |
|
69 /** |
|
70 * Sets the text to be shown in the popup |
|
71 */ |
|
72 void SetTextL( const TDesC& aText ); |
|
73 |
|
74 /** |
|
75 * Sets the popup controller pointer. This must be called before drawing the popup contents. |
|
76 * @param aController Pointer to the popup for which this object provides the content. |
|
77 |
|
78 void SetPopupController( CAknPreviewPopUpController* aController ); |
|
79 */ |
|
80 |
|
81 /** |
|
82 * Sets the direction of the arrow included in the popup. This should be used as a hint |
|
83 * about the direction to tap to select the word shown in the popup. |
|
84 */ |
|
85 void SetArrowDirection( TArrowDirection aDirection ); |
|
86 |
|
87 public: // functions from base classes |
|
88 /** |
|
89 * Returns the minimuz size of this preview popup content. |
|
90 */ |
|
91 TSize MinimumSize(); |
|
92 |
|
93 public: //new interface functions |
|
94 /** |
|
95 * Sets the delay used before showing the preview popup. The default |
|
96 * delay is one second. |
|
97 * @param aDelay Delay in microseconds. |
|
98 */ |
|
99 void SetPopUpShowDelay( const TTimeIntervalMicroSeconds32& aDelay ); |
|
100 /** |
|
101 * Sets the preview popup visible after specified delay. If the popup |
|
102 * is already visible it is hidden immediately and shown again after the |
|
103 * showing delay. Popup is automatically hidden after its hiding delay |
|
104 * unless the delay is zero in which case the popup is shown infinitely. |
|
105 */ |
|
106 virtual void ShowPopUp(); |
|
107 |
|
108 /** |
|
109 * Hides the popup immediately. |
|
110 */ |
|
111 virtual void HidePopUp(); |
|
112 /** |
|
113 * Sets the position of preview popup. Popup's size is determined by the |
|
114 * size of its content. The popup is placed left and down from the given |
|
115 * point. If fixed mode is used then this function has no effect. |
|
116 * @param aPoint Popup's position. |
|
117 */ |
|
118 virtual void SetPosition( const TPoint& aPoint ); |
|
119 |
|
120 /** |
|
121 * Updates popup's size to reflect a change in content's size. |
|
122 * Should be called if the size of the content is changed dynamically. |
|
123 */ |
|
124 virtual void UpdateContentSize(); |
|
125 |
|
126 /** |
|
127 * Returns the popup's size. |
|
128 */ |
|
129 virtual TSize Size() const; |
|
130 |
|
131 /** |
|
132 * Returns true if the popup is visible. |
|
133 */ |
|
134 virtual TBool IsPopUpVisible(); |
|
135 virtual void HandlePointerEventL( const TPointerEvent& aPointerEvent ) ; |
|
136 |
|
137 private: // functions from base classes |
|
138 |
|
139 /** |
|
140 * Draws the contents of the popup |
|
141 * @aRect The area which should be redrawn. |
|
142 */ |
|
143 void Draw( const TRect& aRect ) const; |
|
144 |
|
145 /** |
|
146 * Draws the upwards or downwards pointing arrow, depending on the value |
|
147 * set by SetArrowDirection(). The upward arrow is placed in the bottom of the popup |
|
148 * while the downward arrow is drawn on the top part of the popup. |
|
149 * @aTextRect The area of the poup which is reserved for the text. |
|
150 */ |
|
151 void DrawArrowL( const TRect& aTextRect ) const; |
|
152 |
|
153 private: // data |
|
154 TBool iIsPopUpVisible; |
|
155 //! The text label to be shown in the popup |
|
156 CEikLabel* iLabel; |
|
157 |
|
158 //! The popup where this object provides the content. |
|
159 CAknPreviewPopUpController* iPopupController; // not owned |
|
160 |
|
161 //! Tells the direction of the arrow included in the popup |
|
162 MAknFepUiWordPopupContent::TArrowDirection iArrowDirection; |
|
163 }; |
|
164 |
|
165 #endif // AKN_FEP_EXACT_WORD_POPUP_CONTENT_H |
|