camerauis/cameraapp/generic/inc/CamFileCheckAo.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Active object that checks if files have been deleted outside camera
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAMFILECHECKAO_H
       
    20 #define CAMFILECHECKAO_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <bautils.h>
       
    25 #include "CamAppController.h"
       
    26 #include "CamBurstCaptureArray.h"
       
    27 
       
    28 
       
    29 /**
       
    30 * Abstract API for file check observer. 
       
    31 * Provides an asynchronous 'callback' method to inform derived classes
       
    32 * that the file checking operation has been completed.
       
    33 *
       
    34 *  @since 2.8
       
    35 */
       
    36 class MCamFileCheckObserver
       
    37     {
       
    38     public:
       
    39         
       
    40         /**
       
    41         * Callback to notify that file checking operation has completed.
       
    42         * @param aStatus Number of files that were missing
       
    43         * @param aError  Error code
       
    44         */
       
    45         virtual void FileCheckingCompleteL( TInt aStatus, TInt aError ) = 0;
       
    46     };
       
    47 
       
    48 /**
       
    49 *  Class to manage the asynchronous file deletion checking 
       
    50 *  @since 2.8
       
    51 */
       
    52 class CCamFileCheckAo : public CActive
       
    53     {
       
    54     public:  // Constructors and destructor
       
    55         ~CCamFileCheckAo();
       
    56         /**
       
    57         * Two-phased constructor.
       
    58         * @since 2.8
       
    59         * @param aObserver Informed when image saving has completed
       
    60         */
       
    61         static CCamFileCheckAo* NewL( CCamAppController& aController, MCamFileCheckObserver& aObserver );
       
    62 
       
    63 	void Start();
       
    64 	
       
    65 	
       
    66     private:
       
    67 
       
    68         /**
       
    69         * Constructor
       
    70         * @since 2.8
       
    71         * @param aObserver Informed when image saving has completed
       
    72         */
       
    73         CCamFileCheckAo( CCamAppController& aController, MCamFileCheckObserver& aObserver  );
       
    74 
       
    75         /**
       
    76         * 2nd phase construction
       
    77         * @since 2.8
       
    78         */
       
    79         void ConstructL();
       
    80 
       
    81         /**
       
    82         * Cancels the active object
       
    83         * @since 2.8
       
    84         */
       
    85         void DoCancel();
       
    86 
       
    87         /**
       
    88         * Perform the next scheduled task
       
    89         * @since 2.8
       
    90         */
       
    91         void RunL();
       
    92 
       
    93 
       
    94         /**
       
    95         * Perform error reporting and cleanup
       
    96         * @since 2.8
       
    97         */
       
    98 	TInt RunError( TInt aError );
       
    99 
       
   100 	/**
       
   101 	*
       
   102 	*/
       
   103 	void StartRequest();
       
   104 	
       
   105     private:
       
   106 
       
   107         CCamAppController& iController;
       
   108         MCamFileCheckObserver& iObserver; // informed when file checking has completed
       
   109         
       
   110         TInt iFileIndex;
       
   111         TInt iFileCount;
       
   112         CCamBurstCaptureArray* iArray;
       
   113         RFs iFs;
       
   114         TBool iEmptyRun;	
       
   115     };
       
   116 
       
   117 #endif      // CAMFILECHECKAO_H
       
   118             
       
   119 // End of File