|
1 /* |
|
2 * Copyright (c) 2005-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 wrapper for CEikEdwin |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _XNTEXTEDITOR_H |
|
19 #define _XNTEXTEDITOR_H |
|
20 |
|
21 // INCLUDES |
|
22 #include "xncomponent.h" |
|
23 #include <e32base.h> |
|
24 #include "xnnode.h" |
|
25 #include "mxncomponentinterface.h" |
|
26 |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 namespace XnTextEditorInterface |
|
31 { |
|
32 _LIT8( KType, "texteditor" ); |
|
33 |
|
34 class MXnTextEditorInterface : public XnComponentInterface::MXnComponentInterface |
|
35 { |
|
36 public: |
|
37 |
|
38 static inline const TDesC8& Type() |
|
39 { |
|
40 return KType; |
|
41 } |
|
42 |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Sets the new text to the underlying CEikEdvin |
|
47 * @param aText The new content |
|
48 */ |
|
49 virtual void SetTextL(const TDesC& aText) = 0; |
|
50 |
|
51 /** |
|
52 * Returns the text contained in the underlying CEikEdvin |
|
53 * @return HBufC* The text |
|
54 */ |
|
55 virtual const HBufC* Text() = 0; |
|
56 |
|
57 /** |
|
58 * Handles editor events |
|
59 * |
|
60 * @since S60 5.2 |
|
61 * @param aReason, editor event |
|
62 */ |
|
63 virtual void HandleEditorEvent( TInt aReason ) = 0; |
|
64 |
|
65 private: |
|
66 }; |
|
67 } |
|
68 |
|
69 /** |
|
70 * @ingroup group_xntexteditorfactory |
|
71 * @lib xntexteditorfactory.lib |
|
72 * @since S60 |
|
73 */ |
|
74 class CXnTextEditor : public CXnComponent, public XnTextEditorInterface::MXnTextEditorInterface |
|
75 { |
|
76 public: |
|
77 |
|
78 /** |
|
79 * Editor events |
|
80 */ |
|
81 enum TEditorEvent |
|
82 { |
|
83 KActivateTextEditor, |
|
84 KDeactivateTextEditor, |
|
85 KRemoveSplitInputFromStack, |
|
86 KKeepSplitInputInStack |
|
87 }; |
|
88 public: |
|
89 |
|
90 /** |
|
91 * 2 phase construction. |
|
92 */ |
|
93 static CXnTextEditor* NewL(); |
|
94 |
|
95 /** |
|
96 * Destructor. |
|
97 */ |
|
98 virtual ~CXnTextEditor(); |
|
99 |
|
100 public: // New functions |
|
101 |
|
102 /** |
|
103 * Sets the new content to the underlying CEikEdvin |
|
104 * @param aText The new content |
|
105 */ |
|
106 void SetTextL(const TDesC& aText); |
|
107 |
|
108 /** |
|
109 * Returns the text contained in the underlying CEikEdvin |
|
110 * @return HBufC* The text |
|
111 */ |
|
112 const HBufC* Text(); |
|
113 |
|
114 /** |
|
115 * Handles editor events |
|
116 * |
|
117 * @since S60 5.2 |
|
118 * @param aReason, editor event |
|
119 */ |
|
120 void HandleEditorEvent( TInt aReason ); |
|
121 |
|
122 public: // from CCoeControl |
|
123 |
|
124 /** |
|
125 * Create a component interface according to the given type. |
|
126 * @param aType Type of the interface to create |
|
127 * @return Created interface or NULL if the provided type is not supported. |
|
128 */ |
|
129 virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( const TDesC8& aType ); |
|
130 |
|
131 private: |
|
132 |
|
133 CXnTextEditor(); |
|
134 void ConstructL(); |
|
135 }; |
|
136 |
|
137 #endif // _XNTEXTEDITOR_H |
|
138 |
|
139 // End of File |