|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Interface of ui state |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CPENINPUTUISTATEBASE_H |
|
20 #define C_CPENINPUTUISTATEBASE_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <w32std.h> |
|
25 #include <peninputcmd.h> |
|
26 |
|
27 // Forward declarations |
|
28 class MPeninputUiStateMgr; |
|
29 class MPeninputLayoutContext; |
|
30 |
|
31 /** |
|
32 * Basic class of ui state |
|
33 * |
|
34 * @lib peninputcommonlayout.lib |
|
35 * @since S60 v3.2 |
|
36 */ |
|
37 class CPeninputUiStateBase : public CBase |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Two-phased constructor |
|
44 * |
|
45 * @since S60 v3.2 |
|
46 * @param aUiStateMgr The ui state manager |
|
47 * @param aContext The layout context |
|
48 * @return The pointer to CPeninputUiStateBase object |
|
49 */ |
|
50 IMPORT_C static CPeninputUiStateBase* NewL( |
|
51 MPeninputUiStateMgr* aUiStateMgr, |
|
52 MPeninputLayoutContext* aContext ); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 * |
|
57 * @since S60 v3.2 |
|
58 * @return None |
|
59 */ |
|
60 IMPORT_C virtual ~CPeninputUiStateBase(); |
|
61 |
|
62 /** |
|
63 * Handle key event |
|
64 * |
|
65 * @since S60 v3.2 |
|
66 * @param aData Carry information of key pressed |
|
67 * @return ETrue means event was consumed, otherwise EFalse |
|
68 */ |
|
69 IMPORT_C virtual TBool HandleKeyEventL( const TRawEvent& aData ); |
|
70 |
|
71 /** |
|
72 * Handle control event |
|
73 * |
|
74 * @since S60 v3.2 |
|
75 * @param aEventType The event type |
|
76 * @param aEventData The event data |
|
77 * @return ETrue means event was consumed, otherwise EFalse |
|
78 */ |
|
79 IMPORT_C virtual TBool HandleControlEvent( TInt aEventType, |
|
80 const TDesC& aEventData ); |
|
81 |
|
82 protected: |
|
83 |
|
84 /** |
|
85 * Constructor |
|
86 * |
|
87 * @since S60 v3.2 |
|
88 * @param aUiStateMgr The ui state manager |
|
89 * @param aContext The layout context |
|
90 * @return None |
|
91 */ |
|
92 IMPORT_C CPeninputUiStateBase( MPeninputUiStateMgr* aUiStateMgr, |
|
93 MPeninputLayoutContext* aContext ); |
|
94 |
|
95 /** |
|
96 * Symbian second-phase constructor |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @return None |
|
100 */ |
|
101 IMPORT_C void Construct(); |
|
102 |
|
103 /** |
|
104 * Send key event through layout context |
|
105 * |
|
106 * @since S60 v3.2 |
|
107 * @param aEventData Event data, the left most is unicode |
|
108 * @return ETrue if key event was consumed, otherwise EFalse |
|
109 */ |
|
110 IMPORT_C TBool SendKey( const TDesC& aEventData ); |
|
111 |
|
112 protected: |
|
113 |
|
114 /** |
|
115 * Ui state manager |
|
116 * Not own |
|
117 */ |
|
118 MPeninputUiStateMgr* iUiStateMgr; |
|
119 |
|
120 /** |
|
121 * Layout context |
|
122 * Not own |
|
123 */ |
|
124 MPeninputLayoutContext* iContext; |
|
125 |
|
126 }; |
|
127 |
|
128 #endif // C_CPENINPUTUISTATEBASE_H |