|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Transaction factory implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_TRANSACTIONFACTORYIMPL_H |
|
20 #define C_TRANSACTIONFACTORYIMPL_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "transactionfactory.h" |
|
25 |
|
26 namespace AiUtility |
|
27 { |
|
28 class CContentPriorityMap; |
|
29 } |
|
30 |
|
31 namespace AiXmlUiController |
|
32 { |
|
33 |
|
34 class CTransaction; |
|
35 class CTransactionElement; |
|
36 class CCssPropertyMap; |
|
37 |
|
38 |
|
39 /** |
|
40 * @ingroup group_xmluicontroller |
|
41 * |
|
42 * CTransactionFactoryImpl implements MTransactionFactory. |
|
43 * It provides a recycling pool of transaction objects. |
|
44 * |
|
45 * @lib AiXmlUiMain |
|
46 */ |
|
47 class CTransactionFactoryImpl: public CBase, public MTransactionFactory |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 static CTransactionFactoryImpl* |
|
52 NewL( AiUtility::CContentPriorityMap& aContentPriorityMap, |
|
53 CCssPropertyMap& aPropertyMap ); |
|
54 |
|
55 virtual ~CTransactionFactoryImpl(); |
|
56 |
|
57 // Functions from MTransactionFactory |
|
58 |
|
59 MTransaction* CreateTransactionL( TInt aTxId ); |
|
60 |
|
61 void ReleaseTransaction( MTransaction* aTransaction ); |
|
62 |
|
63 MTransactionElement* CreateTextTransactionElementL( |
|
64 CXnNodeAppIf& aTarget, const TDesC& aText, TInt aPriority ); |
|
65 |
|
66 MTransactionElement* CreateDataBufferTransactionElementL( |
|
67 CXnNodeAppIf& aTarget, const TDesC8& aData, TInt aPriority ); |
|
68 |
|
69 MTransactionElement* CreateDataBufferTransactionElementL( |
|
70 CXnNodeAppIf& aTarget, const TDesC8& aData, TInt aPriority, |
|
71 const TDesC& aCid, TInt aIndex ); |
|
72 |
|
73 MTransactionElement* CreateEmptyContentTransactionElementL( |
|
74 CXnNodeAppIf& aTarget, TInt aIndex ); |
|
75 |
|
76 MTransactionElement* CreateImageTransactionElementL( |
|
77 CXnNodeAppIf& aTarget, CGulIcon* aIcon, TInt aPriority ); |
|
78 |
|
79 MTransactionElement* CreateImageTransactionElementL( |
|
80 CXnNodeAppIf& aTarget, RFile& aFile, TInt aPriority ); |
|
81 |
|
82 MTransactionElement* CreateNewsTickerTransactionElementL( |
|
83 CXnNodeAppIf& aTarget, const TDesC& aText, TInt aPriority, TInt aIndex ); |
|
84 |
|
85 void ReleaseTransactionElement( MTransactionElement* aElement ); |
|
86 |
|
87 TBool IsSupported( CXnNodeAppIf& aTarget, const TDesC8& aContentType ); |
|
88 |
|
89 private: // Construction |
|
90 |
|
91 CTransactionFactoryImpl( |
|
92 AiUtility::CContentPriorityMap& aContentPriorityMap, |
|
93 CCssPropertyMap& aPropertyMap ); |
|
94 |
|
95 void ConstructL(); |
|
96 |
|
97 template<class T> T* NewInstanceL(); |
|
98 |
|
99 // New methods |
|
100 |
|
101 void DeleteTransactionList( TSglQue< CTransaction >& aList ); |
|
102 |
|
103 void DeleteElementList( TSglQue< CTransactionElement >& aList ); |
|
104 |
|
105 private: // Data |
|
106 |
|
107 /** |
|
108 * List of available transactions. |
|
109 */ |
|
110 TSglQue< CTransaction > iAvailableTransactions; |
|
111 |
|
112 /** |
|
113 * List of reserved transactions. |
|
114 */ |
|
115 TSglQue< CTransaction > iReservedTransactions; |
|
116 |
|
117 /** |
|
118 * List of available transaction elements. |
|
119 */ |
|
120 TSglQue< CTransactionElement > iAvailableElements; |
|
121 |
|
122 /** |
|
123 * List of reserved transaction elements. |
|
124 */ |
|
125 TSglQue< CTransactionElement > iReservedElements; |
|
126 |
|
127 /** |
|
128 * Reference to UI controller's content priority map |
|
129 */ |
|
130 AiUtility::CContentPriorityMap& iContentPriorityMap; |
|
131 |
|
132 /** |
|
133 * UI controller's CSS property map. Not own. |
|
134 */ |
|
135 CCssPropertyMap& iPropertyMap; |
|
136 }; |
|
137 |
|
138 } // namespace AiXmlUiController |
|
139 |
|
140 #endif // C_TRANSACTIONFACTORYIMPL_H |
|
141 |
|
142 // End of File |