videditor/ManualVideoEditor/inc/VeiTrimForMmsView.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description: 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef VEITRIMFORMMSVIEW_H
       
    22 #define VEITRIMFORMMSVIEW_H
       
    23 
       
    24 // INCLUDES
       
    25 // System includes
       
    26 #include <aknview.h>    // CAknView
       
    27 #include <CAknMemorySelectionDialog.h> 
       
    28 #include <VedMovie.h>   // CVedmovie
       
    29 // User includes
       
    30 #include "VeiSettings.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CAknNavigationDecorator;
       
    34 class CAknProgressDialog;
       
    35 class CVeiErrorUI;
       
    36 class CSendUi;
       
    37 class CVeiTrimForMmsContainer;
       
    38 class CVedMovie;
       
    39 class CMessageData;
       
    40 class CEikProgressInfo;
       
    41 class CVeiTempMaker;
       
    42 
       
    43 
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48  *
       
    49  */
       
    50 class CVeiTrimForMmsView: public CAknView,
       
    51                           public MVedMovieObserver,
       
    52                           public MVedMovieProcessingObserver
       
    53 						  
       
    54 {
       
    55 public:
       
    56     // Constructors and destructor
       
    57 
       
    58     static CVeiTrimForMmsView* NewL( CSendUi& aSendAppUi );
       
    59 
       
    60     static CVeiTrimForMmsView* NewLC( CSendUi& aSendAppUi );
       
    61 
       
    62     virtual ~CVeiTrimForMmsView();
       
    63 
       
    64     /**
       
    65      * Preview states
       
    66      */
       
    67     enum TPreviewState
       
    68     {
       
    69         EIdle = 0,
       
    70         ELoading,
       
    71         EPreview,
       
    72         EPlaying,
       
    73         EStop,
       
    74         EStopAndExit,
       
    75         EOpeningFile,
       
    76         EPause
       
    77     };
       
    78 
       
    79 public:
       
    80     void UpdateNaviPaneL( const TInt& aSizeInBytes,
       
    81                           const TTimeIntervalMicroSeconds& aTime );
       
    82 
       
    83     void UpdateNaviPaneSize();
       
    84 
       
    85     /**
       
    86      * Trim states
       
    87      */
       
    88     enum TTrimState
       
    89     {
       
    90         ESeek = 0,			
       
    91         EFullPreview
       
    92     };
       
    93 
       
    94     void SetTrimStateL( TTrimState aState );
       
    95 
       
    96     /**
       
    97      * From <code>MProgressDialogCallback</code>, callback method gets
       
    98      * called when a dialog is dismissed.
       
    99      *
       
   100      * @param aButtonId  Button id.
       
   101      */
       
   102     virtual void DialogDismissedL( TInt aButtonId );
       
   103     void ProcessNeeded( TBool aProcessNeed );
       
   104 
       
   105     /**
       
   106      * Shows global error note for given error.
       
   107      * 
       
   108      * @param aError No description.
       
   109      */
       
   110     void ShowGlobalErrorNoteL( TInt aError = 0 )const;
       
   111 
       
   112     /** 
       
   113      * Handles a change to the control's resources.
       
   114      */
       
   115     void HandleResourceChange( TInt aType );
       
   116 
       
   117 private:
       
   118     // From CAknView
       
   119 
       
   120     TUid Id()const;
       
   121 
       
   122     void HandleCommandL( TInt aCommand );
       
   123 
       
   124     void DoActivateL( const TVwsViewId& aPrevViewId,
       
   125                       TUid aCustomMessageId,
       
   126                       const TDesC8& aCustomMessage );
       
   127 
       
   128     void DoDeactivate();
       
   129 
       
   130     void HandleStatusPaneSizeChange();
       
   131 
       
   132     void ReadSettingsL( TVeiSettings& aSettings )const;
       
   133 
       
   134 protected:
       
   135     // From MVedMovieObserver
       
   136 
       
   137     virtual void NotifyVideoClipAdded( CVedMovie& aMovie, TInt aIndex );
       
   138 
       
   139     virtual void NotifyVideoClipAddingFailed( CVedMovie& aMovie, TInt aError );
       
   140 
       
   141     virtual void NotifyVideoClipRemoved( CVedMovie& aMovie, TInt aIndex );
       
   142 
       
   143     virtual void NotifyVideoClipIndicesChanged( CVedMovie& aMovie, 
       
   144                                                 TInt aOldIndex, 
       
   145                                                 TInt aNewIndex );
       
   146 
       
   147     virtual void NotifyVideoClipTimingsChanged( CVedMovie& aMovie,
       
   148                                                 TInt aIndex );
       
   149 
       
   150     virtual void NotifyVideoClipColorEffectChanged( CVedMovie& aMovie,
       
   151                                                     TInt aIndex );
       
   152 
       
   153     virtual void NotifyVideoClipAudioSettingsChanged( CVedMovie& aMovie,
       
   154                                                       TInt aIndex );
       
   155                                                       
       
   156     virtual void NotifyVideoClipGeneratorSettingsChanged( CVedMovie& aMovie,
       
   157                                                           TInt aIndex );
       
   158 
       
   159     virtual void NotifyVideoClipDescriptiveNameChanged( CVedMovie& aMovie,
       
   160                                                         TInt aIndex );
       
   161 
       
   162     virtual void NotifyStartTransitionEffectChanged( CVedMovie& aMovie );
       
   163 
       
   164     virtual void NotifyMiddleTransitionEffectChanged( CVedMovie& aMovie, 
       
   165                                                       TInt aIndex );
       
   166 
       
   167     virtual void NotifyEndTransitionEffectChanged( CVedMovie& aMovie );
       
   168 
       
   169     virtual void NotifyAudioClipAdded( CVedMovie& aMovie, TInt aIndex );
       
   170 
       
   171     virtual void NotifyAudioClipAddingFailed( CVedMovie& aMovie, TInt aError );
       
   172 
       
   173     virtual void NotifyAudioClipRemoved( CVedMovie& aMovie, TInt aIndex );
       
   174 
       
   175     virtual void NotifyAudioClipIndicesChanged( CVedMovie& aMovie, 
       
   176                                                 TInt aOldIndex,
       
   177                                                 TInt aNewIndex );
       
   178 
       
   179     virtual void NotifyAudioClipTimingsChanged( CVedMovie& aMovie,
       
   180                                                 TInt aIndex );
       
   181 
       
   182     virtual void NotifyMovieQualityChanged( CVedMovie& aMovie );
       
   183 
       
   184     virtual void NotifyMovieReseted( CVedMovie& aMovie );
       
   185 
       
   186     virtual void NotifyMovieOutputParametersChanged( CVedMovie& aMovie );
       
   187 
       
   188     virtual void NotifyAudioClipDynamicLevelMarkInserted( CVedMovie& aMovie, 
       
   189                                                           TInt aClipIndex, 
       
   190                                                           TInt aMarkIndex );
       
   191 
       
   192     virtual void NotifyAudioClipDynamicLevelMarkRemoved( CVedMovie& aMovie, 
       
   193                                                          TInt aClipIndex, 
       
   194                                                          TInt aMarkIndex );
       
   195 
       
   196     virtual void NotifyVideoClipDynamicLevelMarkInserted( CVedMovie& aMovie, 
       
   197                                                           TInt aClipIndex, 
       
   198                                                           TInt aMarkIndex );
       
   199 
       
   200     virtual void NotifyVideoClipDynamicLevelMarkRemoved( CVedMovie& aMovie, 
       
   201                                                          TInt aClipIndex, 
       
   202                                                          TInt aMarkIndex );  
       
   203 
       
   204 protected:
       
   205     // From MVedMovieProcessingObserver
       
   206 
       
   207     /**
       
   208      * Called to notify that a new movie processing operation has been started. 
       
   209      *
       
   210      * @param aMovie  movie
       
   211      */
       
   212     void NotifyMovieProcessingStartedL( CVedMovie& aMovie );
       
   213 
       
   214     /**
       
   215      * Called to inform about the current progress of the movie processing operation.
       
   216      *
       
   217      * @param aMovie       movie
       
   218      * @param aPercentage  percentage of the operation completed, must be 
       
   219      *                     in range 0..100
       
   220      */
       
   221     void NotifyMovieProcessingProgressed( CVedMovie& aMovie, TInt aPercentage );
       
   222 
       
   223     /**
       
   224      * Called to notify that the movie processing operation has been completed. 
       
   225      * 
       
   226      * @param aMovie  movie
       
   227      * @param aError  error code why the operation was completed. 
       
   228      *                <code>KErrNone</code> if the operation was completed 
       
   229      *                successfully.
       
   230      */
       
   231     void NotifyMovieProcessingCompleted( CVedMovie& aMovie, TInt aError );
       
   232 
       
   233 private:
       
   234     // New functions
       
   235 
       
   236     void CmdSoftkeyCancelL();
       
   237 
       
   238     /**
       
   239      * 
       
   240      */
       
   241     void CmdSoftkeyOkL();
       
   242 
       
   243 
       
   244     /**
       
   245      * Send via multimedia command handling.
       
   246      */
       
   247     void CmdSendViaMultimediaL();
       
   248 
       
   249     void CmdSoftkeyBackL();
       
   250 
       
   251     void PushKeySoundL( const TInt aResourceId )const;
       
   252 
       
   253     void PopKeySound()const;
       
   254 
       
   255     /**
       
   256      * Sets the text for title pane.
       
   257      */
       
   258     void SetTitlePaneTextL()const;
       
   259 
       
   260     void CreateNaviPaneL();
       
   261 
       
   262     void SetNaviPaneDurationLabelL( const TTimeIntervalMicroSeconds& aTime );
       
   263 
       
   264     void SetNaviPaneSizeLabelL( const TInt& aSizeInBytes );
       
   265 
       
   266     /**
       
   267      * Start full screen preview.
       
   268      */
       
   269     void PlayPreviewL();
       
   270 
       
   271 private:
       
   272     // Constructors
       
   273 
       
   274     CVeiTrimForMmsView( CSendUi& aSendAppUi );
       
   275 
       
   276     void ConstructL();
       
   277 
       
   278 private:
       
   279     // Data
       
   280 
       
   281     /** 
       
   282      * Cut in time in microseconds (clip timebase) for trimmed video.
       
   283      */
       
   284     TTimeIntervalMicroSeconds iCutInTime;
       
   285 
       
   286     /** 
       
   287      * Cut out time in microseconds (clip timebase) for trimmed video.
       
   288      */
       
   289     TTimeIntervalMicroSeconds iCutOutTime;
       
   290 
       
   291     /**
       
   292      * Progress note for saving the trimmed video
       
   293      */
       
   294     CAknProgressDialog* iProgressNote;
       
   295 
       
   296     /**
       
   297      * Progress info for the progress dialog.
       
   298      */
       
   299     CEikProgressInfo* iProgressInfo;
       
   300 
       
   301     /**
       
   302      * Container
       
   303      */
       
   304     CVeiTrimForMmsContainer* iContainer;
       
   305 
       
   306     /**
       
   307      * Navigation pane decorator
       
   308      */
       
   309     CAknNavigationDecorator* iNaviDecorator;
       
   310 
       
   311     /**
       
   312      *
       
   313      */
       
   314     CSendUi& iSendAppUi;
       
   315 
       
   316     /**
       
   317      *
       
   318      */
       
   319     CVedMovie* iVedMovie;
       
   320 
       
   321     /**
       
   322      * Previous view which activated this view.
       
   323      */
       
   324     TVwsViewId iPreviousViewId;
       
   325 
       
   326     /**
       
   327      * Utility class to display error notes by applications. 
       
   328      */
       
   329     CVeiErrorUI* iErrorUi;
       
   330 
       
   331     /**
       
   332      * No description.
       
   333      */
       
   334     CVeiTempMaker* iTempMaker;
       
   335 
       
   336     /**
       
   337      * Temporary file name for storing preview/send clip.
       
   338      */
       
   339     HBufC* iTempFile;
       
   340 
       
   341 
       
   342     TTrimState iTrimState;
       
   343 
       
   344     TVeiSettings iMovieSaveSettings;
       
   345 
       
   346     /*
       
   347      * Indecates if process needed.
       
   348      */
       
   349     TBool iProcessNeeded;
       
   350 
       
   351 
       
   352 
       
   353 };
       
   354 
       
   355 #endif