camerauis/cameraapp/generic/src/CamPostCaptureContainer.cpp
branchRCL_3
changeset 10 8c55c525d5d7
parent 0 1ddebce53859
child 11 d486e5e3cc9a
equal deleted inserted replaced
9:792dfc98fb3b 10:8c55c525d5d7
    25 #include <AknsFrameBackgroundControlContext.h>
    25 #include <AknsFrameBackgroundControlContext.h>
    26 #include <AknsDrawUtils.h>
    26 #include <AknsDrawUtils.h>
    27 #include <cameraapp.rsg>
    27 #include <cameraapp.rsg>
    28 #include <vgacamsettings.rsg>
    28 #include <vgacamsettings.rsg>
    29 #include <aknlayoutscalable_apps.cdl.h>
    29 #include <aknlayoutscalable_apps.cdl.h>
    30 #include <layoutmetadata.cdl.h>            
    30 #include <layoutmetadata.cdl.h>
       
    31 #include <cameraapp.mbg>
       
    32 
       
    33 #include <touchfeedback.h> 
    31 
    34 
    32 #include "CamPanic.h"
    35 #include "CamPanic.h"
    33 #include "CamAppUi.h"
    36 #include "CamAppUi.h"
    34 #include "CamPostCaptureContainer.h"
    37 #include "CamPostCaptureContainer.h"
    35 #include "CamAppController.h"
    38 #include "CamAppController.h"
    72   {
    75   {
    73   PRINT( _L("Camera => ~CCamPostCaptureContainer" ))
    76   PRINT( _L("Camera => ~CCamPostCaptureContainer" ))
    74 
    77 
    75   iController.RemoveControllerObserver( this );
    78   iController.RemoveControllerObserver( this );
    76   delete iBatteryPaneController;
    79   delete iBatteryPaneController;
       
    80   if(iPlayIcon)
       
    81       {
       
    82       delete iPlayIcon;
       
    83       iPlayIcon = NULL;
       
    84       }
       
    85   if(iPlayIconMask)
       
    86         {
       
    87         delete iPlayIconMask;
       
    88         iPlayIconMask = NULL;
       
    89         }
       
    90   if(iPlayIconBg)
       
    91         {
       
    92         delete iPlayIconBg;
       
    93         iPlayIconBg = NULL;
       
    94         }
       
    95   if(iPlayIconBgMask)
       
    96         {
       
    97         delete iPlayIconBgMask;
       
    98         iPlayIconBgMask = NULL;
       
    99         }
       
   100   if(iPlayIconBgPressed)
       
   101         {
       
   102         delete iPlayIconBgPressed;
       
   103         iPlayIconBgPressed = NULL;
       
   104         }
       
   105   if(iPlayIconBgPressedMask)
       
   106         {
       
   107         delete iPlayIconBgPressedMask;
       
   108         iPlayIconBgPressedMask = NULL;
       
   109         }
    77   PRINT( _L("Camera <= ~CCamPostCaptureContainer" ))
   110   PRINT( _L("Camera <= ~CCamPostCaptureContainer" ))
    78   }
   111   }
    79   
   112   
    80 // ---------------------------------------------------------
   113 // ---------------------------------------------------------
    81 // CCamPostCaptureContainer::ConstructL
   114 // CCamPostCaptureContainer::ConstructL
    99     if( ECamControllerImage == iController.CurrentMode() )
   132     if( ECamControllerImage == iController.CurrentMode() )
   100       {
   133       {
   101       // Still mode - processing text needed  
   134       // Still mode - processing text needed  
   102       PrepareProcessingTextL( ETrue );
   135       PrepareProcessingTextL( ETrue );
   103       } 
   136       } 
   104 
   137     if ( iView.Id().iUid == ECamViewIdVideoPostCapture )
       
   138         {
       
   139         _LIT(KResName, "z:\\resource\\apps\\cameraapp.mif");
       
   140         TSize playIconSize( 140, 92);
       
   141         AknIconUtils::CreateIconL(
       
   142                  iPlayIcon,
       
   143                  iPlayIconMask,
       
   144                  KResName(),
       
   145                  EMbmCameraappQgn_indi_media_fullscreen_play,
       
   146                  EMbmCameraappQgn_indi_media_fullscreen_play_mask);
       
   147         AknIconUtils::SetSize(iPlayIcon,playIconSize,EAspectRatioPreserved);
       
   148         AknIconUtils::SetSize(iPlayIconMask,playIconSize,EAspectRatioPreserved);
       
   149         
       
   150         //!!Please don't remove this commented section
       
   151         /*TSize playIconSize(40,40);
       
   152         AknIconUtils::CreateIconL(
       
   153                  iPlayIcon,
       
   154                  iPlayIconMask,
       
   155                  KResName(),
       
   156                  EMbmCameraappQgn_indi_cam4_tb_play,
       
   157                  EMbmCameraappQgn_indi_cam4_tb_play_mask);
       
   158         AknIconUtils::SetSize(iPlayIcon,playIconSize,EAspectRatioPreserved);
       
   159         AknIconUtils::SetSize(iPlayIconMask,playIconSize,EAspectRatioPreserved);
       
   160         
       
   161         TSize playIconBgSize(140,92);
       
   162         AknIconUtils::CreateIconL(
       
   163                  iPlayIconBg,
       
   164                  iPlayIconBgMask,
       
   165                  KResName(),
       
   166                  EMbmCameraappQgn_bg_lcam_vid_postcap_play,
       
   167                  EMbmCameraappQgn_bg_lcam_vid_postcap_play_mask);
       
   168         AknIconUtils::SetSize(iPlayIconBg,playIconBgSize,EAspectRatioPreserved);
       
   169         AknIconUtils::SetSize(iPlayIconBgMask,playIconBgSize,EAspectRatioPreserved);
       
   170         AknIconUtils::CreateIconL(
       
   171                  iPlayIconBgPressed,
       
   172                  iPlayIconBgPressedMask,
       
   173                  KResName(),
       
   174                  EMbmCameraappQgn_bg_lcam_vid_postcap_play_pressed,
       
   175                  EMbmCameraappQgn_bg_lcam_vid_postcap_play_pressed_mask);
       
   176         AknIconUtils::SetSize(iPlayIconBgPressed,playIconBgSize,EAspectRatioPreserved);
       
   177         AknIconUtils::SetSize(iPlayIconBgPressedMask,playIconBgSize,EAspectRatioPreserved);*/
       
   178         }
       
   179     
   105     // Make sure fixed toolbar is on top of this window
   180     // Make sure fixed toolbar is on top of this window
   106     DrawableWindow()->SetOrdinalPosition( KCamPostCaptureWindowOrdinalPos );
   181     DrawableWindow()->SetOrdinalPosition( KCamPostCaptureWindowOrdinalPos );
   107     }
   182     }
   108     
   183     
   109 // ---------------------------------------------------------------------------
   184 // ---------------------------------------------------------------------------
   299 	     if( iPaneInUse == ECamPaneCounter )
   374 	     if( iPaneInUse == ECamPaneCounter )
   300 	        {
   375 	        {
   301 	        iNaviCounterControl->DrawNaviCtr( gc );
   376 	        iNaviCounterControl->DrawNaviCtr( gc );
   302 	        }
   377 	        }
   303 	     }
   378 	     }
       
   379 	 
       
   380 	 if ( iView.Id().iUid == ECamViewIdVideoPostCapture )
       
   381 	     {
       
   382          TSize playIconSize(140,92);
       
   383 	     TRect playIconRect(containerRect.Center() - TPoint(70,46),playIconSize);
       
   384 	     TRect playIconSourceRect(0,0,140,92);
       
   385          
       
   386 	     //!!Please don't remove this commented section
       
   387 	     /*TSize playIconSize(40,40);
       
   388          TRect playIconRect(containerRect.Center() - TPoint(20,20),playIconSize);
       
   389          TRect playIconSourceRect(0,0,40,40);
       
   390          
       
   391          TSize playIconBgSize(140,92);
       
   392 	     TRect playIconBgRect(containerRect.Center() - TPoint(70,46),playIconBgSize);
       
   393 	     TRect playIconBgSourceRect(0,0,140,92);
       
   394          
       
   395 	     if(iPlayIconPressed)
       
   396 	         {
       
   397              gc.BitBltMasked(playIconBgRect.iTl,iPlayIconBgPressed,playIconBgSourceRect,iPlayIconBgPressedMask,EFalse);
       
   398 	         }
       
   399 	     else
       
   400 	         {
       
   401              gc.BitBltMasked(playIconBgRect.iTl,iPlayIconBg,playIconBgSourceRect,iPlayIconBgMask,EFalse);
       
   402 	         }*/
       
   403 	     
       
   404 	     gc.BitBltMasked(playIconRect.iTl,iPlayIcon,playIconSourceRect,iPlayIconMask,EFalse);
       
   405                  
       
   406          }
   304      }
   407      }
   305 
   408 
   306 // ----------------------------------------------------
   409 // ----------------------------------------------------
   307 // CCamPostCaptureContainer::CheckForFileName
   410 // CCamPostCaptureContainer::CheckForFileName
   308 // 
   411 // 
   635     }
   738     }
   636 
   739 
   637   PRINT( _L("Camera <= CCamPostCaptureContainer::HandleAppEvent") );
   740   PRINT( _L("Camera <= CCamPostCaptureContainer::HandleAppEvent") );
   638   }
   741   }
   639 
   742 
       
   743 // -----------------------------------------------------------------------------
       
   744 // CCamPostCaptureContainer::HandlePointerEventL
       
   745 //
       
   746 // Handles pointer events; From CCoeControl
       
   747 // -----------------------------------------------------------------------------    
       
   748 //  
       
   749 void CCamPostCaptureContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   750     {
       
   751     if ( iView.Id().iUid == ECamViewIdVideoPostCapture )
       
   752         {
       
   753         TRect containerRect = Rect();
       
   754         TRect playIconRect(containerRect.Center() - TPoint(35,23), TSize(70,46));
       
   755         if( playIconRect.Contains(aPointerEvent.iPosition) )
       
   756             {
       
   757             if ( aPointerEvent.iType == TPointerEvent::EButton1Down || aPointerEvent.iType == TPointerEvent::EDrag)  
       
   758                 {
       
   759                 if(!iDraggedInAlready)
       
   760                     {
       
   761                     MTouchFeedback* feedback = MTouchFeedback::Instance(); 
       
   762                     if ( feedback )
       
   763                         {
       
   764                         feedback->InstantFeedback( ETouchFeedbackBasicButton );        
       
   765                         }
       
   766                     iDraggedInAlready = ETrue;
       
   767                     iPlayIconPressed = ETrue;
       
   768                     DrawNow();
       
   769                     }
       
   770                 }
       
   771             else if(aPointerEvent.iType == TPointerEvent::EButton1Up )
       
   772                 {
       
   773                 iPlayIconPressed = EFalse;
       
   774                 iDraggedInAlready = ETrue;
       
   775                 //feedback->InstantFeedback( ETouchFeedbackBasicButton );
       
   776                 iView.HandleCommandL(ECamCmdPlay);
       
   777                 }
       
   778             }
       
   779         else
       
   780             {
       
   781             iDraggedInAlready = EFalse;
       
   782             iPlayIconPressed = EFalse;
       
   783             DrawNow();
       
   784             }
       
   785         }
       
   786     }
       
   787 	
   640 // End of File  
   788 // End of File