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