|
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: |
|
15 * Xuikon component base class |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNCOMPONENT_H |
|
20 #define XNCOMPONENT_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CXnControlAdapter; |
|
27 class CXnNodePluginIf; |
|
28 namespace XnComponentInterface |
|
29 { |
|
30 class MXnComponentInterface; |
|
31 } |
|
32 |
|
33 // Class declaration |
|
34 /** |
|
35 * Xuikon component base class. |
|
36 * |
|
37 * @ingroup group_xnlayoutengine |
|
38 * @lib ?library |
|
39 * @since Series 60 3.1 |
|
40 */ |
|
41 class CXnComponent : public CBase |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 * @param aType Type. |
|
47 */ |
|
48 IMPORT_C static CXnComponent* NewL(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 IMPORT_C virtual ~CXnComponent(); |
|
54 |
|
55 public: |
|
56 // New functions |
|
57 |
|
58 /** |
|
59 * Sets a control adapter. |
|
60 * |
|
61 * @since Series 60 3.1 |
|
62 * @param aAdapter Adapter. |
|
63 */ |
|
64 IMPORT_C void SetControlAdapter( CXnControlAdapter* aAdapter ); |
|
65 |
|
66 /** |
|
67 * Returns the control adapter. |
|
68 * |
|
69 * @since Series 60 3.1 |
|
70 * @return Control adapter. |
|
71 */ |
|
72 IMPORT_C CXnControlAdapter* ControlAdapter(); |
|
73 |
|
74 /** |
|
75 * Returns component's node. |
|
76 * |
|
77 * @since Series 60 3.1 |
|
78 * @return Node. |
|
79 */ |
|
80 IMPORT_C CXnNodePluginIf* Node(); |
|
81 |
|
82 /** |
|
83 * Sets the component's node. |
|
84 * |
|
85 * @since Series 60 3.1 |
|
86 * @param aNode Node |
|
87 */ |
|
88 IMPORT_C void SetNode( CXnNodePluginIf& aNode ); |
|
89 |
|
90 /** |
|
91 * Enter power save mode. This is done when application goes to background |
|
92 * or lights go off. |
|
93 * Derived classes should override this function and stop animations, |
|
94 * timers etc. when the function is called. |
|
95 */ |
|
96 IMPORT_C virtual void EnterPowerSaveModeL(); |
|
97 |
|
98 /** |
|
99 * Exit power save mode. This is done when application comes to foreground |
|
100 * or lights go on. |
|
101 * Derived classes should override this function and restart animations, |
|
102 * timers etc. when the function is called. |
|
103 */ |
|
104 IMPORT_C virtual void ExitPowerSaveModeL(); |
|
105 |
|
106 /** |
|
107 * Create a component interface according to the given type. |
|
108 * @param aType Type of the interface to create |
|
109 * @return Created interface or NULL if the provided type is not supported. |
|
110 */ |
|
111 IMPORT_C virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL( |
|
112 const TDesC8& aType ); |
|
113 |
|
114 protected: |
|
115 /** |
|
116 * C++ default constructor. |
|
117 */ |
|
118 IMPORT_C CXnComponent(); |
|
119 |
|
120 /** |
|
121 * Two-phased constructor. |
|
122 */ |
|
123 IMPORT_C void ConstructL(); |
|
124 |
|
125 private: |
|
126 // Data |
|
127 |
|
128 /** |
|
129 * Pointer to control adapter. |
|
130 * Own. |
|
131 */ |
|
132 CXnControlAdapter* iAdapter; |
|
133 |
|
134 /** |
|
135 * Component's node. |
|
136 * Not own. |
|
137 */ |
|
138 CXnNodePluginIf* iNode; |
|
139 }; |
|
140 |
|
141 #endif |