camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakeengine.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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 setMode(Cxe::CameraMode mode);
       
    67     void initMode(Cxe::CameraMode cameraMode);
       
    68     bool isEngineReady();
       
    69 
       
    70     // Added for testing purposes
       
    71     void initModeFake(Cxe::CameraMode cameraMode);
       
    72     static CxeFakeEngine* createFakeEngine();
       
    73     CxeFakeStillCaptureControl &fakeStillCaptureControl();
       
    74 
       
    75 private slots:
       
    76     /**
       
    77      * Prepare current capture control (CxeVideoCaptureControl in video mode,
       
    78      * CxeStillCaptureControl in still image mode).
       
    79      */
       
    80     void doInit();
       
    81 
       
    82 private:
       
    83 
       
    84     /**
       
    85      * Used by initMode() to check if we need to prepare image/video
       
    86      * capture using doInit().
       
    87      */
       
    88     bool initNeeded();
       
    89 
       
    90     /**
       
    91      * Used by initMode() to check if we need to start viewfinder.
       
    92      */
       
    93     bool startViewfinderNeeded();
       
    94     /**
       
    95      * Used by initMode() to check if we need to reserve camera.
       
    96      */
       
    97     bool reserveNeeded();
       
    98 
       
    99 
       
   100 private:
       
   101     //CxeCameraDeviceControlSymbian *mCameraDeviceControl;
       
   102     CxeFakeCameraDeviceControl *mFakeCameraDeviceControl;
       
   103     CxeFakeViewfinderControl *mViewfinderControl;
       
   104     //CxeStillCaptureControlSymbian *mStillCaptureControl;
       
   105     CxeVideoCaptureControlSymbian *mVideoCaptureControl;
       
   106     CxeFakeAutoFocusControl *mFakeAutoFocusControl;
       
   107     //CxeAutoFocusControlSymbian *mAutoFocusControl;
       
   108     CxeZoomControlSymbian *mZoomControl;
       
   109     CxeSettings *mSettings;
       
   110     CxeFeatureManager *mFeatureManager;
       
   111     CxeSettingsModel *mSettingsModel;
       
   112     CxeSoundPlayerSymbian *mSoundPlayer;
       
   113     CxeFilenameGeneratorSymbian *mFilenameGenerator;
       
   114 
       
   115     // Members created for testing purposes
       
   116     CxeFakeStillCaptureControl *mFakeStillCaptureControl;
       
   117 };
       
   118 
       
   119 
       
   120 #endif  // CXEFAKEENGINE_H
       
   121