williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__EIKCAPC_H__)
|
williamr@2
|
20 |
#define __EIKCAPC_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#if !defined(__COECNTRL_H__)
|
williamr@2
|
23 |
#include <coecntrl.h>
|
williamr@2
|
24 |
#endif
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#if !defined(__FEPBASE_H__)
|
williamr@2
|
27 |
#include <fepbase.h>
|
williamr@2
|
28 |
#endif
|
williamr@2
|
29 |
|
williamr@2
|
30 |
#if !defined(__EIKLABEL_H__)
|
williamr@2
|
31 |
#include <eiklabel.h>
|
williamr@2
|
32 |
#endif
|
williamr@2
|
33 |
|
williamr@2
|
34 |
#include <eikdialg.h>
|
williamr@2
|
35 |
#include <eikdpage.h>
|
williamr@2
|
36 |
|
williamr@2
|
37 |
#include <AknControl.h>
|
williamr@2
|
38 |
|
williamr@2
|
39 |
class CEikImage ;
|
williamr@2
|
40 |
class CEikDialogPage;
|
williamr@2
|
41 |
// Forward declaration of types used in layout routines.
|
williamr@2
|
42 |
class CAknPopupField;
|
williamr@2
|
43 |
class CAknSlider;
|
williamr@2
|
44 |
class CEikEdwin;
|
williamr@2
|
45 |
class CEikMfne;
|
williamr@2
|
46 |
class CEikSecretEditor;
|
williamr@2
|
47 |
class CEikCapCLabel ;
|
williamr@2
|
48 |
class CEikCapCExtension;
|
williamr@2
|
49 |
class MPointerEventObserver;
|
williamr@2
|
50 |
class MAknsControlContext;
|
williamr@2
|
51 |
|
williamr@2
|
52 |
/** CaptionedControl
|
williamr@2
|
53 |
*
|
williamr@2
|
54 |
* CaptionedControl is part of the dialogs. All dialogs and forms use captionedcontrol
|
williamr@2
|
55 |
* as a control for one DLG_LINE. Each DLG_LINE has one captionedcontrol in it.
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
* Rectangle of the captionedcontrol is single form field / form line or DLG_LINE's
|
williamr@2
|
58 |
* rectangle dependent on the dialog type.
|
williamr@2
|
59 |
*/
|
williamr@2
|
60 |
class CEikCaptionedControl : public CAknControl, public MCoeCaptionRetrieverForFep, public MCoeControlObserver
|
williamr@2
|
61 |
{
|
williamr@2
|
62 |
friend class CEikCapCExtension;
|
williamr@2
|
63 |
public:
|
williamr@2
|
64 |
enum TSpaceSharingFlags
|
williamr@2
|
65 |
{
|
williamr@2
|
66 |
EIfTooSmallCtlGetsWidthLast =0x0,
|
williamr@2
|
67 |
EIfTooSmallCtlGetsWidthFirst =0x1,
|
williamr@2
|
68 |
EIfTooSmallCtlGetsEqualShareOfWidth =0x2,
|
williamr@2
|
69 |
EIfTooBigCtlStaysMinHeight =0x4,
|
williamr@2
|
70 |
EIfTooBigCtlStaysMinWidth =0x8,
|
williamr@2
|
71 |
EIfTooBigCtlStaysMinSize =0xc,
|
williamr@2
|
72 |
EIfTooSmallDontStrech =0x10
|
williamr@2
|
73 |
};
|
williamr@2
|
74 |
enum TCaptionExpandingState
|
williamr@2
|
75 |
{
|
williamr@2
|
76 |
EInitial = 0,
|
williamr@2
|
77 |
EExtended =1,
|
williamr@2
|
78 |
ERetracted =2
|
williamr@2
|
79 |
};
|
williamr@2
|
80 |
|
williamr@2
|
81 |
public:
|
williamr@2
|
82 |
/** Constructor
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
IMPORT_C CEikCaptionedControl();
|
williamr@2
|
85 |
/** Destructor
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
IMPORT_C ~CEikCaptionedControl();
|
williamr@2
|
88 |
public: // new functions
|
williamr@2
|
89 |
/** SetUsesEars() sets a flag Uses Ears.
|
williamr@2
|
90 |
*/
|
williamr@2
|
91 |
IMPORT_C void SetUsesEars();
|
williamr@2
|
92 |
/** SetSpaceSharingFlags() sets flags for space sharing
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
IMPORT_C void SetSpaceSharingFlags(TInt aFlags);
|
williamr@2
|
95 |
/** SetExtraAscent() modifies layout to include extra ascent for fonts
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
IMPORT_C void SetExtraAscent();
|
williamr@2
|
98 |
/** SetCaptionL() Sets label of the DLG_LINE
|
williamr@2
|
99 |
* @param aText Descriptor
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
IMPORT_C void SetCaptionL(const TDesC& aText);
|
williamr@2
|
102 |
/** SetTrailerL() Sets trailer
|
williamr@2
|
103 |
* Should not be used
|
williamr@2
|
104 |
* @param aText Descriptor
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
IMPORT_C void SetTrailerL(const TDesC& aText);
|
williamr@2
|
107 |
/** Sets the captionedcontrol to be currently focused or not
|
williamr@2
|
108 |
* @param aSelected whether captionedcontrol is focused
|
williamr@2
|
109 |
*/
|
williamr@2
|
110 |
IMPORT_C void SetCurrent(TBool aSelected);
|
williamr@2
|
111 |
/** Updates captionedcontrol's dimmed state
|
williamr@2
|
112 |
*/
|
williamr@2
|
113 |
IMPORT_C void CheckDimmedDisplayState();
|
williamr@2
|
114 |
/** Sets minimumsizes to zero
|
williamr@2
|
115 |
*/
|
williamr@2
|
116 |
IMPORT_C void ResetMinimumSizes();
|
williamr@2
|
117 |
/** Whether captionedcontrol is latent
|
williamr@2
|
118 |
*
|
williamr@2
|
119 |
* @return true if is latent
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
IMPORT_C TBool IsLatent() const;
|
williamr@2
|
122 |
/** Sets captionedcontrol latent status
|
williamr@2
|
123 |
*/
|
williamr@2
|
124 |
IMPORT_C void SetLatent(TBool aLatent);
|
williamr@2
|
125 |
/** Whether captionedcontrol has latent group following it
|
williamr@2
|
126 |
* @returns true if has latent group following
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
IMPORT_C TBool LatentGroupLineFollows() const;
|
williamr@2
|
129 |
/** Sets latent group following flag
|
williamr@2
|
130 |
* @param aLglf true if latent group following
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
IMPORT_C void SetLatentGroupLineFollows(TBool aLglf);
|
williamr@2
|
133 |
/** Whether there is a divider after the captionedcontrol
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
IMPORT_C TBool DividerAfter() const;
|
williamr@2
|
136 |
/** Sets divider after the captionedcontrol
|
williamr@2
|
137 |
*/
|
williamr@2
|
138 |
IMPORT_C void SetDividerAfter(TBool aDividerAfter);
|
williamr@2
|
139 |
/** Whether captionedcontrol consumes enter key
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
IMPORT_C TBool TakesEnterKey() const;
|
williamr@2
|
142 |
/** Sets captionedcontrol to take enter key
|
williamr@2
|
143 |
* @param aTakesEnter true if takes enter key, false if not
|
williamr@2
|
144 |
*/
|
williamr@2
|
145 |
IMPORT_C void SetTakesEnterKey(TBool aTakesEnter);
|
williamr@2
|
146 |
/** Whether offers hot keys
|
williamr@2
|
147 |
* @return boolean true if offers hotkeys
|
williamr@2
|
148 |
*/
|
williamr@2
|
149 |
IMPORT_C TBool OfferHotKeys() const;
|
williamr@2
|
150 |
/** Sets captionedcontrol to offer hotkeys
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
IMPORT_C void SetOfferHotKeys(TBool aOffer);
|
williamr@2
|
153 |
|
williamr@2
|
154 |
|
williamr@2
|
155 |
/**
|
williamr@2
|
156 |
* From MCoeControlObserver:
|
williamr@2
|
157 |
* Acts upon changes in the hosted control's state.
|
williamr@2
|
158 |
*
|
williamr@2
|
159 |
* This class's implementation handles events from MFNE editor editing
|
williamr@2
|
160 |
* buttons in touch enabled builds
|
williamr@2
|
161 |
*
|
williamr@2
|
162 |
* @param aControl The control changing its state (not used)
|
williamr@2
|
163 |
* @param aEventType The type of control event
|
williamr@2
|
164 |
*/
|
williamr@2
|
165 |
IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
|
williamr@2
|
166 |
|
williamr@2
|
167 |
public:
|
williamr@2
|
168 |
TInt MaximumNumberOfControlLinesOnVisiblePage() const;
|
williamr@2
|
169 |
TInt NumberOfLines() const;
|
williamr@2
|
170 |
TInt NumberOfLinesForScrollBar() const;
|
williamr@2
|
171 |
public:
|
williamr@2
|
172 |
TBool ControlIsAnEdwin(TInt aControlType) const;
|
williamr@2
|
173 |
TBool ControlIsAMfne(TInt aControlType) const;
|
williamr@2
|
174 |
TBool ControlIsAPopfield(TInt aControlType) const;
|
williamr@2
|
175 |
TBool ControlIsASecretEditor(TInt aControlType) const;
|
williamr@2
|
176 |
TBool ControlIsASlider(TInt aControlType) const;
|
williamr@2
|
177 |
TBool ControlIsAColourSelGrid(TInt aControlType) const;
|
williamr@2
|
178 |
TInt ControlType() const;
|
williamr@2
|
179 |
|
williamr@2
|
180 |
public: // from CCoeControl
|
williamr@2
|
181 |
/** MinimumSize() returns minimum size of the control
|
williamr@2
|
182 |
*/
|
williamr@2
|
183 |
IMPORT_C TSize MinimumSize();
|
williamr@2
|
184 |
/** ConstructFromResourceL() constructs the captionedcontrol from DLG_LINE resource
|
williamr@2
|
185 |
*
|
williamr@2
|
186 |
* usually called with the following code:
|
williamr@2
|
187 |
* TResourceReader reader;
|
williamr@2
|
188 |
* iCoeEnv->CreateResourceReaderLC(reader, resId);
|
williamr@2
|
189 |
* control->ConstructFromResourceL(reader);
|
williamr@2
|
190 |
* CleanupStack::PopAndDestroy();
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@2
|
193 |
/** OfferKeyEventL() handles key events
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
williamr@2
|
196 |
/** GetColorUseListL() gets color use list
|
williamr@2
|
197 |
*/
|
williamr@2
|
198 |
IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
|
williamr@2
|
199 |
/** HandleResourceChange handles several kinds of resource change event
|
williamr@2
|
200 |
*/
|
williamr@2
|
201 |
IMPORT_C virtual void HandleResourceChange(TInt aType); // not available before Release 005u
|
williamr@2
|
202 |
/** Provides ability to get input capabilities needed for fep
|
williamr@2
|
203 |
*/
|
williamr@2
|
204 |
IMPORT_C TCoeInputCapabilities InputCapabilities() const;
|
williamr@2
|
205 |
/** SetDimmed sets captionedcontrol to dimmed state
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
IMPORT_C void SetDimmed(TBool aDimmed);
|
williamr@2
|
208 |
/** HandlePointerEventL handles touch pointer events
|
williamr@2
|
209 |
*/
|
williamr@2
|
210 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@2
|
211 |
public:
|
williamr@2
|
212 |
void RegisterPageWithCaptionControl(CEikDialogPage* aPage);
|
williamr@2
|
213 |
|
williamr@2
|
214 |
public: // internal layout properties
|
williamr@2
|
215 |
//void SetProperties(const TRegion &aRegion, const RArray<TCapCProperty> &aProperties);
|
williamr@2
|
216 |
//TRect Line(TInt aLineIndex); // text line rectangles
|
williamr@2
|
217 |
//TInt LineIndex(TPoint aPoint);
|
williamr@2
|
218 |
//TPoint LineControlPoint(TInt aLineIndex);
|
williamr@2
|
219 |
//RArray<TInt> LineIndexesIntersecting(TRect aRect);
|
williamr@2
|
220 |
//void SetProperty(TInt aLine, TCapCProperty &aProperty);
|
williamr@2
|
221 |
//void ClearProperty(TInt aLine, TCapCProperty &aProperty);
|
williamr@2
|
222 |
//TCapCProperty Properties(TInt aLine);
|
williamr@2
|
223 |
//void LineRegions(TRegion &aRegion);
|
williamr@2
|
224 |
//void SetVisibleArea(TRect aRect);
|
williamr@2
|
225 |
//void RemoveVisibleArea();
|
williamr@2
|
226 |
private: // from CCoeControl
|
williamr@2
|
227 |
IMPORT_C TInt CountComponentControls() const;
|
williamr@2
|
228 |
IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
|
williamr@2
|
229 |
IMPORT_C void SizeChanged();
|
williamr@2
|
230 |
IMPORT_C void FocusChanged(TDrawNow aDrawNow);
|
williamr@2
|
231 |
protected: // from CCoeControl
|
williamr@2
|
232 |
IMPORT_C void Draw(const TRect& aRect) const;
|
williamr@2
|
233 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
|
williamr@2
|
234 |
private: // from CCoeControl
|
williamr@2
|
235 |
IMPORT_C void Reserved_2();
|
williamr@2
|
236 |
// from MCoeCaptionRetrieverForFep
|
williamr@2
|
237 |
IMPORT_C virtual void GetCaptionForFep(TDes& aCaption) const;
|
williamr@2
|
238 |
IMPORT_C virtual void MCoeCaptionRetrieverForFep_Reserved_1();
|
williamr@2
|
239 |
IMPORT_C virtual void MCoeCaptionRetrieverForFep_Reserved_2();
|
williamr@2
|
240 |
private:
|
williamr@2
|
241 |
/**
|
williamr@2
|
242 |
* From CAknControl
|
williamr@2
|
243 |
*/
|
williamr@2
|
244 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@2
|
245 |
|
williamr@2
|
246 |
protected: // from MObjectProvider
|
williamr@2
|
247 |
IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
williamr@2
|
248 |
|
williamr@2
|
249 |
public:
|
williamr@2
|
250 |
/** SetToolTipTextL() sets tooltip text
|
williamr@2
|
251 |
* @param aText descriptor for tooltip text
|
williamr@2
|
252 |
*/
|
williamr@2
|
253 |
|
williamr@2
|
254 |
IMPORT_C void SetToolTipTextL( const TDesC& aText ) ;
|
williamr@2
|
255 |
/** Ability to query tooltip text string
|
williamr@2
|
256 |
*/
|
williamr@2
|
257 |
IMPORT_C const TDesC* ToolTipText() const ;
|
williamr@2
|
258 |
/** SetBitmapFromFileL() sets icon contents for the captionedcontrol
|
williamr@2
|
259 |
*/
|
williamr@2
|
260 |
IMPORT_C void SetBitmapFromFileL( const TDesC& aFilename,TInt aMainId,TInt aMaskId =-1 ) ;
|
williamr@2
|
261 |
/** SetEditable sets captionedcontrol to editable state
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
IMPORT_C void SetEditableL( TBool aEditable, TBool aShowEmptyFields = ETrue ) ;
|
williamr@2
|
264 |
|
williamr@2
|
265 |
IMPORT_C void SetFormFlags( TInt aFlags ) ;
|
williamr@2
|
266 |
void GetAknLayoutValuesL() ; // Visible within DLL only.
|
williamr@2
|
267 |
TBool HasSeparator() const;
|
williamr@2
|
268 |
/** GetFullCaptionText() gets caption descriptor
|
williamr@2
|
269 |
*
|
williamr@2
|
270 |
*/
|
williamr@2
|
271 |
IMPORT_C const TPtrC GetFullCaptionText() const;
|
williamr@2
|
272 |
TBool IsDisplayable() const;
|
williamr@2
|
273 |
/**
|
williamr@2
|
274 |
* Allows clients of CEikCaptionedControl to turn off drawing
|
williamr@2
|
275 |
* of white background of captionedcontrol.
|
williamr@2
|
276 |
*
|
williamr@2
|
277 |
* @since 2.1
|
williamr@2
|
278 |
*/
|
williamr@2
|
279 |
IMPORT_C void SetDrawNoWhiteBackground(TBool aEnabled); // for list queries with find.
|
williamr@2
|
280 |
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
* In case of an editor control residing in a form,
|
williamr@2
|
283 |
* sets up a pictograph animation callback to redraw the form highlight
|
williamr@2
|
284 |
* control when pictograph animations are updated.
|
williamr@2
|
285 |
*/
|
williamr@2
|
286 |
void SetPictographCallBack();
|
williamr@2
|
287 |
|
williamr@2
|
288 |
/**
|
williamr@2
|
289 |
* Sets icon and sets its size.
|
williamr@2
|
290 |
* @param aBitmap a bitmap which has already been loaded. Must not be NULL.
|
williamr@2
|
291 |
* @param aMask a mask bitmap which has already been loaded. Can be NULL.
|
williamr@2
|
292 |
* Takes ownership of the bitmap objects.
|
williamr@2
|
293 |
* @since 2.8
|
williamr@2
|
294 |
*/
|
williamr@2
|
295 |
IMPORT_C void SetIconL( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
|
williamr@2
|
296 |
|
williamr@2
|
297 |
/**
|
williamr@2
|
298 |
* Sets one of the two small indicator icons
|
williamr@2
|
299 |
* @param aIcon a index 0 or 1 depending on which icon to set
|
williamr@2
|
300 |
* @param aBitmap a bitmap pointer or NULL
|
williamr@2
|
301 |
* @param aMask a mask pointer or NULL
|
williamr@2
|
302 |
*/
|
williamr@2
|
303 |
IMPORT_C void SetIndicatorIconL( TInt aIcon, CFbsBitmap *aBitmap, CFbsBitmap *aMask );
|
williamr@2
|
304 |
|
williamr@2
|
305 |
/** SetPointerEventObserver
|
williamr@2
|
306 |
* Low level observer for touch related pointer events.
|
williamr@2
|
307 |
* This can be used to receive low level pointer events.
|
williamr@2
|
308 |
*/
|
williamr@2
|
309 |
IMPORT_C void SetPointerEventObserver(MPointerEventObserver *aObserver);
|
williamr@2
|
310 |
MPointerEventObserver *PointerEventObserver() const;
|
williamr@2
|
311 |
protected:
|
williamr@2
|
312 |
TRect ViewRect() const;
|
williamr@2
|
313 |
TRect EditRect() const;
|
williamr@2
|
314 |
|
williamr@2
|
315 |
private:
|
williamr@2
|
316 |
enum TWhichEars
|
williamr@2
|
317 |
{
|
williamr@2
|
318 |
ENoEar=0x00,
|
williamr@2
|
319 |
ELeftEar=0x01,
|
williamr@2
|
320 |
ERightEar=0x02,
|
williamr@2
|
321 |
EBothEars=0x03
|
williamr@2
|
322 |
};
|
williamr@2
|
323 |
private: // new functions
|
williamr@2
|
324 |
TInt WidthForEars(TInt aWidthRemaining) const;
|
williamr@2
|
325 |
void DrawEarsNow(TWhichEars aEar) const;
|
williamr@2
|
326 |
void DrawEars(TWhichEars aEar) const;
|
williamr@2
|
327 |
void DrawSingleEar(TWhichEars aEar,TBool aPressed) const;
|
williamr@2
|
328 |
TRect EarRect(TWhichEars aEar) const;
|
williamr@2
|
329 |
void FireEarL(TWhichEars aEar,TInt aEarRepeat);
|
williamr@2
|
330 |
TInt SquashComponentWidth(TInt& aTotalWidth,const TInt aComponentWidthHint);
|
williamr@2
|
331 |
void StretchComponents();
|
williamr@2
|
332 |
void SetVertEdgeSpacing( TInt aVertEdgeSpacing );
|
williamr@2
|
333 |
void SetHorzEdgeSpacing( TInt aHorzEdgeSpacing );
|
williamr@2
|
334 |
void SquashComponents();
|
williamr@2
|
335 |
void CalculateNumberOfLinesForControl( TInt aLines ) ;
|
williamr@2
|
336 |
void SizeDialogComponents() ;
|
williamr@2
|
337 |
void PositionDialogComponents() ;
|
williamr@2
|
338 |
static TInt PictographAnimationCallBack( TAny* aPtr );
|
williamr@2
|
339 |
/**
|
williamr@2
|
340 |
* Sets a size for a bitmap that has already been loaded.
|
williamr@2
|
341 |
* @since 2.8
|
williamr@2
|
342 |
*/
|
williamr@2
|
343 |
void SetIconSizeL(CFbsBitmap* aBitmap);
|
williamr@2
|
344 |
/**
|
williamr@2
|
345 |
* Gets control context for the given control
|
williamr@2
|
346 |
* @param aDialog a dialog to get context for
|
williamr@2
|
347 |
* If aDialog provided does not exist, TODO
|
williamr@2
|
348 |
*/
|
williamr@2
|
349 |
MAknsControlContext* GetDialogControlContext(const CCoeControl* aDialog) const;
|
williamr@2
|
350 |
|
williamr@2
|
351 |
/**
|
williamr@2
|
352 |
* Searches recursively for control's parents until it finds a window owning control
|
williamr@2
|
353 |
*/
|
williamr@2
|
354 |
const CCoeControl* WindowOwningParent() const;
|
williamr@2
|
355 |
|
williamr@2
|
356 |
public:
|
williamr@2
|
357 |
/**
|
williamr@2
|
358 |
* Positions form components in accordance with dialog page flags.
|
williamr@2
|
359 |
* If the dialog instance is not registered, them flags set with SetFormFlags() are used.
|
williamr@2
|
360 |
*/
|
williamr@2
|
361 |
void PositionFormComponents();
|
williamr@2
|
362 |
void ScrollBackEditor();
|
williamr@2
|
363 |
|
williamr@2
|
364 |
public:
|
williamr@2
|
365 |
void DrawClosingLine() const;
|
williamr@2
|
366 |
const CEikDialogPage* DialogPage() const { return iDialogPage; }
|
williamr@2
|
367 |
void SetPartiallyVisible( TBool aPVisible );
|
williamr@2
|
368 |
TBool PressedDownState() const;
|
williamr@2
|
369 |
void SetPressedDownState( TBool aPressed );
|
williamr@2
|
370 |
private:
|
williamr@2
|
371 |
TSize EditorControlSize() const ;
|
williamr@2
|
372 |
void SetElementBrushColorsL( TRgb aColor ) ;
|
williamr@2
|
373 |
void SetElementTextColorsL( TRgb aColor ) ;
|
williamr@2
|
374 |
|
williamr@2
|
375 |
TBool ShowBitmap() const;
|
williamr@2
|
376 |
void LayoutBitmap(const TRect& aRect);
|
williamr@2
|
377 |
void LayoutCaption(const TRect& aRect);
|
williamr@2
|
378 |
void DoFormCaptionSettingsL(const TDesC& aText);
|
williamr@2
|
379 |
private:
|
williamr@2
|
380 |
static void FormLayoutControlBitmap(CEikImage* aBitmap, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines);
|
williamr@2
|
381 |
static void FormLayoutControlEdwin(CEikEdwin* aEdwin, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused);
|
williamr@2
|
382 |
static void FormLayoutControlLabel(CEikLabel* aSlider, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aLayoutWithBitmap, TBool aIsFocused, TInt aIconCount);
|
williamr@2
|
383 |
static void FormLayoutControlMfne(CEikMfne* aMfne, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused );
|
williamr@2
|
384 |
static void FormLayoutControlPopfield(CAknPopupField* aPopfield, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused);
|
williamr@2
|
385 |
static void FormLayoutControlSecretEditor(CEikSecretEditor* aSecretEd, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused );
|
williamr@2
|
386 |
static void FormLayoutControlSlider(CAknSlider* aSlider, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent);
|
williamr@2
|
387 |
static void ConvertViewRectToEditRect(TRect& aRect);
|
williamr@2
|
388 |
static void ConvertEditRectToViewRect(TRect& aRect);
|
williamr@2
|
389 |
|
williamr@2
|
390 |
/*
|
williamr@2
|
391 |
*
|
williamr@2
|
392 |
* Access method for use in a CAknForm context.
|
williamr@2
|
393 |
*
|
williamr@2
|
394 |
* @return Enumeration for layout for the CAknForm
|
williamr@2
|
395 |
* Layout value is received from owning CEikDialogPage, if it is not defined then EEikFormUseDoubleSpacedFormat flag is checked.
|
williamr@2
|
396 |
* Default value is CEikDialogPage::ESingle
|
williamr@2
|
397 |
*/
|
williamr@2
|
398 |
CEikDialogPage::TFormLayoutSelection FormLayout() const;
|
williamr@2
|
399 |
|
williamr@2
|
400 |
/**
|
williamr@2
|
401 |
* Draws the separator between (at the top of current ) caption control(s)
|
williamr@2
|
402 |
*
|
williamr@2
|
403 |
* @param gc Current graphics contect
|
williamr@2
|
404 |
*/
|
williamr@2
|
405 |
void DrawFormSeparator( CWindowGc& gc ) const;
|
williamr@2
|
406 |
|
williamr@2
|
407 |
/**
|
williamr@2
|
408 |
* Constructs the extension object.
|
williamr@2
|
409 |
* There is no base constructL, so it is necessary to call this in several places
|
williamr@2
|
410 |
*/
|
williamr@2
|
411 |
void ConstructExtensionL() ;
|
williamr@2
|
412 |
|
williamr@2
|
413 |
void DrawAsSkinnedForm( CWindowGc& aGc, const TRect& aRect ) const;
|
williamr@2
|
414 |
void LayoutSkinControlContexts();
|
williamr@2
|
415 |
TBool DrawingSkins() const;
|
williamr@2
|
416 |
void DrawAsForm( const TRect& aRect ) const;
|
williamr@2
|
417 |
void DrawAsEikonDialog( const TRect& aRect ) const;
|
williamr@2
|
418 |
void DrawAsFormInEditMode( const TRect& aRect ) const;
|
williamr@2
|
419 |
void DrawAsFormInViewMode( const TRect& aRect ) const;
|
williamr@2
|
420 |
void DrawAsFormUnFocusedLine( const TRect& aRect ) const;
|
williamr@2
|
421 |
|
williamr@2
|
422 |
public:
|
williamr@2
|
423 |
CCoeControl* iControl;
|
williamr@2
|
424 |
CEikCapCLabel* iCaption;
|
williamr@2
|
425 |
HBufC* iCaptionText;
|
williamr@2
|
426 |
|
williamr@2
|
427 |
CEikLabel* iTrailer;
|
williamr@2
|
428 |
TInt iId;
|
williamr@2
|
429 |
TInt iControlType;
|
williamr@2
|
430 |
TAny* iReturnValue;
|
williamr@2
|
431 |
TBool iIsFormControl ;
|
williamr@2
|
432 |
CEikImage* iBitmap ;
|
williamr@2
|
433 |
TBool iIsEditable ;
|
williamr@2
|
434 |
|
williamr@2
|
435 |
private:
|
williamr@2
|
436 |
TBool iHasAppendedEditIndicator;
|
williamr@2
|
437 |
TSize iMinSize;
|
williamr@2
|
438 |
TInt iCapCFlags;
|
williamr@2
|
439 |
TInt iCaptionWidth;
|
williamr@2
|
440 |
TInt iFullWidth;
|
williamr@2
|
441 |
TSize iNormalSize ;
|
williamr@2
|
442 |
HBufC*iToolTipText ;
|
williamr@2
|
443 |
TBool iDoNotDisplay ;
|
williamr@2
|
444 |
|
williamr@2
|
445 |
TInt iVertEdgeSpacing ;
|
williamr@2
|
446 |
TInt iHorzEdgeSpacing ;
|
williamr@2
|
447 |
TInt iOriginalHeight ;
|
williamr@2
|
448 |
|
williamr@2
|
449 |
TSize iEditorControlSize ;
|
williamr@2
|
450 |
TInt iNumberOfLines ;
|
williamr@2
|
451 |
|
williamr@2
|
452 |
friend class CEikCapCArray;
|
williamr@2
|
453 |
|
williamr@2
|
454 |
enum { ENotSupplied = -1 } ;
|
williamr@2
|
455 |
TInt iFlags ;
|
williamr@2
|
456 |
|
williamr@2
|
457 |
TBool iRefresh ;
|
williamr@2
|
458 |
|
williamr@2
|
459 |
TInt iCaptionFontId ;
|
williamr@2
|
460 |
TInt iEditorFontId ;
|
williamr@2
|
461 |
TInt iVerticalLineXPosition; //iAknTopSpacing ;
|
williamr@2
|
462 |
CCoeControl* iHighlightControl;
|
williamr@2
|
463 |
CEikCapCExtension* iExtension ; // BC extension for additional Data members.
|
williamr@2
|
464 |
TInt iAknFormControlHeight ;
|
williamr@2
|
465 |
TInt iAknFormControlWidth ;
|
williamr@2
|
466 |
TInt iPenColor ;
|
williamr@2
|
467 |
TInt iShadowColor ;
|
williamr@2
|
468 |
TBool iIsCurrentLine;
|
williamr@2
|
469 |
CEikDialogPage* iDialogPage;
|
williamr@2
|
470 |
|
williamr@2
|
471 |
|
williamr@2
|
472 |
};
|
williamr@2
|
473 |
|
williamr@2
|
474 |
|
williamr@2
|
475 |
/*
|
williamr@2
|
476 |
* Special Label Class which appends colon to label text
|
williamr@2
|
477 |
*/
|
williamr@2
|
478 |
|
williamr@2
|
479 |
NONSHARABLE_CLASS(CEikCapCLabel) : public CEikLabel
|
williamr@2
|
480 |
{
|
williamr@2
|
481 |
public :
|
williamr@2
|
482 |
CEikCapCLabel() ;
|
williamr@2
|
483 |
~CEikCapCLabel() ;
|
williamr@2
|
484 |
|
williamr@2
|
485 |
TBool ColonEnabled() const ;
|
williamr@2
|
486 |
void EnableColon( TBool aEnable ) ;
|
williamr@2
|
487 |
|
williamr@2
|
488 |
protected :
|
williamr@2
|
489 |
void Draw(const TRect& aRect) const ;
|
williamr@2
|
490 |
void DrawL(const TRect& aRect) ;
|
williamr@2
|
491 |
|
williamr@2
|
492 |
private:
|
williamr@2
|
493 |
TBool iIsColonEnabled ;
|
williamr@2
|
494 |
} ;
|
williamr@2
|
495 |
|
williamr@2
|
496 |
class MPointerEventObserver
|
williamr@2
|
497 |
{
|
williamr@2
|
498 |
public:
|
williamr@2
|
499 |
virtual bool PointerEvent(CEikCaptionedControl *aControl, const TPointerEvent& aPointerEvent)=0;
|
williamr@2
|
500 |
};
|
williamr@2
|
501 |
|
williamr@2
|
502 |
#endif
|