25 #else |
25 #else |
26 #include <mtmdef.hrh> //kuidmtmquerymaxbodysizevalue etc |
26 #include <mtmdef.hrh> //kuidmtmquerymaxbodysizevalue etc |
27 #include <mtmuidsdef.hrh> //kuidmtmquerymaxbodysizevalue etc |
27 #include <mtmuidsdef.hrh> //kuidmtmquerymaxbodysizevalue etc |
28 #endif |
28 #endif |
29 #include <msvuids.h> |
29 #include <msvuids.h> |
30 #include <Obexutils.rsg> |
|
31 #include <obexutilsmessagehandler.h> |
30 #include <obexutilsmessagehandler.h> |
32 |
31 |
33 |
32 |
34 const TInt KBtMtmUiNfcContext = 2; |
33 // todo @ QT migration: take official definition from Messaging at app layer (btmsgtypeuid.h) |
|
34 const TUid KUidMsgTypeBt = {0x10009ED5}; |
35 |
35 |
36 // ================= MEMBER FUNCTIONS ======================= |
36 // ================= MEMBER FUNCTIONS ======================= |
37 |
37 |
38 // Two-phased constructor. |
38 // Two-phased constructor. |
39 CBtMtmUiData* CBtMtmUiData::NewL( CRegisteredMtmDll& aRegisteredDll ) |
39 CBtMtmUiData* CBtMtmUiData::NewL( CRegisteredMtmDll& aRegisteredDll ) |
76 // --------------------------------------------------------- |
76 // --------------------------------------------------------- |
77 // |
77 // |
78 TInt CBtMtmUiData::OperationSupportedL( TInt /*aOperationId*/, |
78 TInt CBtMtmUiData::OperationSupportedL( TInt /*aOperationId*/, |
79 const TMsvEntry& /*aContext*/) const |
79 const TMsvEntry& /*aContext*/) const |
80 { |
80 { |
81 FLOG( _L( " CBtMtmUiData: OperationSupportedL\t" ) ); |
81 FLOG( _L( " CBtMtmUiData: OperationSupportedL\t" ) ); |
82 return TObexUtilsUiLayer::OperationNotSupported(); |
82 |
|
83 //todo: This was returning avkon resource Id of sting "This item is not available". |
|
84 return 0; |
83 } |
85 } |
84 |
86 |
85 // --------------------------------------------------------- |
87 // --------------------------------------------------------- |
86 // QueryCapability(...) |
88 // QueryCapability(...) |
87 // MTM query capability |
89 // MTM query capability |
126 // --------------------------------------------------------- |
128 // --------------------------------------------------------- |
127 // CBitmapArray& CBtMtmUiData::ContextIcon(...) |
129 // CBitmapArray& CBtMtmUiData::ContextIcon(...) |
128 // Handles received msg icon. |
130 // Handles received msg icon. |
129 // --------------------------------------------------------- |
131 // --------------------------------------------------------- |
130 // |
132 // |
131 const CBaseMtmUiData::CBitmapArray& CBtMtmUiData::ContextIcon( const TMsvEntry& aContext, |
133 const CBaseMtmUiData::CBitmapArray& CBtMtmUiData::ContextIcon( const TMsvEntry& /*aContext*/, |
132 TInt /*aStateFlags*/) const |
134 TInt /*aStateFlags*/) const |
133 { |
135 { |
134 // Check if NFC context |
136 // Check if NFC context |
135 TInt icon = 0; |
137 TInt icon = 0; |
136 if ( aContext.MtmData1() == KBtMtmUiNfcContext ) |
138 //todo: This function will not work as iIconArrays is not populated might cause panic. |
137 { |
139 return *iIconArrays->At(icon); |
138 icon = TObexUtilsUiLayer::ContextIcon( aContext, ENfc ); |
|
139 } |
|
140 else |
|
141 { |
|
142 icon = TObexUtilsUiLayer::ContextIcon( aContext, EBluetooth ); |
|
143 } |
|
144 |
|
145 return *iIconArrays->At( icon/2 ); |
|
146 } |
140 } |
147 |
141 |
148 // --------------------------------------------------------- |
142 // --------------------------------------------------------- |
149 // PopulateArraysL() |
143 // PopulateArraysL() |
150 // Populates bitmap array |
144 // Populates bitmap array |
151 // --------------------------------------------------------- |
145 // --------------------------------------------------------- |
152 // |
146 // |
153 void CBtMtmUiData::PopulateArraysL() |
147 void CBtMtmUiData::PopulateArraysL() |
154 { |
148 { |
155 FLOG( _L( " CBtMtmUiData: PopulateArraysL\t" ) ); |
149 FLOG( _L( " CBtMtmUiData: PopulateArraysL\t" ) ); |
156 TObexUtilsUiLayer::CreateIconsL( KUidMsgTypeBt, iIconArrays ); |
150 //todo: Was populating iIconArrays which should be removed. |
157 } |
151 } |
158 |
152 |
159 // --------------------------------------------------------- |
153 // --------------------------------------------------------- |
160 // GetResourceFileName(TFileName& aFileName) const |
154 // GetResourceFileName(TFileName& aFileName) const |
161 // Gives resource filename. |
155 // Gives resource filename. |
162 // --------------------------------------------------------- |
156 // --------------------------------------------------------- |
163 // |
157 // |
164 void CBtMtmUiData::GetResourceFileName( TFileName& aFileName ) const |
158 void CBtMtmUiData::GetResourceFileName( TFileName& /*aFileName*/ ) const |
165 { |
159 { |
166 FLOG( _L( " CBtMtmUiData: GetResourceFileName\t" ) ); |
160 FLOG( _L( " CBtMtmUiData: GetResourceFileName\t" ) ); |
167 aFileName = KObexUtilsFileDrive; |
161 //todo: This was returning avkon resource file, which is not required now. |
168 aFileName += KDC_RESOURCE_FILES_DIR; |
|
169 aFileName += KObexUtilsResourceFileName; |
|
170 } |
162 } |
171 |
163 |
172 // --------------------------------------------------------- |
164 // --------------------------------------------------------- |
173 // CanCreateEntryL(...) |
165 // CanCreateEntryL(...) |
174 // Checks if it is possible to create entry. |
166 // Checks if it is possible to create entry. |
184 { |
176 { |
185 // --- Can create messages in local folders --- |
177 // --- Can create messages in local folders --- |
186 return ( aParent.iMtm.iUid == KMsvLocalServiceIndexEntryIdValue ); |
178 return ( aParent.iMtm.iUid == KMsvLocalServiceIndexEntryIdValue ); |
187 } |
179 } |
188 // --- Can't create other types --- |
180 // --- Can't create other types --- |
189 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
181 //todo: This was using avkon resource Id of sting "This item is not available". |
|
182 aReasonResourceId = 0; |
190 return EFalse; |
183 return EFalse; |
191 } |
184 } |
192 |
185 |
193 // --------------------------------------------------------- |
186 // --------------------------------------------------------- |
194 // CanOpenEntryL(...) |
187 // CanOpenEntryL(...) |
260 // |
256 // |
261 TBool CBtMtmUiData::CanEditEntryL( const TMsvEntry& aContext, |
257 TBool CBtMtmUiData::CanEditEntryL( const TMsvEntry& aContext, |
262 TInt& aReasonResourceId ) const |
258 TInt& aReasonResourceId ) const |
263 { |
259 { |
264 FLOG( _L( " CBtMtmUiData: CanEditEntryL\t" ) ); |
260 FLOG( _L( " CBtMtmUiData: CanEditEntryL\t" ) ); |
265 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
261 //todo: This was using avkon resource Id of sting "This item is not available". |
|
262 aReasonResourceId = 0; |
266 if( CheckEntry( aContext ) ) |
263 if( CheckEntry( aContext ) ) |
267 { |
264 { |
268 if ( ( aContext.iType.iUid == KUidMsvMessageEntryValue ) || |
265 if ( ( aContext.iType.iUid == KUidMsvMessageEntryValue ) || |
269 ( aContext.iType.iUid == KUidMsvFolderEntryValue ) ) |
266 ( aContext.iType.iUid == KUidMsvFolderEntryValue ) ) |
270 { |
267 { |
281 // --------------------------------------------------------- |
278 // --------------------------------------------------------- |
282 // |
279 // |
283 TBool CBtMtmUiData::CanDeleteServiceL( const TMsvEntry& /*aService*/, |
280 TBool CBtMtmUiData::CanDeleteServiceL( const TMsvEntry& /*aService*/, |
284 TInt& aReasonResourceId ) const |
281 TInt& aReasonResourceId ) const |
285 { |
282 { |
286 FLOG( _L( " CBtMtmUiData: CanDeleteServiceL\t" ) ); |
283 FLOG( _L( " CBtMtmUiData: CanDeleteServiceL\t" ) ); |
287 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
284 //todo: This was using avkon resource Id of sting "This item is not available". |
|
285 aReasonResourceId = 0; |
288 return EFalse; |
286 return EFalse; |
289 } |
287 } |
290 |
288 |
291 // --------------------------------------------------------- |
289 // --------------------------------------------------------- |
292 // CanDeleteFromEntryL(...) |
290 // CanDeleteFromEntryL(...) |
294 // --------------------------------------------------------- |
292 // --------------------------------------------------------- |
295 // |
293 // |
296 TBool CBtMtmUiData::CanDeleteFromEntryL( const TMsvEntry& /*aContext*/, |
294 TBool CBtMtmUiData::CanDeleteFromEntryL( const TMsvEntry& /*aContext*/, |
297 TInt& aReasonResourceId ) const |
295 TInt& aReasonResourceId ) const |
298 { |
296 { |
299 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
297 //todo: This was using avkon resource Id of sting "This item is not available". |
|
298 aReasonResourceId = 0; |
300 return EFalse; |
299 return EFalse; |
301 } |
300 } |
302 |
301 |
303 // --------------------------------------------------------- |
302 // --------------------------------------------------------- |
304 // CanCopyMoveToEntryL(...) |
303 // CanCopyMoveToEntryL(...) |
306 // --------------------------------------------------------- |
305 // --------------------------------------------------------- |
307 // |
306 // |
308 TBool CBtMtmUiData::CanCopyMoveToEntryL( const TMsvEntry& /*aContext*/, |
307 TBool CBtMtmUiData::CanCopyMoveToEntryL( const TMsvEntry& /*aContext*/, |
309 TInt& aReasonResourceId ) const |
308 TInt& aReasonResourceId ) const |
310 { |
309 { |
311 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
310 //todo: This was using avkon resource Id of sting "This item is not available". |
|
311 aReasonResourceId = 0; |
312 return EFalse; |
312 return EFalse; |
313 } |
313 } |
314 |
314 |
315 // --------------------------------------------------------- |
315 // --------------------------------------------------------- |
316 // CanCopyMoveFromEntryL(...) |
316 // CanCopyMoveFromEntryL(...) |
318 // --------------------------------------------------------- |
318 // --------------------------------------------------------- |
319 // |
319 // |
320 TBool CBtMtmUiData::CanCopyMoveFromEntryL( const TMsvEntry& /*aContext*/, |
320 TBool CBtMtmUiData::CanCopyMoveFromEntryL( const TMsvEntry& /*aContext*/, |
321 TInt& aReasonResourceId ) const |
321 TInt& aReasonResourceId ) const |
322 { |
322 { |
323 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
323 //todo: This was using avkon resource Id of sting "This item is not available". |
|
324 aReasonResourceId = 0; |
324 return EFalse; |
325 return EFalse; |
325 } |
326 } |
326 |
327 |
327 // --------------------------------------------------------- |
328 // --------------------------------------------------------- |
328 // CanReplyToEntryL(...) |
329 // CanReplyToEntryL(...) |
330 // --------------------------------------------------------- |
331 // --------------------------------------------------------- |
331 // |
332 // |
332 TBool CBtMtmUiData::CanReplyToEntryL( const TMsvEntry& /*aContext*/, |
333 TBool CBtMtmUiData::CanReplyToEntryL( const TMsvEntry& /*aContext*/, |
333 TInt& aReasonResourceId ) const |
334 TInt& aReasonResourceId ) const |
334 { |
335 { |
335 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
336 //todo: This was using avkon resource Id of sting "This item is not available". |
|
337 aReasonResourceId = 0; |
336 return EFalse; // Not Ok to do |
338 return EFalse; // Not Ok to do |
337 } |
339 } |
338 |
340 |
339 // --------------------------------------------------------- |
341 // --------------------------------------------------------- |
340 // CanForwardEntryL(...) |
342 // CanForwardEntryL(...) |
342 // --------------------------------------------------------- |
344 // --------------------------------------------------------- |
343 // |
345 // |
344 TBool CBtMtmUiData::CanForwardEntryL( const TMsvEntry& /*aContext*/, |
346 TBool CBtMtmUiData::CanForwardEntryL( const TMsvEntry& /*aContext*/, |
345 TInt& aReasonResourceId ) const |
347 TInt& aReasonResourceId ) const |
346 { |
348 { |
347 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
349 //todo: This was using avkon resource Id of sting "This item is not available". |
|
350 aReasonResourceId = 0; |
348 return EFalse; // Not Ok to do |
351 return EFalse; // Not Ok to do |
349 } |
352 } |
350 |
353 |
351 // --------------------------------------------------------- |
354 // --------------------------------------------------------- |
352 // CheckEntry(...) |
355 // CheckEntry(...) |
366 // |
369 // |
367 TBool CBtMtmUiData::CanCancelL( const TMsvEntry& /*aContext*/, |
370 TBool CBtMtmUiData::CanCancelL( const TMsvEntry& /*aContext*/, |
368 TInt& aReasonResourceId ) const |
371 TInt& aReasonResourceId ) const |
369 { |
372 { |
370 // No way of sending a message from the outbox, so no need to cancel. |
373 // No way of sending a message from the outbox, so no need to cancel. |
371 aReasonResourceId = TObexUtilsUiLayer::OperationNotSupported(); |
374 //todo: This was using avkon resource Id of sting "This item is not available". |
|
375 aReasonResourceId = 0; |
372 return EFalse; |
376 return EFalse; |
373 } |
377 } |
374 |
378 |
375 // --------------------------------------------------------- |
379 // --------------------------------------------------------- |
376 // StatusTextL(...) |
380 // StatusTextL(...) |