|
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 */ |
|
68 virtual MTransactionElement* |
|
69 CreateTextTransactionElementL( CXnNodeAppIf& aTarget, |
|
70 const TDesC& aText, |
|
71 TInt aPriority ) = 0; |
|
72 |
|
73 /** |
|
74 * Creates a new data buffer transaction element. |
|
75 * |
|
76 * @param aTarget the traget node of the transaction element |
|
77 * @param aData the data to update |
|
78 */ |
|
79 virtual MTransactionElement* |
|
80 CreateDataBufferTransactionElementL( CXnNodeAppIf& aTarget, |
|
81 const TDesC8& aData, |
|
82 TInt aPriority ) = 0; |
|
83 |
|
84 /** |
|
85 * Creates a new empty content transaction element. |
|
86 * |
|
87 * @param aTarget the target node of the transaction element |
|
88 * @param aText the text to update |
|
89 */ |
|
90 virtual MTransactionElement* |
|
91 CreateEmptyContentTransactionElementL( CXnNodeAppIf& aTarget, |
|
92 TInt aIndex ) = 0; |
|
93 |
|
94 /** |
|
95 * Creates a new image transaction element. |
|
96 * |
|
97 * @param aTarget the target node of the transaction element |
|
98 * @param aIcon the icon to update. Ownership transferred. |
|
99 */ |
|
100 virtual MTransactionElement* |
|
101 CreateImageTransactionElementL( CXnNodeAppIf& aTarget, |
|
102 CGulIcon* aIcon, |
|
103 TInt aPriority ) = 0; |
|
104 |
|
105 /** |
|
106 * Creates a new image transaction element. |
|
107 * |
|
108 * @param aTarget the target node of the transaction element |
|
109 * @param aFile the file to read image data from. |
|
110 */ |
|
111 virtual MTransactionElement* |
|
112 CreateImageTransactionElementL( CXnNodeAppIf& aTarget, |
|
113 RFile& aFile, |
|
114 TInt aPriority ) = 0; |
|
115 |
|
116 /** |
|
117 * Releases a transaction element. |
|
118 * |
|
119 * @param aElement the element to release. |
|
120 */ |
|
121 virtual void ReleaseTransactionElement( |
|
122 MTransactionElement* aElement ) = 0; |
|
123 |
|
124 /** |
|
125 * Checks if given content type is supported by target element. |
|
126 * |
|
127 * @param aTarget the target UI element. |
|
128 * @param aContentType the content type |
|
129 * @return ETrue if content type is supported, otherwise EFalse. |
|
130 */ |
|
131 virtual TBool IsSupported( CXnNodeAppIf& aTarget, |
|
132 const TDesC8& aContentType ) = 0; |
|
133 |
|
134 protected: |
|
135 |
|
136 ~MTransactionFactory(){}; |
|
137 |
|
138 }; |
|
139 |
|
140 } // namespace AiXmlUiController |
|
141 |
|
142 #endif // M_TRANSACTIONFACTORY_H |
|
143 |
|
144 // End of File |