camerauis/cameraxui/cxengine/inc/cxestillcapturecontrolsymbian.h
changeset 38 0f0b4c1d7744
parent 28 3075d9b614e6
child 36 b12f3922a74f
equal deleted inserted replaced
28:3075d9b614e6 38:0f0b4c1d7744
    36 class MCameraBuffer;
    36 class MCameraBuffer;
    37 class CxeStillImageSymbian;
    37 class CxeStillImageSymbian;
    38 class CxeImageDataQueue;
    38 class CxeImageDataQueue;
    39 class CxeImageDataQueueSymbian;
    39 class CxeImageDataQueueSymbian;
    40 class CxeViewfinderControl;
    40 class CxeViewfinderControl;
       
    41 class CxeSnapshotControl;
    41 class CxeSensorEventHandler;
    42 class CxeSensorEventHandler;
    42 class CxeCameraDeviceControl;
    43 class CxeCameraDeviceControl;
    43 class CxeAutoFocusControl;
    44 class CxeAutoFocusControl;
    44 class CxeSettings;
    45 class CxeSettings;
    45 class CxeQualityPresets;
    46 class CxeQualityPresets;
    57 
    58 
    58 public:  // constructors
    59 public:  // constructors
    59 
    60 
    60     CxeStillCaptureControlSymbian(CxeCameraDevice &cameraDevice,
    61     CxeStillCaptureControlSymbian(CxeCameraDevice &cameraDevice,
    61                                   CxeViewfinderControl &viewfinderControl,
    62                                   CxeViewfinderControl &viewfinderControl,
       
    63                                   CxeSnapshotControl &snapshotControl,
    62                                   CxeCameraDeviceControl &cameraDeviceControl,
    64                                   CxeCameraDeviceControl &cameraDeviceControl,
    63                                   CxeFilenameGenerator &nameGenerator,
    65                                   CxeFilenameGenerator &nameGenerator,
    64                                   CxeSensorEventHandler &sensorEventHandler,
    66                                   CxeSensorEventHandler &sensorEventHandler,
    65                                   CxeAutoFocusControl &autoFocusControl,
    67                                   CxeAutoFocusControl &autoFocusControl,
    66                                   CxeSettings &settings,
    68                                   CxeSettings &settings,
   103 
   105 
   104     // notification for when camera is released
   106     // notification for when camera is released
   105     void prepareForRelease();
   107     void prepareForRelease();
   106 
   108 
   107     // ECam events
   109     // ECam events
   108     void handleCameraEvent( int eventUid, int error );
       
   109     void handleImageData( MCameraBuffer *buffer, int error );
   110     void handleImageData( MCameraBuffer *buffer, int error );
       
   111 
       
   112     // Snapshot event
       
   113     void handleSnapshotReady(CxeError::Id status, const QPixmap& snapshot);
   110 
   114 
   111     // settings call back
   115     // settings call back
   112     void handleSettingValueChanged(const QString& settingId,QVariant newValue);
   116     void handleSettingValueChanged(const QString& settingId,QVariant newValue);
   113 
   117 
   114     // Disk space change
   118     // Disk space change
   126     void setOrientation(QVariant sensorData);
   130     void setOrientation(QVariant sensorData);
   127     CxeStillImageSymbian* getImageForIndex(int index);
   131     CxeStillImageSymbian* getImageForIndex(int index);
   128     CCamera::TFormat supportedStillFormat(Cxe::CameraIndex cameraIndex);
   132     CCamera::TFormat supportedStillFormat(Cxe::CameraIndex cameraIndex);
   129     int prepareStillSnapshot();
   133     int prepareStillSnapshot();
   130     CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo);
   134     CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo);
   131     TSize getSnapshotSize() const;
       
   132     void handleSnapshotEvent(CxeError::Id error);
   135     void handleSnapshotEvent(CxeError::Id error);
   133     QPixmap extractSnapshot();
       
   134     void initializeStates();
   136     void initializeStates();
   135     void prepare();
   137     void prepare();
   136     void updateRemainingImagesCounter();
   138     void updateRemainingImagesCounter();
   137     int calculateRemainingImages(int estimatedImagesize);
   139     int calculateRemainingImages(int estimatedImagesize);
   138 
   140 
   139 private: // private data
   141 private: // private data
   140 
   142 
   141     CxeImageDataQueueSymbian *mImageDataQueue;  // own
   143     CxeImageDataQueueSymbian *mImageDataQueue;  // own
   142     CxeCameraDevice &mCameraDevice;
   144     CxeCameraDevice &mCameraDevice;
   143     CxeViewfinderControl &mViewfinderControl;
   145     CxeViewfinderControl &mViewfinderControl;
       
   146     CxeSnapshotControl &mSnapshotControl;
   144     CxeCameraDeviceControl &mCameraDeviceControl;
   147     CxeCameraDeviceControl &mCameraDeviceControl;
   145     CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control?
   148     CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control?
   146     CxeSensorEventHandler &mSensorEventHandler;
   149     CxeSensorEventHandler &mSensorEventHandler;
   147     CxeAutoFocusControl &mAutoFocusControl;
   150     CxeAutoFocusControl &mAutoFocusControl;
   148     CxeSettings &mSettings;
   151     CxeSettings &mSettings;
   160     QList<CxeImageDetails> mIcmSupportedImageResolutions;
   163     QList<CxeImageDetails> mIcmSupportedImageResolutions;
   161     //still resolutions supported by ecam
   164     //still resolutions supported by ecam
   162     QList<TSize> mECamSupportedImageResolutions;
   165     QList<TSize> mECamSupportedImageResolutions;
   163     //current image quality details in use
   166     //current image quality details in use
   164     CxeImageDetails mCurrentImageDetails;
   167     CxeImageDetails mCurrentImageDetails;
   165 
       
   166 private: // Helper class
       
   167 
       
   168     class CxeCameraBufferCleanup
       
   169     {
       
   170     public:
       
   171         CxeCameraBufferCleanup(MCameraBuffer* buffer) : mBuffer(buffer) {}
       
   172         ~CxeCameraBufferCleanup() { if (mBuffer) { mBuffer->Release(); } }
       
   173 
       
   174     private:
       
   175         Q_DISABLE_COPY(CxeCameraBufferCleanup)
       
   176 
       
   177         MCameraBuffer* mBuffer;
       
   178     };
       
   179 };
   168 };
   180 
   169 
   181 #endif // CXESTILLCAPTURECONTROLSYMBIAN_H
   170 #endif // CXESTILLCAPTURECONTROLSYMBIAN_H