|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <AknControl.h> // CAknControl |
|
20 #include <coecobs.h> // MCoeControlObserver |
|
21 #include <aknbutton.h> // CAknButton |
|
22 #include <aknEditStateIndicator.h> // TAknEditingState |
|
23 |
|
24 class CAknKeypad; |
|
25 |
|
26 NONSHARABLE_CLASS( CAknKeypadButton ) : public CAknButton |
|
27 { |
|
28 public: |
|
29 |
|
30 static CAknKeypadButton* NewL( const TDesC& aText, const TInt aScanCode, CAknKeypad* aKeypad ); |
|
31 virtual ~CAknKeypadButton(); |
|
32 |
|
33 public: // Functions from base class |
|
34 |
|
35 /** |
|
36 * Handles pointer events. |
|
37 * |
|
38 * @param aPointerEvent The pointer event. |
|
39 */ |
|
40 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
41 |
|
42 void Draw( const TRect& /*aRect*/ ) const; |
|
43 |
|
44 public: |
|
45 |
|
46 void SetUpperAndLowerTextL( const TDesC& aUpperText, const TDesC& aLowerText ); |
|
47 |
|
48 |
|
49 protected: // Constructors |
|
50 |
|
51 CAknKeypadButton( const TInt aFlags, const TInt aScanCode, CAknKeypad* aKeypad ); |
|
52 |
|
53 /** |
|
54 * Symbian 2nd phase constructor. |
|
55 */ |
|
56 void ConstructL(const TDesC& aText); |
|
57 |
|
58 private: |
|
59 void DrawText( CWindowGc& aGc, const TDesC& aText, TAknTextComponentLayout& aLayout, TInt aMargin ) const; |
|
60 |
|
61 private: |
|
62 TInt iScanCode; |
|
63 HBufC* iUpperText; |
|
64 HBufC* iLowerText; |
|
65 CAknKeypad* iKeypad; |
|
66 }; |
|
67 |
|
68 |
|
69 |
|
70 /** |
|
71 * Class that contains avkon keypad |
|
72 * |
|
73 * @lib avkon.lib |
|
74 * @since S60 v5.0 |
|
75 */ |
|
76 NONSHARABLE_CLASS( CAknKeypad ) : public CAknControl |
|
77 { |
|
78 public: |
|
79 /** |
|
80 * NewL |
|
81 * @param aParent the parent of this control |
|
82 * @return instance of this class |
|
83 */ |
|
84 static CAknKeypad* NewL( CCoeControl& aParent, TInt aQueryType ); |
|
85 |
|
86 /** |
|
87 * Destructor |
|
88 */ |
|
89 ~CAknKeypad(); |
|
90 |
|
91 protected: // from CCoeControl |
|
92 /** |
|
93 * This is called when the size of this control is changed. Here the buttons |
|
94 * are layouted. |
|
95 */ |
|
96 void SizeChanged(); |
|
97 |
|
98 public: |
|
99 |
|
100 void SetState(TAknEditingState aState); |
|
101 TAknEditingState State(); |
|
102 TInt QueryType(); |
|
103 |
|
104 |
|
105 private: |
|
106 /** |
|
107 * Constructor |
|
108 */ |
|
109 CAknKeypad(); |
|
110 |
|
111 /** |
|
112 * 2nd phase constructor |
|
113 */ |
|
114 void ConstructL( CCoeControl& aParent, TInt aQueryType ); |
|
115 |
|
116 private: // data |
|
117 |
|
118 TAknEditingState iState; |
|
119 TInt iQueryType; |
|
120 }; |
|
121 |