|
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 for factory creating CXnEditor-element |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <e32base.h> |
|
19 #include <coecntrl.h> |
|
20 #include <barsread.h> |
|
21 |
|
22 #include "xntexteditorfactory.h" |
|
23 #include "xntexteditoradapter.h" |
|
24 #include "xntype.h" |
|
25 #include "xncomponent.h" |
|
26 #include "xnnodepluginif.h" |
|
27 #include "xndomnode.h" |
|
28 #include "aisystemuids.hrh" |
|
29 |
|
30 #include "xntexteditor.h" |
|
31 |
|
32 _LIT8( KXnTextEditor, "texteditor" ); |
|
33 |
|
34 // ============================ MEMBER FUNCTIONS =============================== |
|
35 |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CXnTextEditorFactory::MakeXnComponentL |
|
39 // Creates the Xuikon component for editor control |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 MXnComponentFactory::TXnComponentFactoryResponse CXnTextEditorFactory::MakeXnComponentL( |
|
43 CXnNodePluginIf& aNode, |
|
44 CXnComponent*& aTargetComponent |
|
45 ) |
|
46 { |
|
47 MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported; |
|
48 |
|
49 // Check that the given type of a control is parent (or ancestor) of this control |
|
50 if( aNode.Type()->Type() == KXnTextEditor ) |
|
51 { |
|
52 CXnTextEditor* container = CXnTextEditor::NewL(); |
|
53 |
|
54 aTargetComponent = static_cast< CXnComponent* >( container ); |
|
55 |
|
56 retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed; |
|
57 } |
|
58 |
|
59 return retVal; |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CXnTextEditorFactory::MakeXnControlAdapterL |
|
64 // Creates the control adapter for editor control |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 CXnControlAdapter* CXnTextEditorFactory::MakeXnControlAdapterL( |
|
68 CXnNodePluginIf& aNode, |
|
69 CXnControlAdapter* aParent) |
|
70 { |
|
71 return CXnTextEditorAdapter::NewL( aParent, aNode ); |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CXnTextEditorFactory::NewL |
|
76 // Two-phased constructor. |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 CXnTextEditorFactory* CXnTextEditorFactory::NewL() |
|
80 { |
|
81 CXnTextEditorFactory* self = new( ELeave ) CXnTextEditorFactory; |
|
82 |
|
83 CleanupStack::PushL( self ); |
|
84 self->ConstructL(); |
|
85 CleanupStack::Pop(); |
|
86 |
|
87 return self; |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CXnTextEditorFactory::CXnTextEditorFactory |
|
92 // C++ default constructor can NOT contain any code, that |
|
93 // might leave. |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 CXnTextEditorFactory::CXnTextEditorFactory() |
|
97 { |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CXnTextEditorFactory::~CXnTextEditorFactory |
|
102 // Destructor. |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 CXnTextEditorFactory::~CXnTextEditorFactory() |
|
106 { |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CXnTextEditorFactory::ConstructL |
|
111 // Symbian 2nd phase constructor can leave. |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 void CXnTextEditorFactory::ConstructL() |
|
115 { |
|
116 } |
|
117 |
|
118 |
|
119 // Define the interface UIDs |
|
120 const TImplementationProxy ImplementationTable[] = |
|
121 { |
|
122 #ifdef __EABI__ |
|
123 IMPLEMENTATION_PROXY_ENTRY( AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION, CXnTextEditorFactory::NewL ) |
|
124 #else |
|
125 { { AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION }, CXnTextEditorFactory::NewL } |
|
126 #endif |
|
127 }; |
|
128 |
|
129 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
130 { |
|
131 aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); |
|
132 |
|
133 return ImplementationTable; |
|
134 } |
|
135 |
|
136 // End of file |