meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp
branchRCL_3
changeset 22 d620048b4810
parent 18 6b8f3b30d0ec
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
   118         iObserver->HideControl( FieldId() );
   118         iObserver->HideControl( FieldId() );
   119         }
   119         }
   120     else
   120     else
   121         {
   121         {
   122         iRichTextViewer->SetTextL( &text, ETrue );
   122         iRichTextViewer->SetTextL( &text, ETrue );
       
   123         iRichTextViewer->ApplyLayoutChangesL();
   123         }
   124         }
   124 
   125 
   125     // If the geo value has set, the waypoint icon has to be shown on right
   126     // If the geo value has set, the waypoint icon has to be shown on right
   126     // side of the location field
   127     // side of the location field
   127     CCalGeoValue* geoValue = aEntry.Entry().GeoValueL();
   128     CCalGeoValue* geoValue = aEntry.Entry().GeoValueL();
   128     TReal dummy;
   129     TReal dummy;
   129     if( !iLocked )
   130     if( !iLocked )
   130     	{
   131     	{
   131     	if( geoValue && geoValue->GetLatLong( dummy, dummy ) )
   132     	if( geoValue && geoValue->GetLatLong( dummy, dummy ) )
   132     		{
   133     		{
   133     		iWaypointIcon =
   134     		iWaypointIcon = CMRImage::NewL(
   134     		CMRImage::NewL( NMRBitmapManager::EMRBitmapLocationWaypoint, ETrue );
   135     		        NMRBitmapManager::EMRBitmapLocationWaypoint,
   135     		iWaypointIcon->SetParent( this );
   136     		        this,
       
   137     		        ETrue );
   136     		}
   138     		}
   137     	}
   139     	}
   138     }
   140     }
   139 
   141 
   140 // ---------------------------------------------------------------------------
   142 // ---------------------------------------------------------------------------
   161     iSize = aSize;
   163     iSize = aSize;
   162 
   164 
   163     if ( iObserver && aEdwin == iRichTextViewer )
   165     if ( iObserver && aEdwin == iRichTextViewer )
   164         {
   166         {
   165         iObserver->ControlSizeChanged( this );
   167         iObserver->ControlSizeChanged( this );
       
   168         RecordField();
   166         reDraw = ETrue;
   169         reDraw = ETrue;
   167         }
   170         }
   168 
   171 
   169     return reDraw;
   172     return reDraw;
   170     }
   173     }
   183 // CESMRViewerLocationField::ConstructL()
   186 // CESMRViewerLocationField::ConstructL()
   184 // ---------------------------------------------------------------------------
   187 // ---------------------------------------------------------------------------
   185 //
   188 //
   186 void CESMRViewerLocationField::ConstructL( )
   189 void CESMRViewerLocationField::ConstructL( )
   187     {
   190     {
   188 	iFieldButton = CMRButton::NewL( NMRBitmapManager::EMRBitmapLocation );
   191 	iFieldButton = CMRButton::NewL(
   189     iFieldButton->SetParent( this );
   192 	        NMRBitmapManager::EMRBitmapLocation,
       
   193 	        this );
   190     iFieldButton->SetObserver(this);
   194     iFieldButton->SetObserver(this);
   191 
   195 
   192     iRichTextViewer = CESMRRichTextViewer::NewL( this );
   196     iRichTextViewer = CESMRRichTextViewer::NewL( this );
   193     CESMRField::ConstructL( iRichTextViewer ); // ownership transfered
   197     CESMRField::ConstructL( iRichTextViewer ); // ownership transfered
   194     iRichTextViewer->SetEdwinSizeObserver( this );
   198     iRichTextViewer->SetEdwinSizeObserver( this );
   275     delete iWaypointIcon;
   279     delete iWaypointIcon;
   276     iWaypointIcon = NULL;
   280     iWaypointIcon = NULL;
   277 
   281 
   278     if ( aEnabled )
   282     if ( aEnabled )
   279         {
   283         {
   280         iWaypointIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLocationWaypoint, ETrue );
   284         iWaypointIcon = CMRImage::NewL(
   281         iWaypointIcon->SetParent( this );
   285                 NMRBitmapManager::EMRBitmapLocationWaypoint,
       
   286                 this,
       
   287                 ETrue );
   282         }
   288         }
   283 
   289 
   284     // Relayout
   290     // Relayout
   285     SizeChanged();
   291     SizeChanged();
       
   292     
       
   293     if ( !iOutlineFocus )
       
   294         {
       
   295         RecordField();
       
   296         }
   286     }
   297     }
   287 
   298 
   288 // ---------------------------------------------------------------------------
   299 // ---------------------------------------------------------------------------
   289 // CESMRViewerLocationField::CountComponentControls
   300 // CESMRViewerLocationField::CountComponentControls
   290 // ---------------------------------------------------------------------------
   301 // ---------------------------------------------------------------------------
   409             }
   420             }
   410         }
   421         }
   411     }
   422     }
   412 
   423 
   413 // ---------------------------------------------------------------------------
   424 // ---------------------------------------------------------------------------
   414 // CESMRViewerLocationField::SetContainerWindowL
       
   415 // ---------------------------------------------------------------------------
       
   416 //
       
   417 void CESMRViewerLocationField::SetContainerWindowL(
       
   418         const CCoeControl& aContainer )
       
   419     {
       
   420     CCoeControl::SetContainerWindowL( aContainer );
       
   421     iRichTextViewer->SetContainerWindowL( aContainer );
       
   422     iRichTextViewer->SetParent( this );
       
   423     iFieldButton->SetContainerWindowL( aContainer );
       
   424     iFieldButton->SetParent( this );
       
   425     }
       
   426 
       
   427 // ---------------------------------------------------------------------------
       
   428 // CESMRViewerLocationField::HandleLongtapEventL
   425 // CESMRViewerLocationField::HandleLongtapEventL
   429 // ---------------------------------------------------------------------------
   426 // ---------------------------------------------------------------------------
   430 //
   427 //
   431 void CESMRViewerLocationField::HandleLongtapEventL(
   428 void CESMRViewerLocationField::HandleLongtapEventL(
   432         const TPoint& aPosition )
   429         const TPoint& aPosition )
   484 
   481 
   485 	CESMRField::LockL();
   482 	CESMRField::LockL();
   486 
   483 
   487 	delete iWaypointIcon;
   484 	delete iWaypointIcon;
   488 	iWaypointIcon = NULL;
   485 	iWaypointIcon = NULL;
   489 	iWaypointIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
   486 	iWaypointIcon = CMRImage::NewL(
   490 
   487 	        NMRBitmapManager::EMRBitmapLockField,
   491 	iWaypointIcon->SetParent( this );
   488 	        this,
       
   489 	        ETrue );
       
   490 
   492 	iWaypointIcon->SetObserver( this );
   491 	iWaypointIcon->SetObserver( this );
   493 	}
   492 	}
   494 
   493 
   495 // ---------------------------------------------------------------------------
   494 // ---------------------------------------------------------------------------
   496 // CESMRViewerLocationField::GetCursorLineVerticalPos
   495 // CESMRViewerLocationField::GetCursorLineVerticalPos