camerauis/cameraxui/cxengine/inc/cxeautofocuscontrolsymbian.h
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    25 #include "cxeautofocuscontrol.h"
    25 #include "cxeautofocuscontrol.h"
    26 #include "cxestatemachine.h"
    26 #include "cxestatemachine.h"
    27 
    27 
    28 //forward declarations
    28 //forward declarations
    29 class CxeCameraDevice;
    29 class CxeCameraDevice;
       
    30 class CxeSettings;
    30 
    31 
    31 
    32 
    32 
    33 
    33 /**
    34 /**
    34  * CxeAutoFocusControl is responsible for handling Autofocus events from the camera adaptation.
    35  * CxeAutoFocusControl is responsible for handling Autofocus events from the camera adaptation.
    39                                    public CxeStateMachine
    40                                    public CxeStateMachine
    40     {
    41     {
    41     Q_OBJECT
    42     Q_OBJECT
    42 public:
    43 public:
    43 
    44 
    44     CxeAutoFocusControlSymbian( CxeCameraDevice &cameraDevice );
    45     CxeAutoFocusControlSymbian( CxeCameraDevice &cameraDevice, CxeSettings &settings );
    45     virtual ~CxeAutoFocusControlSymbian();
    46     virtual ~CxeAutoFocusControlSymbian();
    46 
    47 
    47     CxeError::Id  start(bool soundEnabled = true);
    48     CxeError::Id  start(bool soundEnabled = true);
    48     void cancel();
    49     void cancel();
    49     void setMode( CxeAutoFocusControl::Mode newMode );
    50     void setMode( CxeAutoFocusControl::Mode newMode );
    50     CxeAutoFocusControl::Mode mode() const;
    51     CxeAutoFocusControl::Mode mode() const;
       
    52     bool isFixedFocusMode(CxeAutoFocusControl::Mode mode) const;
    51 
    53 
    52     CxeAutoFocusControl::State state() const;
    54     CxeAutoFocusControl::State state() const;
    53     bool supported() const;
    55     bool supported() const;
    54 
    56 
    55     bool isSoundEnabled() const;
    57     bool isSoundEnabled() const;
    78     // notification for when camera is released
    80     // notification for when camera is released
    79     void prepareForRelease();
    81     void prepareForRelease();
    80 
    82 
    81     // Handle ECam events
    83     // Handle ECam events
    82     void handleCameraEvent( int eventUid, int error );
    84     void handleCameraEvent( int eventUid, int error );
    83     void handleSceneChanged(CxeScene& scene);
    85     void handleSceneChanged(CxeScene &scene);
       
    86     void handleSettingValueChanged(const QString &settingId, QVariant newValue);
    84 
    87 
    85 private:
    88 private:
    86 
    89 
    87     // handles to-do things if the event is AF event
    90     // handles to-do things if the event is AF event
    88     void handleAfEvent(int eventUid, int error);
    91     void handleAfEvent(int eventUid, int error);
    90 protected:
    93 protected:
    91     CxeCameraDevice &mCameraDevice;
    94     CxeCameraDevice &mCameraDevice;
    92     CCamera::CCameraAdvancedSettings *mAdvancedSettings; // not owned
    95     CCamera::CCameraAdvancedSettings *mAdvancedSettings; // not owned
    93     CxeAutoFocusControl::Mode mAfMode;
    96     CxeAutoFocusControl::Mode mAfMode;
    94     CCamera::CCameraAdvancedSettings::TFocusRange mAFRange;
    97     CCamera::CCameraAdvancedSettings::TFocusRange mAFRange;
       
    98     CxeSettings &mSettings;
    95     bool mCancelled;
    99     bool mCancelled;
    96     bool mSoundEnabled;
   100     bool mSoundEnabled;
       
   101     bool mFaceTrackingOverride; //need for temporary override of the AF mode if FT is enabled by user
       
   102     CxeAutoFocusControl::Mode mPreviousAFMode; //for restoring previous AF mode in case of FT override
    97     };
   103     };
    98 
   104 
    99 #endif // CXEAUTOFOCUSCONTROLSYMBIAN_H
   105 #endif // CXEAUTOFOCUSCONTROLSYMBIAN_H