diff -r 3075d9b614e6 -r 0f0b4c1d7744 camerauis/cameraxui/cxengine/inc/cxesnapshotcontrol.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/camerauis/cameraxui/cxengine/inc/cxesnapshotcontrol.h Thu Jul 15 01:44:30 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef CXESNAPSHOTCONTROL_H +#define CXESNAPSHOTCONTROL_H + +#include +#include "cxeerror.h" + +class CxeCameraDevice; +class CxeSnapshotControlPrivate; + +/*! +* Snapshot control class. +*/ +class CxeSnapshotControl : public QObject +{ + Q_OBJECT + +public: + + // State Machine + enum State { + //! Idle, snapshot not active. + Idle = 0x01, + //! Active, snapshot events provided after successful capture. + Active = 0x02 + }; + + + explicit CxeSnapshotControl(CxeCameraDevice &device); + virtual ~CxeSnapshotControl(); + +public: + State state() const; + QSize calculateSnapshotSize(const QSize& displaySize, const QSize& outputResolution) const; + void start(const QSize& size); + void stop(); + +signals: + void stateChanged(CxeSnapshotControl::State newState, CxeError::Id status); + void snapshotReady(CxeError::Id status, const QPixmap& snapshot); + +public slots: + void handleCameraEvent(int id, int error); + +private: + CxeSnapshotControlPrivate *d; + + Q_DISABLE_COPY(CxeSnapshotControl) + friend class CxeSnapshotControlPrivate; +}; + +Q_DECLARE_METATYPE(CxeSnapshotControl::State) + +#endif // CXESNAPSHOTCONTROL_H