camerauis/cameraapp/generic/inc/cameracontroller/camcameracontrolleractive.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:  CCamCameraControllerActive class declaration.
       
    15 *                This class presents an active object used to call back 
       
    16 *                CCamCameraController methods. This is done to keep clients
       
    17 *                not blocked when issuing a request or sequence of requests.
       
    18 *                
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef CAM_CAMERACONTROLLERACTIVE_H
       
    24 #define CAM_CAMERACONTROLLERACTIVE_H
       
    25 
       
    26 // ===========================================================================
       
    27 // Included headers
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 
       
    32 // ===========================================================================
       
    33 // Forward declarations
       
    34 
       
    35 class CCamCameraController;
       
    36 
       
    37 
       
    38 // ===========================================================================
       
    39 // Classes
       
    40 
       
    41 /**
       
    42 * Camera controller active object.
       
    43 *
       
    44 * Used to assist on asynchronising CCamCameraController requests.
       
    45 *
       
    46 */
       
    47 class CCamCameraControllerActive : public CActive
       
    48   {
       
    49   // =========================================================================
       
    50   // Methods
       
    51  
       
    52   // -------------------------------------------------------------------------
       
    53   // Constructor(s) and destructor
       
    54   public:
       
    55 
       
    56     /**
       
    57     * Static 2 phase constructor.
       
    58     * @param aController Camera controller, which callbacks will be called.
       
    59     * @param aPriority   This active object's priority.
       
    60     */
       
    61     static CCamCameraControllerActive* NewL( CCamCameraController& aController, TInt aPriority );
       
    62     
       
    63     /**
       
    64     * Destructor.
       
    65     */
       
    66     virtual ~CCamCameraControllerActive();
       
    67 
       
    68   private:
       
    69   
       
    70     /**
       
    71     * Standard Symbian 2nd phase constructor.
       
    72     */
       
    73     void ConstructL();
       
    74     
       
    75     /**
       
    76     * Standard C++ constructor.
       
    77     */
       
    78     CCamCameraControllerActive( CCamCameraController& aController, 
       
    79                                 TInt                  aPriority   );
       
    80 
       
    81   // -------------------------------------------------------------------------
       
    82   // from CActive
       
    83   protected:
       
    84   
       
    85     /**
       
    86     * Reacts to CActive::Cancel, if this AO was active.
       
    87     * @see See CActive for more info.
       
    88     */
       
    89   	virtual void DoCancel();
       
    90 
       
    91     /**
       
    92     * Calls CCamCameraController::ProcessNextRequestL. If leave occurs there,
       
    93     * RunError will be called by CActiveScheduler. Checks the return value of
       
    94     * CCamCameraController::ProcessNextRequestL and if it is not zero, sets this
       
    95     * AO ready for new iteration.
       
    96     * @see See CActive for more info.
       
    97     */
       
    98   	virtual void RunL();
       
    99 
       
   100     /**
       
   101     * Called if a leave occurs in RunL.
       
   102     * @param aError Leave code from RunL.
       
   103     * @return Always KErrNone.
       
   104     * @see See CActive for more info.
       
   105     */
       
   106   	virtual TInt RunError( TInt aError );
       
   107 
       
   108   // -------------------------------------------------------------------------
       
   109   // New methods.
       
   110   public:
       
   111 
       
   112     /**
       
   113     * Sets this Active Object to ActiveScheduler's queue.
       
   114     * RunL calls back CCamCameraController::ProcessNextRequestL.
       
   115     * If the return value is not zero, this AO will be scheduled to run again.
       
   116     * Otherwise new call to IssueRequest is needed.
       
   117     * If leave occurs in RunL, RunError calls CCameraController::EndSequence.
       
   118     */
       
   119     void IssueRequest();
       
   120 
       
   121   private:
       
   122 
       
   123     /**
       
   124     * Stop the sequence handling on error.
       
   125     * Calls CCameraController::EndSequence.
       
   126     */
       
   127     void HandleError( TInt aStatus );
       
   128 
       
   129   // =========================================================================
       
   130   // Data
       
   131   private: 
       
   132 
       
   133     /**
       
   134     * Camera controller, which callbacks will be called.
       
   135     */
       
   136     CCamCameraController& iController;
       
   137     
       
   138   // =========================================================================
       
   139   };
       
   140   
       
   141 #endif // CAM_CAMERACONTROLLERACTIVE_H
       
   142 
       
   143 // end of file