236 align.SetHAlignment( EHLeft ); |
236 align.SetHAlignment( EHLeft ); |
237 align.SetVAlignment( EVCenter ); |
237 align.SetVAlignment( EVCenter ); |
238 iCalenName->SetAlignment( align ); |
238 iCalenName->SetAlignment( align ); |
239 |
239 |
240 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapCalendarSelection ); |
240 iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapCalendarSelection ); |
241 |
241 |
242 } |
242 } |
243 |
243 |
244 // --------------------------------------------------------------------------- |
244 // --------------------------------------------------------------------------- |
245 // CMRMultiCalenField::UpdateLabelL |
245 // CMRMultiCalenField::UpdateLabelL |
246 // --------------------------------------------------------------------------- |
246 // --------------------------------------------------------------------------- |
322 TAknLayoutRect iconLayout = |
322 TAknLayoutRect iconLayout = |
323 NMRLayoutManager::GetLayoutRect( |
323 NMRLayoutManager::GetLayoutRect( |
324 rect, NMRLayoutManager::EMRLayoutTextEditorIcon ); |
324 rect, NMRLayoutManager::EMRLayoutTextEditorIcon ); |
325 TRect iconRect( iconLayout.Rect() ); |
325 TRect iconRect( iconLayout.Rect() ); |
326 iIcon->SetRect( iconRect ); |
326 iIcon->SetRect( iconRect ); |
327 |
327 |
328 // Layouting lock icon |
328 // Layouting lock icon |
329 TAknLayoutRect rowLayoutRect( |
329 TAknLayoutRect rowLayoutRect( |
330 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); |
330 NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) ); |
331 TRect rowRect( rowLayoutRect.Rect() ); |
331 TRect rowRect( rowLayoutRect.Rect() ); |
332 if( iLockIcon ) |
332 if( iLockIcon ) |
333 { |
333 { |
334 TAknWindowComponentLayout iconLayout( |
334 TAknWindowComponentLayout iconLayout( |
335 NMRLayoutManager::GetWindowComponentLayout( |
335 NMRLayoutManager::GetWindowComponentLayout( |
336 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
336 NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) ); |
337 AknLayoutUtils::LayoutImage( iLockIcon, rowRect, iconLayout ); |
337 AknLayoutUtils::LayoutImage( iLockIcon, rowRect, iconLayout ); |
338 } |
338 } |
339 |
339 |
340 // Layouting label |
340 // Layouting label |
341 TAknLayoutText viewerLayoutText; |
341 TAknTextComponentLayout viewerLayoutText; |
342 if( iLockIcon ) |
342 if( iLockIcon ) |
343 { |
343 { |
344 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
344 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
345 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
345 NMRLayoutManager::EMRTextLayoutSingleRowEditorText ); |
346 } |
346 } |
347 else |
347 else |
348 { |
348 { |
349 viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, |
349 viewerLayoutText = NMRLayoutManager::GetTextComponentLayout( |
350 NMRLayoutManager::EMRTextLayoutTextEditor ); |
350 NMRLayoutManager::EMRTextLayoutTextEditor ); |
351 } |
351 } |
352 |
352 |
353 TRect viewerRect( viewerLayoutText.TextRect() ); |
353 AknLayoutUtils::LayoutLabel( iCalenName, rect, viewerLayoutText ); |
354 iCalenName->SetRect( viewerRect ); |
354 TRect viewerRect( iCalenName->Rect() ); |
355 |
355 |
356 // Move focus rect so that it's relative to field's position. |
356 // Move focus rect so that it's relative to field's position. |
357 viewerRect.Move( -Position() ); |
357 viewerRect.Move( -Position() ); |
358 |
358 |
359 TAknLayoutRect bgLayoutRect = |
359 TAknLayoutRect bgLayoutRect = |
360 NMRLayoutManager::GetLayoutRect( |
360 NMRLayoutManager::GetLayoutRect( |
361 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
361 rect, NMRLayoutManager::EMRLayoutTextEditorBg ); |
362 TRect bgRect( bgLayoutRect.Rect() ); |
362 TRect bgRect( bgLayoutRect.Rect() ); |
363 |
363 |
364 // Adjust background rect according to viewerRect |
364 // Adjust background rect according to viewerRect |
365 bgRect.SetWidth( viewerRect.Width() ); |
365 bgRect.SetWidth( viewerRect.Width() ); |
366 |
366 |
367 // Move focus rect so that it's relative to field's position. |
367 // Move focus rect so that it's relative to field's position. |
368 bgRect.Move( -Position() ); |
368 bgRect.Move( -Position() ); |
369 |
369 |
370 SetFocusRect( bgRect ); |
370 SetFocusRect( bgRect ); |
371 } |
371 } |
372 |
372 |
373 // --------------------------------------------------------------------------- |
373 // --------------------------------------------------------------------------- |
374 // CMRMultiCalenField::SetContainerWindowL |
374 // CMRMultiCalenField::SetContainerWindowL |
390 // --------------------------------------------------------------------------- |
390 // --------------------------------------------------------------------------- |
391 // |
391 // |
392 void CMRMultiCalenField::SetTextDimmed() |
392 void CMRMultiCalenField::SetTextDimmed() |
393 { |
393 { |
394 FUNC_LOG; |
394 FUNC_LOG; |
395 |
395 |
396 NMRColorManager::SetColor( |
396 NMRColorManager::SetColor( |
397 *iCalenName, |
397 *iCalenName, |
398 NMRColorManager::EMRMainAreaTextColorDimmed ); |
398 NMRColorManager::EMRMainAreaTextColorDimmed ); |
399 } |
399 } |
400 |
400 |
401 // --------------------------------------------------------------------------- |
401 // --------------------------------------------------------------------------- |
402 // CMRMultiCalenField::TypeChangeEnabledL |
402 // CMRMultiCalenField::TypeChangeEnabledL |
403 // --------------------------------------------------------------------------- |
403 // --------------------------------------------------------------------------- |
404 // |
404 // |
405 TBool CMRMultiCalenField::TypeChangeEnabledL() |
405 TBool CMRMultiCalenField::TypeChangeEnabledL() |
406 { |
406 { |
407 TBool ret( ETrue ); |
407 TBool ret( ETrue ); |
408 |
408 |
409 /* |
409 /* |
410 * Case 1: |
410 * Case 1: |
411 * If entry is single occurancy of a series, calendar type change |
411 * If entry is single occurancy of a series, calendar type change |
412 * is disabled for the user. |
412 * is disabled for the user. |
413 */ |
413 */ |
414 if( iEntry->IsRecurrentEventL() && |
414 if( iEntry->IsRecurrentEventL() && |
415 iEntry->RecurrenceModRule() == MESMRCalEntry::EESMRThisOnly && |
415 iEntry->RecurrenceModRule() == MESMRCalEntry::EESMRThisOnly && |
416 FieldMode() == EESMRFieldModeEdit ) |
416 FieldMode() == EESMRFieldModeEdit ) |
417 { |
417 { |
418 ret = EFalse; |
418 ret = EFalse; |
419 } |
419 } |
420 |
420 |
421 /* |
421 /* |
422 * Case 2: |
422 * Case 2: |
423 * If entry is meeting request, and opened from mailbox that does not |
423 * If entry is meeting request, and opened from mailbox that does not |
424 * support multiple calendar, calendar type change is disabled |
424 * support multiple calendar, calendar type change is disabled |
425 * for the user. |
425 * for the user. |
426 */ |
426 */ |
427 if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && |
427 if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && |
428 FieldMode() == EESMRFieldModeEdit ) |
428 FieldMode() == EESMRFieldModeEdit ) |
429 { |
429 { |
430 MESMRMeetingRequestEntry* entry = |
430 MESMRMeetingRequestEntry* entry = |
431 static_cast< MESMRMeetingRequestEntry* >( iEntry ); |
431 static_cast< MESMRMeetingRequestEntry* >( iEntry ); |
432 |
432 |
433 // If entry's current plugin is active sync, it means that |
433 // If entry's current plugin is active sync, it means that |
434 // Mail For Exchange is in use. This means, that multiple calendar |
434 // Mail For Exchange is in use. This means, that multiple calendar |
435 // functionality is not supported. |
435 // functionality is not supported. |
436 if( entry->CurrentPluginL() == EESMRActiveSync ) |
436 if( entry->CurrentPluginL() == EESMRActiveSync ) |
437 { |
437 { |
438 ret = EFalse; |
438 ret = EFalse; |
439 } |
439 } |
440 } |
440 } |
441 |
441 |
442 /* |
442 /* |
443 * Case 3: |
443 * Case 3: |
444 * When the organizer of the MR edits an already sent MR, calendar |
444 * When the organizer of the MR edits an already sent MR, calendar |
445 * cannot be changed --> calendar selection needs to be locked. |
445 * cannot be changed --> calendar selection needs to be locked. |
446 */ |
446 */ |
447 if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && |
447 if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) && |
448 FieldMode() == EESMRFieldModeEdit ) |
448 FieldMode() == EESMRFieldModeEdit ) |
449 { |
449 { |
450 MESMRMeetingRequestEntry* entry = |
450 MESMRMeetingRequestEntry* entry = |
451 static_cast< MESMRMeetingRequestEntry* >( iEntry ); |
451 static_cast< MESMRMeetingRequestEntry* >( iEntry ); |
452 if( entry->RoleL() == EESMRRoleOrganizer && entry->IsSentL() ) |
452 if( entry->RoleL() == EESMRRoleOrganizer && entry->IsSentL() ) |
453 { |
453 { |
454 ret = EFalse; |
454 ret = EFalse; |
455 } |
455 } |
456 } |
456 } |
457 |
457 |
458 return ret; |
458 return ret; |
459 } |
459 } |
460 |
460 |
461 // EOF |
461 // EOF |
462 |
462 |