camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakeengine.h
changeset 19 d9aefe59d544
child 37 64817133cd1d
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
       
     1 /*
       
     2 * Copyright (c) 2009 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 #ifndef CXEFAKEENGINE_H
       
    18 #define CXEFAKEENGINE_H
       
    19 
       
    20 #include <QObject>
       
    21 #include "cxeengine.h"
       
    22 #include "cxestillcapturecontrolsymbian.h"
       
    23 #include "cxevideocapturecontrolsymbian.h"
       
    24 #include "cxeautofocuscontrolsymbian.h"
       
    25 #include "cxecameradevicecontrolsymbian.h"
       
    26 #include "cxezoomcontrolsymbian.h"
       
    27 #include "cxeimagedataqueuesymbian.h"
       
    28 #include "cxefilenamegeneratorsymbian.h"
       
    29 #include "cxefakestillcapturecontrol.h"
       
    30 #include "cxefakecameradevicecontrol.h"
       
    31 
       
    32 
       
    33 class CxeCameraDeviceControl;
       
    34 class CxeCameraDeviceControlSymbian;
       
    35 class CxeViewfinderControl;
       
    36 class CxeFakeViewfinderControl;
       
    37 class CxeStillCaptureControl;
       
    38 class CxeStillCaptureControlSymbian;
       
    39 class CxeVideoCaptureControl;
       
    40 class CxeVideoCaptureControlSymbian;
       
    41 class CxeAutoFocusControl;
       
    42 class CxeFeatureManager;
       
    43 class CxeAutoFocusControlSymbian;
       
    44 class CxeSettings;
       
    45 class CxeFeatureManager;
       
    46 class CxeSettingsModel;
       
    47 class CxeFakeStillCaptureControl;
       
    48 class CxeFakeAutoFocusControl;
       
    49 
       
    50 class CxeFakeEngine : public CxeEngine
       
    51 {
       
    52     Q_OBJECT
       
    53 public:
       
    54     CxeFakeEngine();
       
    55     ~CxeFakeEngine();
       
    56 
       
    57     CxeCameraDeviceControl &cameraDeviceControl();
       
    58     CxeViewfinderControl &viewfinderControl();
       
    59     CxeStillCaptureControlSymbian &stillCaptureControl();
       
    60     CxeVideoCaptureControlSymbian &videoCaptureControl();
       
    61     CxeAutoFocusControlSymbian &autoFocusControl();
       
    62     CxeZoomControlSymbian &zoomControl();
       
    63     CxeSettings &settings();
       
    64     CxeFeatureManager &featureManager();
       
    65     Cxe::CameraMode mode() const;
       
    66     void initMode(Cxe::CameraMode cameraMode);
       
    67     bool isEngineReady();
       
    68 
       
    69     // Added for testing purposes
       
    70     void initModeFake(Cxe::CameraMode cameraMode);
       
    71     static CxeFakeEngine* createFakeEngine();
       
    72     CxeFakeStillCaptureControl &fakeStillCaptureControl();
       
    73 
       
    74 private slots:
       
    75     /**
       
    76      * Prepare current capture control (CxeVideoCaptureControl in video mode,
       
    77      * CxeStillCaptureControl in still image mode).
       
    78      */
       
    79     void doInit();
       
    80 
       
    81 private:
       
    82 
       
    83     /**
       
    84      * Used by initMode() to check if we need to prepare image/video
       
    85      * capture using doInit().
       
    86      */
       
    87     bool initNeeded();
       
    88 
       
    89     /**
       
    90      * Used by initMode() to check if we need to start viewfinder.
       
    91      */
       
    92     bool startViewfinderNeeded();
       
    93     /**
       
    94      * Used by initMode() to check if we need to reserve camera.
       
    95      */
       
    96     bool reserveNeeded();
       
    97 
       
    98 
       
    99 private:
       
   100     //CxeCameraDeviceControlSymbian *mCameraDeviceControl;
       
   101     CxeFakeCameraDeviceControl *mFakeCameraDeviceControl;
       
   102     CxeFakeViewfinderControl *mViewfinderControl;
       
   103     //CxeStillCaptureControlSymbian *mStillCaptureControl;
       
   104     CxeVideoCaptureControlSymbian *mVideoCaptureControl;
       
   105     CxeFakeAutoFocusControl *mFakeAutoFocusControl;
       
   106     //CxeAutoFocusControlSymbian *mAutoFocusControl;
       
   107     CxeZoomControlSymbian *mZoomControl;
       
   108     CxeSettings *mSettings;
       
   109     CxeFeatureManager *mFeatureManager;
       
   110     CxeSettingsModel *mSettingsModel;
       
   111     CxeSoundPlayerSymbian *mSoundPlayer;
       
   112     CxeFilenameGeneratorSymbian *mFilenameGenerator;
       
   113 
       
   114     // Members created for testing purposes
       
   115     CxeFakeStillCaptureControl *mFakeStillCaptureControl;
       
   116 };
       
   117 
       
   118 
       
   119 #endif  // CXEFAKEENGINE_H
       
   120