|
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 * ECom Component factory interface |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNCOMPONENTFACTORY_H |
|
20 #define XNCOMPONENTFACTORY_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CXnComponent; |
|
27 class CXnControlAdapter; |
|
28 class CXnNodePluginIf; |
|
29 |
|
30 // Class declaration |
|
31 /** |
|
32 * Component UI factory interface for creating UI representations of the layout |
|
33 * areas. |
|
34 * |
|
35 * @ingroup group_xnlayoutengine |
|
36 * @lib xnlayoutengine.lib |
|
37 * @since Series 60 3.1 |
|
38 */ |
|
39 class MXnComponentFactory |
|
40 { |
|
41 public: |
|
42 // Data types |
|
43 |
|
44 /** |
|
45 * Response values from the component factory. Indicate the action |
|
46 * taken or desired from the factory on the requested area. |
|
47 */ |
|
48 enum TXnComponentFactoryResponse |
|
49 { |
|
50 /** Successful construction of the component */ |
|
51 EXnFactoryResponseComponentConstructed, |
|
52 /** Successful disposal of the component */ |
|
53 EXnFactoryResponseComponentDisposed, |
|
54 /** The factory does not know how to create/dispose given component, |
|
55 * reponsibility is passed onto the next factory in the chain */ |
|
56 EXnFactoryResponseComponentNotSupported, |
|
57 /** The factory does not know how to create the given component |
|
58 * and does not wish the given area to be passed on to any other factory |
|
59 * for creation - often the area is already handled by a parent area */ |
|
60 EXnFactoryResponseDenyComponentConstruction |
|
61 }; |
|
62 |
|
63 public: |
|
64 |
|
65 IMPORT_C virtual ~MXnComponentFactory(); |
|
66 |
|
67 public: |
|
68 // New functions |
|
69 |
|
70 /** |
|
71 * Create a component |
|
72 * |
|
73 * @since Series 60 3.1 |
|
74 * @param aNode UI node |
|
75 * @param aTargetComponent Target component |
|
76 * @return Factory response |
|
77 */ |
|
78 IMPORT_C TXnComponentFactoryResponse CreateXnComponentL( |
|
79 CXnNodePluginIf& aNode, |
|
80 CXnComponent*& aTargetComponent ); |
|
81 |
|
82 /** |
|
83 * Check whether a node needs a component node implementation |
|
84 * |
|
85 * @since Series 60 3.1 |
|
86 * @param aType Node type |
|
87 * @return ETrue if a component node implementation is required, EFalse |
|
88 * otherwise |
|
89 */ |
|
90 IMPORT_C TBool DoesNodeNeedComponentImplL( const TDesC8& aType ); |
|
91 |
|
92 protected: |
|
93 // New functions |
|
94 |
|
95 /** |
|
96 * C++ default constructor. Protected in order to allow for derivation. |
|
97 */ |
|
98 IMPORT_C MXnComponentFactory(); |
|
99 |
|
100 private: |
|
101 /** |
|
102 * Create a component |
|
103 * |
|
104 * @since Series 60 3.1 |
|
105 * @param aNode UI node |
|
106 * @param aTargetComponent Target component |
|
107 * @return Factory response |
|
108 */ |
|
109 IMPORT_C virtual TXnComponentFactoryResponse MakeXnComponentL( |
|
110 CXnNodePluginIf& aNode, |
|
111 CXnComponent*& aTargetComponent ) = 0; |
|
112 |
|
113 /** |
|
114 * Create a control adapter |
|
115 * |
|
116 * @since Series 60 3.1 |
|
117 * @param aNode UI node |
|
118 * @param aParent Parent control |
|
119 * @return Created control |
|
120 */ |
|
121 IMPORT_C virtual CXnControlAdapter* MakeXnControlAdapterL( |
|
122 CXnNodePluginIf& aNode, |
|
123 CXnControlAdapter* aParent = NULL ) = 0; |
|
124 }; |
|
125 |
|
126 #endif |