|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Xuikon component node implementation source |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include "xncomponentnodeimpl.h" |
|
20 #include "xncomponent.h" |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CXnComponentNodeImpl::NewL() |
|
26 // Two-phased constructor. |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 EXPORT_C CXnComponentNodeImpl* CXnComponentNodeImpl::NewL( CXnType* aType ) |
|
30 { |
|
31 CXnComponentNodeImpl* self = new ( ELeave ) CXnComponentNodeImpl; |
|
32 |
|
33 CleanupStack::PushL( self ); |
|
34 self->ConstructL( aType ); |
|
35 CleanupStack::Pop(); |
|
36 |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CXnComponentNodeImpl::ConstructL() |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C void CXnComponentNodeImpl::ConstructL( CXnType* aType ) |
|
46 { |
|
47 CXnNodeImpl::ConstructL( aType ); |
|
48 iComponentNeedsCreation = ETrue; |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CXnComponentNodeImpl::CXnComponentNodeImpl() |
|
53 // C++ default constructor can NOT contain any code, that |
|
54 // might leave. |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 EXPORT_C CXnComponentNodeImpl::CXnComponentNodeImpl() |
|
58 { |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // CXnComponentNodeImpl::~CXnComponentNodeImpl() |
|
63 // C++ default destructor. |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 EXPORT_C CXnComponentNodeImpl::~CXnComponentNodeImpl() |
|
67 { |
|
68 delete iComponent; |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CXnComponentNodeImpl::Component |
|
73 // Return the component |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 EXPORT_C CXnComponent* CXnComponentNodeImpl::Component() |
|
77 { |
|
78 return iComponent; |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CXnComponentNodeImpl::SetComponent |
|
83 // Set the component |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 EXPORT_C void CXnComponentNodeImpl::SetComponent( CXnComponent* aComponent ) |
|
87 { |
|
88 iComponent = aComponent; |
|
89 } |
|
90 |
|
91 // ----------------------------------------------------------------------------- |
|
92 // CXnComponentNodeImpl::DoesComponentNeedCreation |
|
93 // Check whether the component is to be created |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 EXPORT_C TBool CXnComponentNodeImpl::DoesComponentNeedCreation() const |
|
97 { |
|
98 return iComponentNeedsCreation; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CXnComponentNodeImpl::SetComponentNeedsCreation |
|
103 // Set whether the component is to be created |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 EXPORT_C void CXnComponentNodeImpl::SetComponentNeedsCreation( TBool aFlag ) |
|
107 { |
|
108 iComponentNeedsCreation = aFlag; |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CXnComponentNodeImpl::MakeInterfaceL |
|
113 // Create a component interface according to the given type. |
|
114 // ----------------------------------------------------------------------------- |
|
115 // |
|
116 EXPORT_C XnComponentInterface::MXnComponentInterface* CXnComponentNodeImpl::MakeInterfaceL( |
|
117 const TDesC8& aType ) |
|
118 { |
|
119 if ( !iComponent ) |
|
120 { |
|
121 return NULL; |
|
122 } |
|
123 return iComponent->MakeInterfaceL( aType ); |
|
124 } |