|
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 |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_TRANSACTIONFACTORY_H |
|
20 #define M_TRANSACTIONFACTORY_H |
|
21 |
|
22 namespace AiXmlUiController |
|
23 { |
|
24 class MTransaction; |
|
25 class MTransactionElement; |
|
26 } |
|
27 |
|
28 class CXnNodeAppIf; |
|
29 class CGulIcon; |
|
30 class RFile; |
|
31 |
|
32 |
|
33 namespace AiXmlUiController |
|
34 { |
|
35 |
|
36 /** |
|
37 * MTransactionFactory provides life-cycle management of transactions and |
|
38 * transaction elements. |
|
39 * |
|
40 * @lib AiXmlUiMain |
|
41 */ |
|
42 class MTransactionFactory |
|
43 { |
|
44 public: |
|
45 |
|
46 // New functions |
|
47 |
|
48 /** |
|
49 * Creates a new transaction. |
|
50 * |
|
51 * @param aTxId the transaction identifier |
|
52 */ |
|
53 virtual MTransaction* CreateTransactionL( TInt aTxId ) = 0; |
|
54 |
|
55 /** |
|
56 * Releases a transaction element. |
|
57 * |
|
58 * @param aTransaction the transaction to release |
|
59 */ |
|
60 virtual void ReleaseTransaction( MTransaction* aTransaction ) = 0; |
|
61 |
|
62 /** |
|
63 * Creates a new text transaction element. |
|
64 * |
|
65 * @param aTarget the target node of the transaction element |
|
66 * @param aText the text to update |
|
67 * @param aPriority Priority |
|
68 */ |
|
69 virtual MTransactionElement* CreateTextTransactionElementL( |
|
70 CXnNodeAppIf& aTarget, const TDesC& aText, TInt aPriority ) = 0; |
|
71 |
|
72 /** |
|
73 * Creates a new data buffer transaction element. |
|
74 * |
|
75 * @param aTarget the traget node of the transaction element |
|
76 * @param aData the data to update |
|
77 * @param aPriority Priority |
|
78 * @param aCid Content selector id |
|
79 * @param aIndex Content index |
|
80 */ |
|
81 virtual MTransactionElement* CreateDataBufferTransactionElementL( |
|
82 CXnNodeAppIf& aTarget, const TDesC8& aData, TInt aPriority, const TDesC& aCid, TInt aIndex ) = 0; |
|
83 |
|
84 /** |
|
85 * Creates a new data buffer transaction element. |
|
86 * |
|
87 * @param aTarget the traget node of the transaction element |
|
88 * @param aData the data to update |
|
89 * @param aPriority Priority |
|
90 */ |
|
91 virtual MTransactionElement* CreateDataBufferTransactionElementL( |
|
92 CXnNodeAppIf& aTarget, const TDesC8& aData, TInt aPriority ) = 0; |
|
93 |
|
94 /** |
|
95 * Creates a new empty content transaction element. |
|
96 * |
|
97 * @param aTarget the target node of the transaction element |
|
98 * @param aText the text to update |
|
99 */ |
|
100 virtual MTransactionElement* CreateEmptyContentTransactionElementL( |
|
101 CXnNodeAppIf& aTarget, TInt aIndex ) = 0; |
|
102 |
|
103 /** |
|
104 * Creates a new image transaction element. |
|
105 * |
|
106 * @param aTarget the target node of the transaction element |
|
107 * @param aIcon the icon to update. Ownership transferred. |
|
108 * @param aPriority Priority |
|
109 */ |
|
110 virtual MTransactionElement* CreateImageTransactionElementL( |
|
111 CXnNodeAppIf& aTarget, CGulIcon* aIcon, TInt aPriority ) = 0; |
|
112 |
|
113 /** |
|
114 * Creates a new image transaction element. |
|
115 * |
|
116 * @param aTarget the target node of the transaction element |
|
117 * @param aFile the file to read image data from. |
|
118 * @param aPriority Priority |
|
119 */ |
|
120 virtual MTransactionElement* CreateImageTransactionElementL( |
|
121 CXnNodeAppIf& aTarget, RFile& aFile, TInt aPriority ) = 0; |
|
122 |
|
123 /** |
|
124 * Creates a new newsticker transaction element. |
|
125 * |
|
126 * @param aTarget the target node of the transaction element |
|
127 * @param aText the text to update |
|
128 * @param aPriority Priority |
|
129 * @param aIndex Newsticker title index |
|
130 */ |
|
131 virtual MTransactionElement* CreateNewsTickerTransactionElementL( |
|
132 CXnNodeAppIf& aTarget, const TDesC& aText, TInt aPriority, TInt aIndex ) = 0; |
|
133 |
|
134 /** |
|
135 * Releases a transaction element. |
|
136 * |
|
137 * @param aElement the element to release. |
|
138 */ |
|
139 virtual void ReleaseTransactionElement( |
|
140 MTransactionElement* aElement ) = 0; |
|
141 |
|
142 /** |
|
143 * Checks if given content type is supported by target element. |
|
144 * |
|
145 * @param aTarget the target UI element. |
|
146 * @param aContentType the content type |
|
147 * @return ETrue if content type is supported, otherwise EFalse. |
|
148 */ |
|
149 virtual TBool IsSupported( |
|
150 CXnNodeAppIf& aTarget, const TDesC8& aContentType ) = 0; |
|
151 |
|
152 protected: |
|
153 |
|
154 ~MTransactionFactory(){}; |
|
155 }; |
|
156 |
|
157 } // namespace AiXmlUiController |
|
158 |
|
159 #endif // M_TRANSACTIONFACTORY_H |
|
160 |
|
161 // End of File |