|
1 /* |
|
2 * Copyright (c) {Year(s)} {Copyright owner}. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * {Name} {Company} ? Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * {Name} {Company} ? {{Description of contribution}} |
|
14 * |
|
15 * Description: |
|
16 * {{Description of the file}} |
|
17 * |
|
18 */ |
|
19 |
|
20 // System includes |
|
21 |
|
22 // User includes |
|
23 #include "hspublisherimpl.h" |
|
24 #include "hspublisher.h" |
|
25 |
|
26 // Constants |
|
27 |
|
28 |
|
29 // ============================= LOCAL FUNCTIONS =============================== |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CHsPublisher::NewLC() |
|
34 // Two-phased constructor |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CHsPublisher* CHsPublisher::NewLC( MHsWidgetObserver& aObserver, |
|
38 TBool aEnablePersist ) |
|
39 { |
|
40 CHsPublisher* self = new ( ELeave ) CHsPublisher(); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL( aObserver, aEnablePersist ); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CHsPublisher::NewL() |
|
48 // Two-phased constructor |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 CHsPublisher* CHsPublisher::NewL( MHsWidgetObserver& aObserver, |
|
52 TBool aEnablePersist ) |
|
53 { |
|
54 CHsPublisher* self = CHsPublisher::NewLC( aObserver, aEnablePersist ); |
|
55 CleanupStack::Pop( self ); |
|
56 return self; |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CHsPublisher::CHsPublisher() |
|
61 // C++ default constructor |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 CHsPublisher::CHsPublisher() |
|
65 { |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CHsPublisher::ConstructL() |
|
70 // 2nd phase constructor |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 void CHsPublisher::ConstructL( MHsWidgetObserver& aObserver, |
|
74 TBool aEnablePersist ) |
|
75 { |
|
76 iImpl = CHsPublisherImpl::NewL( aObserver, aEnablePersist ); |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CHsPublisher::~CHsPublisher() |
|
81 // Destructor |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CHsPublisher::~CHsPublisher() |
|
85 { |
|
86 delete iImpl; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CHsPublisher::PublishText() |
|
91 // |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 TInt CHsPublisher::PublishText( const TDesC& aWidgetId, |
|
95 const TDesC8& aElementId, const TDesC& aText ) |
|
96 { |
|
97 TRAPD( err, iImpl->PublishTextL( aWidgetId, aElementId, aText ) ); |
|
98 |
|
99 return err; |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CHsPublisher::PublishImage() |
|
104 // |
|
105 // ----------------------------------------------------------------------------- |
|
106 // |
|
107 TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, |
|
108 const TDesC8& aElementId, const CFbsBitmap* aImage, const CFbsBitmap* aMask ) |
|
109 { |
|
110 TRAPD( err, iImpl->PublishImageL( aWidgetId, aElementId, aImage, aMask ) ); |
|
111 |
|
112 return err; |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CHsPublisher::PublishImage() |
|
117 // |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, |
|
121 const TDesC8& aElementId, TInt aImageHandle, TInt aMaskHandle ) |
|
122 { |
|
123 TRAPD( err, iImpl->PublishImageL( |
|
124 aWidgetId, aElementId, aImageHandle, aMaskHandle ) ); |
|
125 |
|
126 return err; |
|
127 } |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // CHsPublisher::PublishImage() |
|
131 // |
|
132 // ----------------------------------------------------------------------------- |
|
133 // |
|
134 TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, |
|
135 const TDesC8& aElementId, const TDesC& aSource ) |
|
136 { |
|
137 TRAPD( err, iImpl->PublishImageL( aWidgetId, aElementId, aSource ) ); |
|
138 |
|
139 return err; |
|
140 } |
|
141 |
|
142 // ----------------------------------------------------------------------------- |
|
143 // CHsPublisher::PublishStream() |
|
144 // |
|
145 // ----------------------------------------------------------------------------- |
|
146 // |
|
147 TInt CHsPublisher::PublishStream( const TDesC& aWidgetId, |
|
148 const TDesC8& aElementId, const TDesC8& aStream ) |
|
149 { |
|
150 TRAPD( err, iImpl->PublishStreamL( aWidgetId, aElementId, aStream ) ); |
|
151 |
|
152 return err; |
|
153 } |
|
154 |
|
155 // ----------------------------------------------------------------------------- |
|
156 // CHsPublisher::CleanText() |
|
157 // |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 TInt CHsPublisher::CleanText( const TDesC& aWidgetId, |
|
161 const TDesC8& aElementId ) |
|
162 { |
|
163 TRAPD( err, iImpl->CleanTextL( aWidgetId, aElementId ) ); |
|
164 |
|
165 return err; |
|
166 } |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CHsPublisher::CleanImage() |
|
170 // |
|
171 // ----------------------------------------------------------------------------- |
|
172 // |
|
173 TInt CHsPublisher::CleanImage( const TDesC& aWidgetId, |
|
174 const TDesC8& aElementId ) |
|
175 { |
|
176 TRAPD( err, iImpl->CleanImageL( aWidgetId, aElementId ) ); |
|
177 |
|
178 return err; |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CHsPublisher::StartTransaction() |
|
183 // |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 TInt CHsPublisher::StartTransaction( const TDesC& aWidgetId ) |
|
187 { |
|
188 TRAPD( err, iImpl->StartTransactionL( aWidgetId ) ); |
|
189 |
|
190 return err; |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // CHsPublisher::CommitTransaction() |
|
195 // |
|
196 // ----------------------------------------------------------------------------- |
|
197 // |
|
198 TInt CHsPublisher::CommitTransaction( const TDesC& aWidgetId ) |
|
199 { |
|
200 TRAPD( err, iImpl->CommitTransactionL( aWidgetId ) ); |
|
201 |
|
202 return err; |
|
203 } |
|
204 |
|
205 // End of file |