camerauis/cameraapp/generic/src/CamSidePane.cpp
branchRCL_3
changeset 27 53c8aa5d97a3
parent 3 8b2d6d0384b0
equal deleted inserted replaced
25:bf64cebf4673 27:53c8aa5d97a3
    81 // Symbian OS 2nd phase constructor
    81 // Symbian OS 2nd phase constructor
    82 // ---------------------------------------------------------
    82 // ---------------------------------------------------------
    83 //
    83 //
    84 void CCamSidePane::ConstructL()
    84 void CCamSidePane::ConstructL()
    85     {
    85     {
       
    86     PRINT( _L("Camera => CCamSidePane::ConstructL") );
    86     LoadResourceDataL();
    87     LoadResourceDataL();
    87 
    88 
    88     // side pane is a controller, self timer and burst mode observer
    89     // side pane is a controller, self timer and burst mode observer
    89     RegisterObserversL();
    90     RegisterObserversL();
    90     iVisible = ETrue;
    91     iVisible = ETrue;
    91 
    92 
    92     UpdateLayout();
    93     UpdateLayout();
       
    94     PRINT( _L("Camera <= CCamSidePane::ConstructL") );
    93     }
    95     }
    94 
    96 
    95 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    96 // CCamSidePane::LoadResourceDataL()
    98 // CCamSidePane::LoadResourceDataL()
    97 // Reads in all information needed from resources
    99 // Reads in all information needed from resources
   544         // -------------------------------------------------
   546         // -------------------------------------------------
   545         case ECamIndicatorCaptureMode:
   547         case ECamIndicatorCaptureMode:
   546           {
   548           {
   547           if( appUi && !appUi->IsSecondCameraEnabled() || 
   549           if( appUi && !appUi->IsSecondCameraEnabled() || 
   548               appUi &&  appUi->IsQwerty2ndCamera() )  
   550               appUi &&  appUi->IsQwerty2ndCamera() )  
   549             {
   551               {
   550             if ( ECamControllerVideo == iMode ) 
   552               if ( ECamControllerVideo == iMode ) 
   551                 {
   553                   {
   552                 iIndicators[ECamIndicatorCaptureMode]->SetIcon( 2 );
   554                   iIndicators[ECamIndicatorCaptureMode]->SetIcon( 2 );
   553                 }
   555                   }
   554             else
   556               else
   555               iIndicators[ECamIndicatorCaptureMode]->SetIcon( 0 );
   557                   iIndicators[ECamIndicatorCaptureMode]->SetIcon( 0 );
   556             }
   558               }
   557           else
   559           else
   558             iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
   560             iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
       
   561 			
       
   562           if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
       
   563               {
       
   564               iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
       
   565               }
   559           break;
   566           break;
   560           }
   567           }
       
   568         // -------------------------------------------------
       
   569         case ECamIndicatorTotal:
       
   570             {
       
   571             if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
       
   572                 {
       
   573                 iIndicators[ECamIndicatorTotal]->DisplayIcon();
       
   574                 }
       
   575             break;
       
   576             }
   561         // -------------------------------------------------
   577         // -------------------------------------------------
   562         // other indicators
   578         // other indicators
   563         default:
   579         default:
   564           {
   580           {
   565           iIndicators[i]->ClearIcon();
   581           iIndicators[i]->ClearIcon();
   996         if ( iIndicators[i] )
  1012         if ( iIndicators[i] )
   997             {
  1013             {
   998             switch ( i )
  1014             switch ( i )
   999                 {
  1015                 {
  1000                 case ECamIndicatorCaptureMode:
  1016                 case ECamIndicatorCaptureMode:
       
  1017                 case ECamIndicatorTotal:
  1001                     {
  1018                     {
  1002                     if ( ECamControllerVideo == iMode )
  1019                     if ( ECamControllerVideo == iMode )
  1003                         {
  1020                         {
  1004                         l.LayoutRect( rect,
  1021                         l.LayoutRect( rect,
  1005                            AknLayoutScalable_Apps::main_video4_pane_g1( variant ) );
  1022                            AknLayoutScalable_Apps::main_video4_pane_g1( variant ) );
  1008                         {
  1025                         {
  1009                         l.LayoutRect( rect,
  1026                         l.LayoutRect( rect,
  1010                            AknLayoutScalable_Apps::main_camera4_pane_g1( variant ) );
  1027                            AknLayoutScalable_Apps::main_camera4_pane_g1( variant ) );
  1011                         }
  1028                         }
  1012                     iIndicators[i]->SetRect( l.Rect() );
  1029                     iIndicators[i]->SetRect( l.Rect() );
       
  1030                     if ( i == ECamIndicatorCaptureMode 
       
  1031 					     && iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
       
  1032                         {
       
  1033                         iIndicators[i]->ClearIcon();
       
  1034                         }
  1013                     break;
  1035                     break;
  1014                     }
  1036                     }
  1015                 case ECamIndicatorBurstMode:
  1037                 case ECamIndicatorBurstMode:
  1016                     {
  1038                     {
  1017                     l.LayoutRect( rect,
  1039                     l.LayoutRect( rect,
  1046                     }
  1068                     }
  1047                 }
  1069                 }
  1048             }
  1070             }
  1049         }
  1071         }
  1050     }
  1072     }
  1051    
  1073 
       
  1074 // ---------------------------------------------------------------------------
       
  1075 // CCamSidePane::ModeIndicatorLayoutRect
       
  1076 // ---------------------------------------------------------------------------
       
  1077 //
       
  1078 TRect CCamSidePane::ModeIndicatorLayoutRect()
       
  1079     {
       
  1080     // Mode and scene indicators use the same layout rect. 
       
  1081     // Only one of these can be used at a give time.  
       
  1082     return iIndicators[ECamIndicatorCaptureMode]->LayoutRect();
       
  1083     }
       
  1084 
       
  1085 // ---------------------------------------------------------------------------
       
  1086 // CCamSidePane::DrawModeIndicator
       
  1087 // ---------------------------------------------------------------------------
       
  1088 //
       
  1089 void CCamSidePane::DrawModeIndicator( CWindowGc& aGc, TBool aDrawIcon )
       
  1090     {
       
  1091     PRINT( _L("Camera => CCamSidePane::DrawModeIndicator") );
       
  1092 
       
  1093     if ( iController.UiConfigManagerPtr()->IsCustomCaptureButtonSupported() )
       
  1094         {
       
  1095         PRINT( _L("Camera <= CCamSidePane::DrawSceneIndicator - mode indicator not used") );
       
  1096         return;
       
  1097         }
       
  1098 
       
  1099     CCamIndicator *indicator = iIndicators[ECamIndicatorCaptureMode];
       
  1100     if ( indicator )
       
  1101         {
       
  1102         if( aDrawIcon )
       
  1103             {
       
  1104             indicator->DisplayIcon();
       
  1105             }
       
  1106         else
       
  1107             {
       
  1108             indicator->ClearIcon();
       
  1109             }
       
  1110         indicator->Draw( aGc );
       
  1111         }
       
  1112     PRINT( _L("Camera <= CCamSidePane::DrawModeIndicator") );
       
  1113     }
       
  1114 
       
  1115 // ---------------------------------------------------------------------------
       
  1116 // CCamSidePane::UpdateSceneIndicatorL
       
  1117 // ---------------------------------------------------------------------------
       
  1118 //
       
  1119 void CCamSidePane::UpdateSceneIndicatorL( TInt32 aBitmapId, TInt32 aMaskId )
       
  1120     {
       
  1121     PRINT1( _L("Camera => CCamSidePane::UpdateSceneIndicatorL - count:%d"), iIndicators.Count() );
       
  1122 
       
  1123     if ( !iIndicators.Count() )
       
  1124         {
       
  1125         PRINT( _L("Camera <= CCamSidePane::UpdateSceneIndicatorL - indi not initialized") );
       
  1126         return;    
       
  1127         }
       
  1128 
       
  1129     // Remove previous scene icon, if present
       
  1130     if ( iIndicators.Count() == ECamIndicatorTotal + 1 )
       
  1131         {
       
  1132         CCamIndicator *indi = iIndicators[ECamIndicatorTotal];
       
  1133         iIndicators.Remove( ECamIndicatorTotal );
       
  1134         delete indi;
       
  1135         }
       
  1136 
       
  1137     // Construct and append new indicator to the indicator list
       
  1138     TRect rect( iIndicators[ECamIndicatorCaptureMode]->LayoutRect() );
       
  1139     CCamIndicator *indicator = CCamIndicator::NewL( rect );
       
  1140 
       
  1141     CleanupStack::PushL( indicator );
       
  1142     indicator->AddIconL( aBitmapId, aMaskId );
       
  1143     indicator->SetRect( rect );
       
  1144     iIndicators.Append( indicator );
       
  1145     CleanupStack::Pop( indicator );
       
  1146     
       
  1147     // Mode indicator disabled and 
       
  1148     iIndicators[ECamIndicatorCaptureMode]->ClearIcon();
       
  1149     iIndicators[ECamIndicatorTotal]->DisplayIcon();
       
  1150 
       
  1151     PRINT( _L("Camera <= CCamSidePane::UpdateSceneIndicatorL") );
       
  1152     }
       
  1153 
  1052 // End of File
  1154 // End of File