camerauis/cameraxui/cxengine/inc/api/cxeimagedataitem.h
changeset 19 d9aefe59d544
child 45 24fd82631616
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/camerauis/cameraxui/cxengine/inc/api/cxeimagedataitem.h	Fri Apr 16 14:51:30 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2009 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 CXEIMAGEDATAITEM_H
+#define CXEIMAGEDATAITEM_H
+
+#include <QObject>
+#include <QString>
+#include <QMetaType>
+
+#include "cxeerror.h"
+
+class CxeImageDataItem;
+class QImage;
+
+/**
+ * CxeImageDataItem represents a single object that is in a queue to be saved to
+ * the file system.
+ */
+class CxeImageDataItem : public QObject
+{
+    Q_OBJECT
+
+public:
+    // State Machine
+    enum State {
+        SavePending = 0x01,
+        Saving      = 0x02,
+        Saved       = 0x04,
+        SaveFailed  = 0x08
+        };
+
+    /**
+     * Helper method to save file to Fs
+     * @return symbian error code
+     */
+    virtual CxeError::Id save() = 0;
+
+    /**
+     * Get the current state for this item.
+     *
+     * @return State
+     */
+    virtual State state() const = 0;
+
+    /**
+     * Get the id of this item.
+     */
+    virtual int id() const = 0;
+
+    /**
+     * Get the id of this item.
+     */
+    virtual QString path() const = 0;
+
+signals:
+    void imageSaved(CxeError::Id error, const QString& filename, int id);
+    void stateChanged( State newState, CxeError::Id error );
+
+protected:
+    CxeImageDataItem() {}
+
+private:
+    Q_DISABLE_COPY(CxeImageDataItem)
+};
+
+Q_DECLARE_METATYPE(CxeImageDataItem::State)
+
+#endif // CXEIMAGEDATAITEM_H