|
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 source |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDES |
|
19 #include "xncomponent.h" |
|
20 #include "xncontroladapter.h" |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CXnComponent::NewL() |
|
26 // Two-phased constructor. |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 EXPORT_C CXnComponent* CXnComponent::NewL() |
|
30 { |
|
31 CXnComponent* self = new ( ELeave ) CXnComponent; |
|
32 |
|
33 CleanupStack::PushL( self ); |
|
34 self->ConstructL(); |
|
35 CleanupStack::Pop(); |
|
36 |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CXnComponent::ConstructL() |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C void CXnComponent::ConstructL() |
|
46 { |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CXnComponent::CXnComponent() |
|
51 // C++ default constructor can NOT contain any code, that |
|
52 // might leave. |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 EXPORT_C CXnComponent::CXnComponent() |
|
56 { |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CXnComponent::~CXnComponent() |
|
61 // C++ default destructor. |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 EXPORT_C CXnComponent::~CXnComponent() |
|
65 { |
|
66 delete iAdapter; |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CXnComponent::SetControlAdapter() |
|
71 // Sets component control adapter. |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C void CXnComponent::SetControlAdapter( CXnControlAdapter* aAdapter ) |
|
75 { |
|
76 if ( iAdapter ) |
|
77 { |
|
78 return; |
|
79 } |
|
80 iAdapter = aAdapter; |
|
81 if ( iAdapter ) |
|
82 { |
|
83 iAdapter->SetComponent( this ); |
|
84 } |
|
85 } |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CXnComponent::ControlAdapter() |
|
89 // Returns pointer to component control adapter. |
|
90 // ----------------------------------------------------------------------------- |
|
91 // |
|
92 EXPORT_C CXnControlAdapter* CXnComponent::ControlAdapter() |
|
93 { |
|
94 return iAdapter; |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // CXnComponent::Node |
|
99 // Returns node associated with the component |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 EXPORT_C CXnNodePluginIf* CXnComponent::Node() |
|
103 { |
|
104 return iNode; |
|
105 } |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CXnComponent::SetNode |
|
109 // Sets node associated with the component |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C void CXnComponent::SetNode( CXnNodePluginIf& aNode ) |
|
113 { |
|
114 iNode = &aNode; |
|
115 } |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CXnComponent::EnterPowerSaveModeL |
|
119 // Enter power save mode |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 EXPORT_C void CXnComponent::EnterPowerSaveModeL() |
|
123 { |
|
124 if ( iAdapter ) |
|
125 { |
|
126 iAdapter->EnterPowerSaveModeL(); |
|
127 } |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // CXnComponent::ExitPowerSaveModeL |
|
132 // Exit power save mode |
|
133 // ----------------------------------------------------------------------------- |
|
134 // |
|
135 EXPORT_C void CXnComponent::ExitPowerSaveModeL() |
|
136 { |
|
137 if ( iAdapter ) |
|
138 { |
|
139 iAdapter->ExitPowerSaveModeL(); |
|
140 } |
|
141 } |
|
142 |
|
143 // ----------------------------------------------------------------------------- |
|
144 // CXnComponent::MakeInterfaceL |
|
145 // Create a component interface according to the given type. |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 EXPORT_C XnComponentInterface::MXnComponentInterface* CXnComponent::MakeInterfaceL( |
|
149 const TDesC8& /*aType*/ ) |
|
150 { |
|
151 return NULL; |
|
152 } |