|
1 /* |
|
2 * Copyright (c) 2002-2004 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 * Provides the CAknFepUICtrlCandidateCharacter definition. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 #ifndef __AKN_FEP_CANDIDATE_CHARACTER_PANE_H__ |
|
31 #define __AKN_FEP_CANDIDATE_CHARACTER_PANE_H__ |
|
32 |
|
33 #include <e32std.h> |
|
34 #include <coecntrl.h> |
|
35 |
|
36 #include "AknFepUICtrlCandidatePane.h" |
|
37 |
|
38 class CEikLabel; |
|
39 class MAknFepUIEventObserver; |
|
40 |
|
41 /** |
|
42 * Control representing the selected candidate. Is a window owning control, |
|
43 * that appears over the candidate pane such that it obscures the labels |
|
44 * beneath. Can be hidden, for example if there is no visible selection, |
|
45 * or if highlighting is disabled. |
|
46 */ |
|
47 NONSHARABLE_CLASS(CAknFepUICtrlCandidateCharacter) : public CCoeControl |
|
48 { |
|
49 public: |
|
50 enum |
|
51 { |
|
52 EOneCandidate = 1, |
|
53 EMaxSelectedCandidateLength = 10 // extend buffer for phrase input |
|
54 }; |
|
55 public: |
|
56 |
|
57 /** |
|
58 * first phase construction |
|
59 */ |
|
60 static CAknFepUICtrlCandidateCharacter* NewL( RWindowTreeNode& aParent, |
|
61 MAknFepUIEventObserver* aObserver ); |
|
62 |
|
63 /** |
|
64 * destructor |
|
65 */ |
|
66 ~CAknFepUICtrlCandidateCharacter(); |
|
67 |
|
68 /** |
|
69 * Set the text buffer of the character. |
|
70 * |
|
71 * @param aCharacter, the label will be filled with the characters from aCharacter |
|
72 */ |
|
73 void SetText( const TDesC& aCharacter ); |
|
74 |
|
75 /** |
|
76 * Get the text of the character |
|
77 * |
|
78 */ |
|
79 const TDesC* Text() const; |
|
80 |
|
81 public: // from CCoeControl |
|
82 /** |
|
83 * size changed |
|
84 */ |
|
85 virtual void SizeChanged(); |
|
86 |
|
87 /** |
|
88 * count component controls |
|
89 * |
|
90 * @return number of contained controls |
|
91 */ |
|
92 TInt CountComponentControls() const; |
|
93 |
|
94 /** |
|
95 * Component control |
|
96 * |
|
97 * @param aIndex the control to return, must be between 0 and the number of controls |
|
98 * @return pointer to contained control, ownership is not passed |
|
99 */ |
|
100 CCoeControl* ComponentControl(TInt aIndex) const; |
|
101 |
|
102 /** |
|
103 * draw |
|
104 * |
|
105 * @param aRect rectangle |
|
106 */ |
|
107 virtual void Draw( const TRect& aRect ) const; |
|
108 |
|
109 /** |
|
110 * Set character highlight state |
|
111 * |
|
112 * @param bHighlight highlight or not |
|
113 */ |
|
114 void SetHighlight( TBool bHightlight ); |
|
115 |
|
116 protected: |
|
117 /** |
|
118 * second phase construction |
|
119 */ |
|
120 void ConstructL( RWindowTreeNode& aParent, MAknFepUIEventObserver* aObserver ); |
|
121 |
|
122 /** |
|
123 * constructor |
|
124 */ |
|
125 CAknFepUICtrlCandidateCharacter(); |
|
126 |
|
127 /** |
|
128 * layout the rectangles |
|
129 */ |
|
130 void LayoutRects(); |
|
131 |
|
132 /** |
|
133 * layout contained controls |
|
134 */ |
|
135 void LayoutContainedControls(); |
|
136 |
|
137 /** |
|
138 * layout the background frames |
|
139 * |
|
140 * @param aOuterRect filled with outer rect coords |
|
141 * @param aInnerRect filled with inner rect coords |
|
142 * |
|
143 */ |
|
144 void CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const; |
|
145 |
|
146 private: |
|
147 TAknLayoutRect iRectShadow; |
|
148 TAknLayoutRect iRectHighlight; |
|
149 TBufC<EMaxSelectedCandidateLength> iBuffer; |
|
150 |
|
151 private: // the following are owned |
|
152 CEikLabel* iCandidateLabel; |
|
153 TBool iIsHighligt; |
|
154 }; |
|
155 |
|
156 #endif //__AKN_FEP_CANDIDATE_CHARACTER_PANE_H__ |
|
157 |
|
158 // End of file |