camerauis/cameraapp/generic/src/CamZoomPane.cpp
branchRCL_3
changeset 67 756ad29ed18e
parent 57 2c87b2808fd7
equal deleted inserted replaced
62:f0c0788c4de2 67:756ad29ed18e
   409     newThumbPos.iY = iTopPoint.iY + iMaxOffset -
   409     newThumbPos.iY = iTopPoint.iY + iMaxOffset -
   410              (pixelsFromBase + pixelsPerStep/2 +
   410              (pixelsFromBase + pixelsPerStep/2 +
   411               iIconZoomMarker[0]->SizeInPixels().iHeight * 
   411               iIconZoomMarker[0]->SizeInPixels().iHeight * 
   412               KDivisorFactor / 2) / KDivisorFactor;                                                        
   412               KDivisorFactor / 2) / KDivisorFactor;                                                        
   413         
   413         
   414     // Centralize thumb and slider X-axis.
       
   415     TRect old = TRect(newThumbPos,iIconZoomMarkerCurrent->SizeInPixels());
       
   416     newThumbPos.iX += iSliderParentRect.Center().iX - old.Center().iX;
       
   417 
       
   418     aGc.BitBlt( newThumbPos, iIconZoomMarkerCurrent ); 
   414     aGc.BitBlt( newThumbPos, iIconZoomMarkerCurrent ); 
   419     PRINT( _L( "Camera <= CCamZoomPane::DrawThumb " ) );                   
   415     PRINT( _L( "Camera <= CCamZoomPane::DrawThumb " ) );                   
   420     }
   416     }
   421 
   417 
   422 // -----------------------------------------------------------------------------
   418 // -----------------------------------------------------------------------------
   614     PRINT( _L( "Camera <= CCamZoomPane::HandleControllerEventL " ) );
   610     PRINT( _L( "Camera <= CCamZoomPane::HandleControllerEventL " ) );
   615     }
   611     }
   616 
   612 
   617 // -----------------------------------------------------------------------------
   613 // -----------------------------------------------------------------------------
   618 // CCamZoomPane::Rect
   614 // CCamZoomPane::Rect
   619 // Returns the whole zoom pane rect
   615 // Returns the zoom pane rect
   620 // -----------------------------------------------------------------------------
   616 // -----------------------------------------------------------------------------
   621 //
   617 //
   622 TRect CCamZoomPane::Extent() const
   618 TRect CCamZoomPane::Rect() const
   623     {
   619     {
   624     PRINT( _L( "Camera =><= CCamZoomPane::Extent " ) );
   620     PRINT( _L( "Camera =><= CCamZoomPane::Rect " ) );
   625     return iExtent;      
   621     return iZoomPaneRect;
   626     }
   622     }
   627 
   623 
   628 // ---------------------------------------------------------
   624 // ---------------------------------------------------------
   629 // CCamZoomPane::ReadLayoutL
   625 // CCamZoomPane::ReadLayoutL
   630 // ---------------------------------------------------------
   626 // ---------------------------------------------------------
   631 //
   627 //
   632 void CCamZoomPane::ReadLayoutL()
   628 void CCamZoomPane::ReadLayoutL()
   633     {   
   629     {   
   634     PRINT( _L( "Camera =><= CCamZoomPane::ReadLayoutL " ) );
   630     PRINT( _L( "Camera =><= CCamZoomPane::ReadLayoutL " ) );
   635     
   631     
   636     if ( AknLayoutUtils::PenEnabled() ) 
   632     if ( CamUtility::IsNhdDevice() ) 
   637         {
   633         {
   638         TouchLayout();
   634         TouchLayout();
   639         }
   635         }
   640     else
   636     else
   641         {
   637         {
  1066 // ---------------------------------------------------------
  1062 // ---------------------------------------------------------
  1067 //
  1063 //
  1068 void CCamZoomPane::SizeChanged() 
  1064 void CCamZoomPane::SizeChanged() 
  1069     {
  1065     {
  1070     PRINT( _L( "Camera => CCamZoomPane::SizeChanged" ) );
  1066     PRINT( _L( "Camera => CCamZoomPane::SizeChanged" ) );
  1071     if ( AknLayoutUtils::PenEnabled() ) 
  1067     if ( CamUtility::IsNhdDevice() ) 
  1072         {
  1068         {
  1073         TouchLayout();
  1069         TouchLayout();
  1074         }
  1070         }
  1075     else
  1071     else
  1076         {
  1072         {
  1100     iZoomPaneRect = area.Rect();
  1096     iZoomPaneRect = area.Rect();
  1101 
  1097 
  1102     l = AknLayoutScalable_Apps::cam4_zoom_cont_pane(variant); 
  1098     l = AknLayoutScalable_Apps::cam4_zoom_cont_pane(variant); 
  1103     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1099     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1104     iSliderParentRect = area.Rect();
  1100     iSliderParentRect = area.Rect();
  1105     iExtent = iSliderParentRect;
       
  1106     
  1101     
  1107     l = AknLayoutScalable_Apps::cam4_zoom_pane_g1(variant); // +
  1102     l = AknLayoutScalable_Apps::cam4_zoom_pane_g1(variant); // +
  1108     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1103     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1109     AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), 
  1104     AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), 
  1110                            EAspectRatioNotPreserved );
  1105                            EAspectRatioNotPreserved );
  1111     iPlusPoint = area.Rect().iTl;   
  1106     iPlusPoint = area.Rect().iTl;                       
  1112     iExtent.BoundingRect(area.Rect());
       
  1113     
  1107     
  1114     l = AknLayoutScalable_Apps::cam4_zoom_pane_g2(variant); // -
  1108     l = AknLayoutScalable_Apps::cam4_zoom_pane_g2(variant); // -
  1115     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1109     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1116     AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), 
  1110     AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), 
  1117                            EAspectRatioNotPreserved );
  1111                            EAspectRatioNotPreserved );
  1118     iMinusPoint = area.Rect().iTl;    
  1112     iMinusPoint = area.Rect().iTl;                             
  1119     iExtent.BoundingRect(area.Rect());
       
  1120     
  1113     
  1121     l = AknLayoutScalable_Apps::cam4_zoom_cont_pane_g1(variant); // Top
  1114     l = AknLayoutScalable_Apps::cam4_zoom_cont_pane_g1(variant); // Top
  1122     area.LayoutRect( iSliderParentRect, l.LayoutLine() );
  1115     area.LayoutRect( iSliderParentRect, l.LayoutLine() );
  1123     AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), 
  1116     AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), 
  1124                            EAspectRatioNotPreserved );
  1117                            EAspectRatioNotPreserved );
  1146     TRect adj = iZoomPaneRect;
  1139     TRect adj = iZoomPaneRect;
  1147 	adj.SetHeight( area.Rect().Height() );
  1140 	adj.SetHeight( area.Rect().Height() );
  1148 	adj.Move( bottomRect.Center() - adj.Center() );
  1141 	adj.Move( bottomRect.Center() - adj.Center() );
  1149     AknIconUtils::SetSize( iIconZoomMarker[0], adj.Size() );  
  1142     AknIconUtils::SetSize( iIconZoomMarker[0], adj.Size() );  
  1150     AknIconUtils::SetSize( iIconZoomMarkerGray[0], adj.Size() );
  1143     AknIconUtils::SetSize( iIconZoomMarkerGray[0], adj.Size() );
  1151 
       
  1152     if( iPlusPoint.iY < iTopPoint.iY )
       
  1153         {
       
  1154         // Thumb is drawn further than shaft.
       
  1155         // If Max(+) and Min(-) marks are extending shaft,
       
  1156         // parent rectangle covers everything.
       
  1157         iExtent = iZoomPaneRect;
       
  1158         }
       
  1159     else
       
  1160         {
       
  1161         // If marks are drawn right side of shaft,
       
  1162         // extend area to redraw.
       
  1163         iExtent.Grow(0, adj.Size().iHeight/2);
       
  1164         }
       
  1165    
  1144    
  1166     }
  1145     }
  1167 
  1146 
  1168 // ---------------------------------------------------------
  1147 // ---------------------------------------------------------
  1169 // CCamZoomPane::NonTouchLayout
  1148 // CCamZoomPane::NonTouchLayout
  1185     iZoomPaneRect = area.Rect();
  1164     iZoomPaneRect = area.Rect();
  1186 
  1165 
  1187     l = AknLayoutScalable_Apps::cam6_zoom_cont_pane(variant); 
  1166     l = AknLayoutScalable_Apps::cam6_zoom_cont_pane(variant); 
  1188     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1167     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1189     iSliderParentRect = area.Rect();
  1168     iSliderParentRect = area.Rect();
  1190     iExtent = iSliderParentRect;
       
  1191     
  1169     
  1192     l = AknLayoutScalable_Apps::cam6_zoom_pane_g1(variant); // +
  1170     l = AknLayoutScalable_Apps::cam6_zoom_pane_g1(variant); // +
  1193     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1171     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1194     AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), 
  1172     AknIconUtils::SetSize( iIconZoomMax[0], area.Rect().Size(), 
  1195                            EAspectRatioNotPreserved );
  1173                            EAspectRatioNotPreserved );
  1196     iPlusPoint = area.Rect().iTl;       
  1174     iPlusPoint = area.Rect().iTl;                       
  1197     iExtent.BoundingRect(area.Rect());
       
  1198     
  1175     
  1199     l = AknLayoutScalable_Apps::cam6_zoom_pane_g2(variant); // -
  1176     l = AknLayoutScalable_Apps::cam6_zoom_pane_g2(variant); // -
  1200     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1177     area.LayoutRect( iZoomPaneRect, l.LayoutLine() );
  1201     AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), 
  1178     AknIconUtils::SetSize( iIconZoomMin[0], area.Rect().Size(), 
  1202                            EAspectRatioNotPreserved );
  1179                            EAspectRatioNotPreserved );
  1203     iMinusPoint = area.Rect().iTl;       
  1180     iMinusPoint = area.Rect().iTl;                             
  1204     iExtent.BoundingRect(area.Rect());
       
  1205     
  1181     
  1206     l = AknLayoutScalable_Apps::cam6_zoom_cont_pane_g1(variant); // Top
  1182     l = AknLayoutScalable_Apps::cam6_zoom_cont_pane_g1(variant); // Top
  1207     area.LayoutRect( iSliderParentRect, l.LayoutLine() );
  1183     area.LayoutRect( iSliderParentRect, l.LayoutLine() );
  1208     AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), 
  1184     AknIconUtils::SetSize( iIconZoomTop[0], area.Rect().Size(), 
  1209                            EAspectRatioNotPreserved );
  1185                            EAspectRatioNotPreserved );
  1229     l = AknLayoutScalable_Apps::cam6_zoom_pane_g3(variant); // Knob
  1205     l = AknLayoutScalable_Apps::cam6_zoom_pane_g3(variant); // Knob
  1230     area.LayoutRect(iSliderParentRect, l.LayoutLine() );
  1206     area.LayoutRect(iSliderParentRect, l.LayoutLine() );
  1231     iZoomPaneRect.iTl.iX += area.Rect().Width()/2;
  1207     iZoomPaneRect.iTl.iX += area.Rect().Width()/2;
  1232     AknIconUtils::SetSize( iIconZoomMarker[0], area.Rect().Size() );  
  1208     AknIconUtils::SetSize( iIconZoomMarker[0], area.Rect().Size() );  
  1233     AknIconUtils::SetSize( iIconZoomMarkerGray[0], area.Rect().Size() );    
  1209     AknIconUtils::SetSize( iIconZoomMarkerGray[0], area.Rect().Size() );    
  1234 
       
  1235     if( iPlusPoint.iY < iTopPoint.iY )
       
  1236         {
       
  1237         // Thumb is drawn further than shaft.
       
  1238         // If Max(+) and Min(-) marks are extending shaft,
       
  1239         // parent rectangle covers everything.
       
  1240         iExtent = iZoomPaneRect;
       
  1241         }
       
  1242     else
       
  1243         {
       
  1244         // If marks are drawn right side of shaft,
       
  1245         // extend area to redraw.
       
  1246         iExtent.Grow(0, area.Rect().Size().iHeight/2);
       
  1247         }
       
  1248     }
  1210     }
  1249     
  1211     
  1250 // ---------------------------------------------------------
  1212 // ---------------------------------------------------------
  1251 // CCamZoomPane::Touchfeedback
  1213 // CCamZoomPane::Touchfeedback
  1252 // ---------------------------------------------------------
  1214 // ---------------------------------------------------------