|
1 /* |
|
2 * Copyright (c) 2003-2006 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: Implementation class for TextBox |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMIDTEXTBOXEDWIN_H |
|
20 #define CMIDTEXTBOXEDWIN_H |
|
21 |
|
22 // ========== INCLUDE FILES ================================ |
|
23 #include <fepbase.h> // for MCoeCaptionRetrieverForFep |
|
24 #include "CMIDEdwin.h" |
|
25 |
|
26 // ========== FORWARD DECLARATIONS ========================= |
|
27 |
|
28 class CMIDTextBoxEdwinCustomDraw; |
|
29 |
|
30 // ========== CLASS DECLARATION ============================ |
|
31 |
|
32 NONSHARABLE_CLASS(CMIDTextBoxEdwin) : public CMIDEdwin, public MCoeCaptionRetrieverForFep |
|
33 { |
|
34 public: |
|
35 static CMIDTextBoxEdwin* NewL(TInt aConstraints,const TDesC& aText,TInt aMaxSize, |
|
36 MMIDDisplayable* aDisplayable); |
|
37 ~CMIDTextBoxEdwin(); |
|
38 |
|
39 // From CEikEdwin |
|
40 /** |
|
41 * Creates a new @c CLafEdwinCustomDrawBase instance. |
|
42 * |
|
43 * @return Pointer to new custom @c CLafEdwinCustomDrawBase object. |
|
44 */ |
|
45 virtual CLafEdwinCustomDrawBase* CreateCustomDrawL(); |
|
46 |
|
47 #ifdef RD_SCALABLE_UI_V2 |
|
48 void HandlePointerEventL(const TPointerEvent &aPointerEvent); |
|
49 #endif // RD_SCALABLE_UI_V2 |
|
50 |
|
51 // From CCoeControl |
|
52 TCoeInputCapabilities InputCapabilities() const; |
|
53 |
|
54 // From MCoeCaptionRetrieverForFep |
|
55 void GetCaptionForFep(TDes& aCaption) const; |
|
56 |
|
57 protected: // from CMIDEdwin |
|
58 /** |
|
59 * Layouts the CMIDTextBoxEdwin relative to the parent. |
|
60 * @note The margins are added by CMIDTextBoxControl::SizeChanged() |
|
61 * @see CMIDTextBoxControl::SizeChanged() |
|
62 * <p> |
|
63 * @param aRect the parent rect |
|
64 * @param aLayout multi line layout info |
|
65 */ |
|
66 virtual void DoLayout(const TRect& aRect); |
|
67 void AddCommandsToEdwinL(RPointerArray<MMIDCommand>& aArray); |
|
68 |
|
69 private: // Constructors |
|
70 /** |
|
71 * Constructor |
|
72 */ |
|
73 CMIDTextBoxEdwin(TUint aConstraints, MMIDDisplayable* aDisplayable); |
|
74 |
|
75 /** |
|
76 * Second phase constructor |
|
77 * @param aText a text to be set in the field |
|
78 * @param aMaxSize maximum number of characters to allow |
|
79 */ |
|
80 void ConstructL(const TDesC& aText,TInt aMaxSize); |
|
81 |
|
82 /** |
|
83 * Get the layout for the Edwin |
|
84 * |
|
85 * @return multi line layout structure |
|
86 */ |
|
87 TAknMultiLineTextLayout GetLayout() const; |
|
88 |
|
89 public: |
|
90 |
|
91 /** |
|
92 * Returning pointer to owned CMIDTextBoxEdwinCustomDraw |
|
93 * |
|
94 * @return Pointer to iCustomDraw. |
|
95 */ |
|
96 CMIDTextBoxEdwinCustomDraw* GetCustomDraw() const; |
|
97 |
|
98 private: // data |
|
99 // reference on the latest instance created, EikEdwin owns the instance |
|
100 CMIDTextBoxEdwinCustomDraw* iCustomDraw; |
|
101 }; |
|
102 |
|
103 #endif // CMIDTEXTBOXEDWIN_H |