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