camerauis/cameraapp/generic/inc/CamZoomUpdateManager.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2003-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:  ???????????????????
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CCAMZOOMUPDATEMANAGER_H
       
    19 #define CCAMZOOMUPDATEMANAGER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include "CamAppController.h" // for controller definition
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 
       
    27 //CLASS DECLARATIONS
       
    28 
       
    29 /**
       
    30 *  Camera Zoom Update Class
       
    31 *
       
    32 *  Implements a cooldown period to avoid overtaxing the camera driver with touchscreen zoom updates.
       
    33 *
       
    34 *  @since 5.0
       
    35 */
       
    36 class CCamZoomUpdateManager : public CActive
       
    37     {
       
    38     public: // constructors and destructor
       
    39                 
       
    40         /**
       
    41         * Two-phased constructor.
       
    42         */
       
    43         static CCamZoomUpdateManager* NewL( CCamAppController& aController );
       
    44                 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         ~CCamZoomUpdateManager();
       
    49         
       
    50         /**
       
    51         * From CActive Does the required action (calls the observer)
       
    52         */
       
    53         void SetZoomValue( TInt aValue );
       
    54 
       
    55     protected: // from base classes
       
    56 
       
    57         /**
       
    58         * From CActive Does the required action (calls the observer)
       
    59         */
       
    60         void RunL();
       
    61 
       
    62         /**
       
    63         * From CActive Cancels pending actions
       
    64         */
       
    65         void DoCancel();
       
    66 
       
    67     private: // constructor
       
    68 
       
    69         /**
       
    70         * C++ default constructor.
       
    71         */
       
    72         CCamZoomUpdateManager( CCamAppController& aController );
       
    73 
       
    74         /**
       
    75         * Symbian 2nd phase constructor
       
    76         */
       
    77         void ConstructL();
       
    78         
       
    79         /**
       
    80         * Notify the controller and SetActive
       
    81         */
       
    82         void UpdateAndStartWait();
       
    83         
       
    84         /**
       
    85         * Get delay values from cenrep
       
    86         */
       
    87         void ReadDelayValuesL();
       
    88 
       
    89     private: // data
       
    90         
       
    91         // timer used to facilitate cooldown period
       
    92         RTimer  iTimer;
       
    93         
       
    94         // time used to force update if active object gets starved
       
    95         TTime iCooldownStart;
       
    96         
       
    97         // the value to give to the controller
       
    98         TInt iValue; 
       
    99         
       
   100         // handle outstanding update requests
       
   101         TBool iDelayedUpdate; 
       
   102         
       
   103         // reference to the controller used for setting the zoom
       
   104         CCamAppController& iController;
       
   105         
       
   106         // Variated values for cooldown period inbetween 
       
   107         // camera driver updates
       
   108         TInt iCamZoomCooldown;
       
   109         TInt iCamMaxZoomCooldown;
       
   110 
       
   111     };
       
   112 
       
   113 #endif      
       
   114             
       
   115 // End of File
       
   116 
       
   117