camerauis/cameraapp/generic/inc/CamPostCaptureViewBase.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     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:  Base class for Post capture views*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMPOSTCAPTUREVIEWBASE_H
       
    19 #define CAMPOSTCAPTUREVIEWBASE_H
       
    20 
       
    21 //  INCLUDES
       
    22  
       
    23 #include "CamViewBase.h"
       
    24 #include "MCamAddToAlbumObserver.h"
       
    25 #include "CamControllerObservers.h"
       
    26 #include "AiwServiceHandler.h"  // for CAiwServiceHandler
       
    27 #include <sendui.h>
       
    28 #include <akntoolbarobserver.h>
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CSendUi;
       
    33 class CCamOneClickUploadUtility;
       
    34 
       
    35 #ifndef __WINS__
       
    36 class CSFIUtilsAppInterface;
       
    37 #endif // !defined(__WINS__) 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 class CCamCollectionManagerAO;
       
    41 class MCamAddToAlbumObserver;
       
    42 
       
    43 /**
       
    44 *  Base class for post capture views
       
    45 *  
       
    46 *  @since 2.8
       
    47 */
       
    48 class CCamPostCaptureViewBase : public CCamViewBase,
       
    49                                 public MCamControllerObserver,
       
    50                                 public MAknToolbarObserver            
       
    51                                 ,public MCamAddToAlbumObserver
       
    52     {
       
    53     public:  // Constructors and destructor
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         * @since 2.8
       
    58         */
       
    59         virtual ~CCamPostCaptureViewBase();
       
    60 
       
    61     public: // Functions from base classes
       
    62 
       
    63         /**
       
    64         * From CAknView Handle commands
       
    65         * @since 2.8
       
    66         * @param aCommand command to be handled
       
    67         */
       
    68         void HandleCommandL( TInt aCommand );
       
    69 
       
    70         /**
       
    71         * From MCamControllerObserver
       
    72         * @since 2.8
       
    73         * @param aEvent The enumerated code for the event received
       
    74         * @param aError The error code associated with the event
       
    75         */
       
    76         void HandleControllerEventL( TCamControllerEvent aEvent,
       
    77                                             TInt aError );
       
    78 
       
    79         /**
       
    80         * From CAknView Handles the foreground/background event
       
    81         * @since 2.8
       
    82         * @param aForeground ETrue if this view is on foreground, else EFalse.
       
    83         */
       
    84         void HandleForegroundEventL( TBool aForeground );
       
    85 
       
    86         /**
       
    87         * From CAknView.
       
    88         * @since 2.8
       
    89         * @param aPrevViewId the ID for previous view we are switching from
       
    90         * @param aCustomMessageId the Uid for message passed to this view
       
    91         * @param aCustomMessage descriptor containing data content for view specific message
       
    92         */
       
    93         void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
    94                                                     const TDesC8& aCustomMessage );
       
    95 
       
    96         /**
       
    97         * From CAknView.
       
    98         * @since 2.8
       
    99         */
       
   100         void DoDeactivate();
       
   101 
       
   102         /**
       
   103         * From MEikMenuObserver Changes MenuPane dynamically
       
   104         * @param aResourceId Resource Id
       
   105         * @param aMenuPane Handle to menu pane
       
   106         * @since 2.8
       
   107         */
       
   108         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   109 
       
   110 
       
   111     public: // From MCamAddToAlbumObserver
       
   112         /*
       
   113         * From MCamAddToAlbumObserver
       
   114         * Notification once the aysnchronous operations using
       
   115         * CollectionManager interface are done completly
       
   116         * Status of the operation are returned using aStatus
       
   117         * e.g. KErrNone
       
   118         */
       
   119         void AddToAlbumIdOperationComplete();
       
   120         
       
   121         /**
       
   122         * From MCamAddToAlbumObserver
       
   123         * Notification once the asynchronous operations using
       
   124         * CollectionManager interface have completed.
       
   125         *
       
   126         * @param aAlbumExists ETrue if album exists
       
   127         * @param aAlbumTitle  Title of the album
       
   128         */
       
   129         void CheckAlbumIdOperationCompleteL(
       
   130                 TBool /*aAlbumExists*/, const TDesC& /*aAlbumTitle*/ ) {}
       
   131 
       
   132     public: // From MCamFileHarvestingObserver
       
   133         /**
       
   134         * From MCamFileHarvestingObserver
       
   135         * Notification once the aysnchronous operations using
       
   136         * harverter client interface are done completly
       
   137         * the file that is being harvested is sent as paramerter
       
   138         */
       
   139         void HandleHarvestingComplete( const TDesC& aUri );
       
   140         
       
   141 
       
   142     public:  // New functions
       
   143 
       
   144         /**
       
   145         * Displays the delete image/video confirmation note
       
   146         * @since 2.8
       
   147         * @return EFalse if the user cancels the deletion, otherwise ETrue
       
   148         */
       
   149         virtual TBool DisplayDeleteNoteL() = 0;
       
   150         
       
   151         /**
       
   152         * Update fixed toolbar icons according to current call state
       
   153         * @since 5.0
       
   154         */
       
   155         void UpdateToolbarIconsL();
       
   156 
       
   157     protected:  // New functions
       
   158         
       
   159         /**
       
   160         * C++ default constructor.
       
   161         * @since 2.8
       
   162         * @param aController Reference to either the application controller 
       
   163         * base class or test base class
       
   164         */
       
   165         CCamPostCaptureViewBase( CCamAppController& aController );
       
   166 
       
   167         /**
       
   168         * Symbian 2nd phase constructor.
       
   169         * @since 2.8
       
   170         */
       
   171         void ConstructL();
       
   172 
       
   173         
       
   174     private:    // Functions from base classes
       
   175 
       
   176         /**
       
   177         * From CCamViewBase
       
   178         * Create the container associated with this view.
       
   179         * @since 2.8
       
   180         */
       
   181         void CreateContainerL();
       
   182 
       
   183     private:
       
   184        /*
       
   185         * Create Active Palette once the image/video is saved.
       
   186         */
       
   187         void UpdateActivePaletteItemsL();
       
   188 
       
   189     protected:
       
   190         /*
       
   191         * Create message of specified by
       
   192         * @param aCommand represents desired message type (eamil, MMS, BT )
       
   193         * @since 2.8
       
   194         */
       
   195         virtual void DoSendAsL() const;
       
   196 
       
   197 #ifndef __WINSCW__
       
   198         /**
       
   199         * Send file to current caller using SFI functionality
       
   200         * @since 2.8
       
   201         */
       
   202         virtual void DoInCallSendL() const;
       
   203 #endif //!WINSCW
       
   204 
       
   205         /**
       
   206         * Returns whether the view is a postcapture view or not
       
   207         * @since 3.0
       
   208         * @returns ETrue
       
   209         */
       
   210         virtual TBool IsPostCapture();
       
   211 
       
   212         /**
       
   213         * Hides or shows the 'Send' and 'SendAs' items in the active toolbar
       
   214         * @since 3.0
       
   215         * @param aApHandler handler for the active toolbar
       
   216         */
       
   217         void ResetSendAvailabilityL( CCamActivePaletteHandler* aApHandler );
       
   218 
       
   219 // from base class MAknToolbarObserver
       
   220 
       
   221         void OfferToolbarEventL( TInt aCommand );
       
   222 
       
   223     protected:
       
   224     
       
   225         CSendUi* iSendAppUi; 
       
   226         TSendingCapabilities iSendingCapabilities;     
       
   227         
       
   228 #ifndef __WINS__
       
   229         CSFIUtilsAppInterface* iSFIUtils;
       
   230 #endif
       
   231         CArrayFixFlat<TUid>* iSendMtmsToDim;
       
   232 
       
   233         // set to EFalse when still image save completes
       
   234         TBool iWaitForImageSave;        
       
   235 
       
   236         // AIW handler for dynamic menu options.
       
   237         CAiwServiceHandler* iAiwServiceHandler;
       
   238 
       
   239         // Utility for handling one-click upload operations.
       
   240         // Own.
       
   241         CCamOneClickUploadUtility* iOneClickUploadUtility;
       
   242 
       
   243     private: // New Methods
       
   244 		/**
       
   245         * Complete add to album request
       
   246         * @since 3.1
       
   247         */
       
   248         void StartAddToAlbumOperationL();
       
   249         
       
   250          /*
       
   251         * Shows the radiobutton setting page to 
       
   252         * actually proceed with add to album operation
       
   253         */
       
   254         TInt ShowAddToAlbumConfirmationQueryL(); 
       
   255 
       
   256     private:
       
   257         CCamCollectionManagerAO* iCollectionManagerCallBack;
       
   258         TBool iAddToAlbumRequestOngoing;
       
   259         TBool iPreviousViewStillPreCapture;
       
   260         // suppress postcapture AP until camera ready
       
   261         TBool iSuppressAPUntilCameraReady;
       
   262         TBool iPartialBackground;
       
   263     };
       
   264 
       
   265 #endif      // CAMPOSTCAPTUREVIEWBASE_H   
       
   266             
       
   267 // End of File