meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 16 b5fbb9b25d57
child 22 d620048b4810
equal deleted inserted replaced
17:67369d1b217f 18:6b8f3b30d0ec
   177                 iFilter.AppendL( event->Id() );
   177                 iFilter.AppendL( event->Id() );
   178                 }
   178                 }
   179             }
   179             }
   180         // resource reader
   180         // resource reader
   181         CleanupStack::PopAndDestroy(); // codescanner::cleanup
   181         CleanupStack::PopAndDestroy(); // codescanner::cleanup
   182         
   182 
   183         SetIconL( aEntry );
   183         SetIconL( aEntry );
   184         }
   184         }
   185     }
   185     }
   186 
   186 
   187 // ---------------------------------------------------------------------------
   187 // ---------------------------------------------------------------------------
   212        aCommand == EAknCmdOpen )
   212        aCommand == EAknCmdOpen )
   213         {
   213         {
   214         if( IsLocked() )
   214         if( IsLocked() )
   215         	{
   215         	{
   216 			HandleTactileFeedbackL();
   216 			HandleTactileFeedbackL();
   217 			
   217 
   218             CESMRGlobalNote::ExecuteL(
   218             CESMRGlobalNote::ExecuteL(
   219             		CESMRGlobalNote::EESMRUnableToEdit );
   219             		CESMRGlobalNote::EESMRUnableToEdit );
   220             isUsed = ETrue;            
   220             isUsed = ETrue;
   221         	}
   221         	}
   222         else
   222         else
   223         	{
   223         	{
   224 			HandleTactileFeedbackL();
   224 			HandleTactileFeedbackL();
   225 			
   225 
   226         	ExecuteTypeQueryL();
   226         	ExecuteTypeQueryL();
   227         	isUsed = ETrue;
   227         	isUsed = ETrue;
   228         	}        
   228         	}
   229         }
   229         }
   230     return isUsed;
   230     return isUsed;
   231     }
   231     }
   232 
   232 
   233 // ---------------------------------------------------------------------------
   233 // ---------------------------------------------------------------------------
   239 	FUNC_LOG;
   239 	FUNC_LOG;
   240 	if( IsLocked() )
   240 	if( IsLocked() )
   241 		{
   241 		{
   242 		return;
   242 		return;
   243 		}
   243 		}
   244 	
   244 
   245 	CESMRField::LockL();
   245 	CESMRField::LockL();
   246 	
   246 
   247 	delete iLockIcon;
   247 	delete iLockIcon;
   248 	iLockIcon = NULL;
   248 	iLockIcon = NULL;
   249 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   249 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   250 	iLockIcon->SetParent( this );
   250 	iLockIcon->SetParent( this );
   251 	}
   251 	}
   294 
   294 
   295     TGulAlignment align;
   295     TGulAlignment align;
   296     align.SetHAlignment( EHLeft );
   296     align.SetHAlignment( EHLeft );
   297     align.SetVAlignment( EVCenter );
   297     align.SetVAlignment( EVCenter );
   298     iType->SetAlignment( align );
   298     iType->SetAlignment( align );
   299     
   299 
   300     // An icon is required for layouting the field. Actual correct icon 
   300     // An icon is required for layouting the field. Actual correct icon
   301     // is set after InternalizeL.
   301     // is set after InternalizeL.
   302     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting );
   302     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting );
   303     }
   303     }
   304 
   304 
   305 // ---------------------------------------------------------------------------
   305 // ---------------------------------------------------------------------------
   329 
   329 
   330     if ( iType )
   330     if ( iType )
   331     	{
   331     	{
   332     	++count;
   332     	++count;
   333     	}
   333     	}
   334     
   334 
   335     if ( iLockIcon )
   335     if ( iLockIcon )
   336     	{
   336     	{
   337     	++count;
   337     	++count;
   338     	}
   338     	}
   339     return count;
   339     return count;
   384     iIcon->SetRect( iconLayout.Rect() );
   384     iIcon->SetRect( iconLayout.Rect() );
   385 
   385 
   386     // Layouting lock icon
   386     // Layouting lock icon
   387     if( iLockIcon )
   387     if( iLockIcon )
   388     	{
   388     	{
   389     	TAknWindowComponentLayout iconLayout( 
   389     	TAknWindowComponentLayout iconLayout(
   390     			NMRLayoutManager::GetWindowComponentLayout( 
   390     			NMRLayoutManager::GetWindowComponentLayout(
   391     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   391     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   392     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   392     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
   393     	}
   393     	}
   394         
   394 
   395     // Layouting label
   395     // Layouting label
   396     TAknLayoutText viewerLayoutText;
   396     TAknTextComponentLayout viewerLayoutText;
   397     if( iLockIcon )
   397     if( iLockIcon )
   398     	{
   398         {
   399     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   399         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   400     			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   400                 NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   401     	}
   401         }
   402     else
   402     else
   403     	{
   403         {
   404     	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
   404         viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
   405     			NMRLayoutManager::EMRTextLayoutTextEditor );
   405                 NMRLayoutManager::EMRTextLayoutTextEditor );
   406     	}
   406         }
   407 
   407 
   408     TRect viewerRect( viewerLayoutText.TextRect() );    
   408     AknLayoutUtils::LayoutLabel( iType, rect, viewerLayoutText );
   409     iType->SetRect( viewerRect );
   409     TRect viewerRect( iType->Rect() );
   410 
   410 
   411     // Move focus rect so that it's relative to field's position.
   411     // Move focus rect so that it's relative to field's position.
   412     viewerRect.Move( -Position() );
   412     viewerRect.Move( -Position() );
   413 
   413 
   414     TAknLayoutRect bgLayoutRect = 
   414     TAknLayoutRect bgLayoutRect =
   415         NMRLayoutManager::GetLayoutRect( 
   415         NMRLayoutManager::GetLayoutRect(
   416                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
   416                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
   417     TRect bgRect( bgLayoutRect.Rect() );
   417     TRect bgRect( bgLayoutRect.Rect() );
   418     
   418 
   419     // Adjust background rect according to viewerRect 
   419     // Adjust background rect according to viewerRect
   420     bgRect.SetWidth( viewerRect.Width() );
   420     bgRect.SetWidth( viewerRect.Width() );
   421     
   421 
   422     // Move focus rect so that it's relative to field's position.
   422     // Move focus rect so that it's relative to field's position.
   423     bgRect.Move( -Position() );
   423     bgRect.Move( -Position() );
   424         
   424 
   425     SetFocusRect( bgRect );
   425     SetFocusRect( bgRect );
   426     
   426 
   427         
   427 
   428     TAknTextComponentLayout editorLayout(
   428     TAknTextComponentLayout editorLayout(
   429     		NMRLayoutManager::GetTextComponentLayout(
   429     		NMRLayoutManager::GetTextComponentLayout(
   430     				NMRLayoutManager::EMRTextLayoutTextEditor ) );
   430     				NMRLayoutManager::EMRTextLayoutTextEditor ) );
   431     AknLayoutUtils::LayoutLabel( iType, rect, editorLayout );
   431     AknLayoutUtils::LayoutLabel( iType, rect, editorLayout );
   432     }
   432     }
   436 // ---------------------------------------------------------------------------
   436 // ---------------------------------------------------------------------------
   437 //
   437 //
   438 void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry )
   438 void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry )
   439     {
   439     {
   440     FUNC_LOG;
   440     FUNC_LOG;
   441     NMRBitmapManager::TMRBitmapId bitmapId( 
   441     NMRBitmapManager::TMRBitmapId bitmapId(
   442             NMRBitmapManager::EMRBitmapNotSet );
   442             NMRBitmapManager::EMRBitmapNotSet );
   443     
   443 
   444     CCalEntry& entry = aEntry.Entry();
   444     CCalEntry& entry = aEntry.Entry();
   445     
   445 
   446     switch ( entry.EntryTypeL() )
   446     switch ( entry.EntryTypeL() )
   447         {
   447         {
   448         case CCalEntry::EAppt:
   448         case CCalEntry::EAppt:
   449             {
   449             {
   450             if( CCalenInterimUtils2::IsMeetingRequestL( entry ) )
   450             if( CCalenInterimUtils2::IsMeetingRequestL( entry ) )