camerauis/cameraapp/generic/inc/CamBurstThumbnailView.h
changeset 19 d9aefe59d544
parent 3 8b2d6d0384b0
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 *
       
    14 * Description:  View class to display a thumbnail grid after burst capture*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMBURSTTHUMBNAILVIEW_H
       
    19 #define CAMBURSTTHUMBNAILVIEW_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "CamViewBase.h"
       
    23 #include "CamPostCaptureViewBase.h"
       
    24 #include "CamBurstThumbnailGridModel.h"
       
    25 #include "AiwServiceHandler.h"  // for CAiwServiceHandler
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  View class to display a grid of thumbnails representing the images captured by
       
    33 *  a single burst capture operation
       
    34 * 
       
    35 *  @since 2.8
       
    36 */
       
    37 class CCamBurstThumbnailView :  public CCamPostCaptureViewBase, 
       
    38                                 public MThumbModelObserver,
       
    39                                 public MAiwNotifyCallback
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * @since 2.8
       
    46         * @param aController Reference to either the application controller 
       
    47         *        base class or test base class
       
    48         * @return pointer to the created CCamBurstThumbnailView object
       
    49         */
       
    50         static CCamBurstThumbnailView* NewLC( CCamAppController& aController );
       
    51         
       
    52         /**
       
    53         * Destructor.
       
    54         * @since 2.8
       
    55         */
       
    56         virtual ~CCamBurstThumbnailView();
       
    57 
       
    58     public: // New functions
       
    59 
       
    60         /**
       
    61         * Shows the delete note for the required number of files, and if the 
       
    62         * user confirms, will trigger the deletion of the marked files
       
    63         * @since 2.8
       
    64         * @return ETrue if ok to delete, else EFalse
       
    65         */
       
    66         TBool DisplayDeleteNoteL();
       
    67         
       
    68         /**
       
    69         * Deletes the currently marked or highlighted items
       
    70         * @since 3.0
       
    71         */
       
    72         void DoDeleteL();
       
    73 
       
    74     public: // Functions from base classes
       
    75 
       
    76         /**
       
    77         * From CAknView.
       
    78         * @since 2.8
       
    79         * @return UID of view
       
    80         */
       
    81         TUid Id() const;
       
    82 
       
    83         /**
       
    84         * From CAknView Handle commands        
       
    85         * @since 2.8                
       
    86         * @param aResourceId Resource Id of the menu 
       
    87         * @param aMenuPane Pointer to the pane showing the menu
       
    88         */
       
    89         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    90 
       
    91         /**
       
    92         * From CAknView Handle commands
       
    93         * @since 2.8
       
    94         * @param aCommand command to be handled
       
    95         */
       
    96         void HandleCommandL( TInt aCommand );
       
    97 
       
    98         /**
       
    99         * From CAknView Handles the foreground/background event
       
   100         * @since 2.8
       
   101         * @param aForeground ETrue if this view is on foreground, else EFalse.
       
   102         */
       
   103         void HandleForegroundEventL( TBool aForeground );
       
   104 
       
   105         /**
       
   106         * From CAknView.
       
   107         * @since 2.8
       
   108         * @param aPrevViewId the ID for previous view we are switching from
       
   109         * @param aCustomMessageId the Uid for message passed to this view
       
   110         * @param aCustomMessage descriptor containing data content for view specific message
       
   111         */
       
   112         void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   113                                                     const TDesC8& aCustomMessage );
       
   114         /**
       
   115         * From base class MAiwNotifyCallback.
       
   116         * Handles any notification caused by asynchronous ExecuteCommandL
       
   117         * or event.
       
   118         * @param aCmdId Service command associated to the event.
       
   119         * @param aEventId Occured event
       
   120         * @param aEventParamList Event parameters, if any, as defined per
       
   121         * each event.
       
   122         * @param aInParamList Input parameters, if any, given in the
       
   123         *        related HandleCommmandL
       
   124         * @return error code for the callback
       
   125         */
       
   126         TInt HandleNotifyL(
       
   127             TInt aCmdId,
       
   128             TInt aEventId,
       
   129             CAiwGenericParamList& aEventParamList,
       
   130             const CAiwGenericParamList& aInParamList );
       
   131 
       
   132 
       
   133         /**
       
   134         * From CAknView.
       
   135         * @since 2.8
       
   136         */
       
   137         void DoDeactivate();
       
   138 
       
   139         /**
       
   140         * From MThumbModelObserver.
       
   141         * Called when the highlight has changed
       
   142         * @since 2.8                
       
   143         */
       
   144         void HighlightChanged();
       
   145 
       
   146         /**
       
   147         * From MThumbModelObserver.
       
   148         * Called when files have been deleted
       
   149         * @since 2.8                        
       
   150         */
       
   151         void ImagesDeleted();
       
   152 
       
   153         /**
       
   154         * Check if renaming to the given name is valid.
       
   155         * @since 2.8
       
   156         * @param aFilename The new name to check.
       
   157         * @return ETrue if the name is valid.
       
   158         */
       
   159         TBool IsNewNameValidL( const TDesC& aFilename );
       
   160         
       
   161         
       
   162         /**
       
   163         * Returns whether the view is a burst capture postcapture view or not
       
   164         * @since 3.0
       
   165         * @returns ETrue if view is burst post capture postcapture
       
   166         */
       
   167         TBool IsBurstPostCapture();
       
   168         
       
   169         
       
   170         /**
       
   171          * Notifies view that image file(s) have been deleted outside of camera
       
   172          */
       
   173         void ImageFilesDeleted();
       
   174         
       
   175 
       
   176     protected:  // New functions
       
   177         
       
   178         /**
       
   179         * C++ default constructor.
       
   180         * @since 2.8
       
   181         * @param aController Reference to either the application controller 
       
   182         * base class or test base class
       
   183         */
       
   184         CCamBurstThumbnailView( CCamAppController& aController );
       
   185 
       
   186         /**
       
   187         * Symbian 2nd phase constructor.
       
   188         * @since 2.8
       
   189         */
       
   190         void ConstructL();
       
   191         
       
   192         /**
       
   193         * Create message.
       
   194         * @since 2.8
       
   195         */
       
   196         virtual void DoSendAsL() const;
       
   197 
       
   198         /**
       
   199         * If no items are marked, returns the ID of the currently
       
   200         * highlighted item.  Otherwise returns the ID of the first
       
   201         * marked item (to be called when up to 1 items are marked).
       
   202         * @return Index of item that is marked / highlighted 
       
   203         * @since 3.0
       
   204         */
       
   205         TInt SingleSelectionGridIndexL() const;
       
   206 
       
   207 #ifndef __WINS__
       
   208         /**
       
   209         * Send file to current caller using SFI functionality
       
   210         * @since 2.8
       
   211         */
       
   212         //virtual void DoInCallSendL() const;
       
   213 #endif
       
   214 
       
   215         /**
       
   216         * Dim one-click upload button if more than one image is marked.
       
   217         * @since S60 v5.0
       
   218         */
       
   219         void UpdateOneClickUploadButton();
       
   220 
       
   221         /**
       
   222          * Handles dynamic initialisation for aiw menus
       
   223          * @since 9.1
       
   224          */
       
   225         void DynInitAiwMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   226         
       
   227     private:    // Functions from base classes
       
   228 
       
   229         /**
       
   230         * From CCamViewBase
       
   231         * Create the container associated with this view.
       
   232         * @since 2.8
       
   233         */
       
   234         void CreateContainerL();
       
   235 
       
   236         /**
       
   237         * From CCamViewBase
       
   238         * Set the view's title text
       
   239         * @since 2.8
       
   240         */
       
   241         void SetTitlePaneTextL();
       
   242         
       
   243         /**
       
   244          * Calculates the size of a single thumbnail based on the infromation 
       
   245          * how many images are alltogether on the burst grid
       
   246          * @param aNumberOfBurstImages Total amount of burst images
       
   247          */
       
   248         TSize CalculateThumbnailSize( TInt aNumberOfBurstImages );
       
   249 
       
   250     private:
       
   251         // The model describing the contents of the thumbnail grid
       
   252         CCamBurstThumbnailGridModel* iGridModel;
       
   253 
       
   254         // Whether we should reset the model when view deactivated
       
   255         TBool iResetModelOnDeactivate;
       
   256     };
       
   257 
       
   258 #endif      // CAMBURSTTHUMBNAILVIEW_H   
       
   259             
       
   260 // End of File