meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrsubjectfield.cpp
branchRCL_3
changeset 80 726fba06891a
parent 64 3533d4323edc
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
   139 
   139 
   140     TRect editorRect( NMRLayoutManager::GetLayoutText( 
   140     TRect editorRect( NMRLayoutManager::GetLayoutText( 
   141        fieldRect, 
   141        fieldRect, 
   142        NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() );
   142        NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() );
   143     
   143     
   144     if( iPriorityIcon )
   144     if( iPriorityIcon && ( iCurrentPriority != EFSCalenMRPriorityNormal ) )
   145         {
   145         {
   146 		editorRect = NMRLayoutManager::GetLayoutText( 
   146 		editorRect = NMRLayoutManager::GetLayoutText( 
   147 			   fieldRect, 
   147 			   fieldRect, 
   148 			   NMRLayoutManager::EMRTextLayoutSingleRowEditorText ).TextRect();
   148 			   NMRLayoutManager::EMRTextLayoutSingleRowEditorText ).TextRect();
   149         }
   149         }
   441     switch ( aIndex )
   441     switch ( aIndex )
   442         {
   442         {
   443         case 0:
   443         case 0:
   444             return iFieldIcon;
   444             return iFieldIcon;
   445         case 1:
   445         case 1:
   446             return iSubject;
   446         	if( iPriorityIcon )
       
   447         		{
       
   448         	    return iPriorityIcon;          
       
   449         		}
       
   450         	else
       
   451         		{
       
   452         	    return iSubject;                       
       
   453         		}
   447         case 2:
   454         case 2:
   448             return iPriorityIcon;
   455         	if( iPriorityIcon )
       
   456         		{
       
   457         	    return iSubject;       
       
   458         		}
   449         default:
   459         default:
   450             return NULL;
   460             return NULL;
   451         }
   461         }
   452     }
   462     }
   453 
   463 
   473         }
   483         }
   474     
   484     
   475     // Layouting priority icon
   485     // Layouting priority icon
   476     if( iPriorityIcon )
   486     if( iPriorityIcon )
   477         {
   487         {
   478         TAknWindowComponentLayout iconLayout( 
   488 		if( iCurrentPriority != EFSCalenMRPriorityNormal )
   479                 NMRLayoutManager::GetWindowComponentLayout( 
   489 			{
   480                     NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   490 			TAknWindowComponentLayout iconLayout(
   481         AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout );
   491 					NMRLayoutManager::GetWindowComponentLayout(
   482         }
   492 						NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
   483 
   493 			AknLayoutUtils::LayoutImage( iPriorityIcon, rowRect, iconLayout );
       
   494 			}
       
   495         }
       
   496 	else
       
   497 		{
       
   498 		delete iPriorityIcon;
       
   499 		iPriorityIcon = NULL;			
       
   500 		}
       
   501     
   484     TAknLayoutText editorLayoutText;
   502     TAknLayoutText editorLayoutText;
   485 
   503 
   486     if( iPriorityIcon )
   504     if( iPriorityIcon && ( iCurrentPriority != EFSCalenMRPriorityNormal ) )
   487         {
   505         {
   488         editorLayoutText = NMRLayoutManager::GetLayoutText( rowRect, 
   506         editorLayoutText = NMRLayoutManager::GetLayoutText( rowRect, 
   489                     NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   507                     NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
   490         }
   508         }
   491     else
   509     else
   509             editorRect.Size() );
   527             editorRect.Size() );
   510     
   528     
   511     // Move focus rect so that it's relative to field's position.
   529     // Move focus rect so that it's relative to field's position.
   512     bgRect.Move( -Position() );
   530     bgRect.Move( -Position() );
   513     SetFocusRect( bgRect );    
   531     SetFocusRect( bgRect );    
       
   532 
       
   533     if ( !iOutlineFocus )
       
   534         {
       
   535         RecordField();
       
   536         iObserver->RedrawField( *this );
       
   537         }
   514     }
   538     }
   515 
   539 
   516 // ---------------------------------------------------------------------------
   540 // ---------------------------------------------------------------------------
   517 // CESMRSubjectField::SetContainerWindowL
   541 // CESMRSubjectField::SetContainerWindowL
   518 // ---------------------------------------------------------------------------
   542 // ---------------------------------------------------------------------------
   555     {
   579     {
   556     switch ( aPriority )
   580     switch ( aPriority )
   557         {
   581         {
   558         case EFSCalenMRPriorityHigh:
   582         case EFSCalenMRPriorityHigh:
   559             {
   583             {
   560             delete iPriorityIcon;
   584             if( iPriorityIcon )
   561             iPriorityIcon = NULL;
   585             	{
       
   586 				delete iPriorityIcon;
       
   587 				iPriorityIcon = NULL;
       
   588             	}
   562             
   589             
   563             iPriorityIcon = CMRImage::NewL( 
   590             iPriorityIcon = CMRImage::NewL( 
   564                   NMRBitmapManager::EMRBitmapPriorityHigh,
   591                   NMRBitmapManager::EMRBitmapPriorityHigh,
   565                   this,
   592                   this,
   566                   ETrue );
   593                   ETrue );
   567             iPriorityIcon->SetParent( this );
   594             iPriorityIcon->SetParent( this );
   568             if( iCurrentPriority == EFSCalenMRPriorityNormal )
   595             if( iCurrentPriority == EFSCalenMRPriorityNormal )
   569             	{
   596             	{
       
   597 				iCurrentPriority = EFSCalenMRPriorityHigh;
   570 				SizeChanged();
   598 				SizeChanged();
   571             	}
   599             	}
   572             iCurrentPriority = EFSCalenMRPriorityHigh;
   600             iCurrentPriority = EFSCalenMRPriorityHigh;
   573             break;
   601             break;
   574             }
   602             }
   585             break;
   613             break;
   586             }
   614             }
   587           
   615           
   588         case EFSCalenMRPriorityLow:
   616         case EFSCalenMRPriorityLow:
   589             {
   617             {
   590             delete iPriorityIcon;
   618             if( iPriorityIcon )
   591             iPriorityIcon = NULL;
   619             	{
       
   620 				delete iPriorityIcon;
       
   621 				iPriorityIcon = NULL;
       
   622             	}
   592             
   623             
   593             iPriorityIcon = CMRImage::NewL( 
   624             iPriorityIcon = CMRImage::NewL( 
   594                   NMRBitmapManager::EMRBitmapPriorityLow );
   625                   NMRBitmapManager::EMRBitmapPriorityLow );
   595             iPriorityIcon->SetParent( this );  
   626             iPriorityIcon->SetParent( this );  
   596             if( iCurrentPriority == EFSCalenMRPriorityNormal )
   627             if( iCurrentPriority == EFSCalenMRPriorityNormal )
   597 				{
   628 				{
       
   629 				iCurrentPriority = EFSCalenMRPriorityLow;
   598 				SizeChanged();
   630 				SizeChanged();
   599 				}
   631 				}
   600             iCurrentPriority = EFSCalenMRPriorityLow;
   632             iCurrentPriority = EFSCalenMRPriorityLow;
   601             break;
   633             break;
   602             }
   634             }