camerauis/cameraxui/cxengine/inc/api/cxeimagedataitem.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-2010 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 CXEIMAGEDATAITEM_H
       
    18 #define CXEIMAGEDATAITEM_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QString>
       
    22 #include <QMetaType>
       
    23 
       
    24 #include "cxeerror.h"
       
    25 
       
    26 /**
       
    27  * CxeImageDataItem represents a single object that is in a queue to be saved to
       
    28  * the file system.
       
    29  */
       
    30 class CxeImageDataItem : public QObject
       
    31 {
       
    32     Q_OBJECT
       
    33 
       
    34 public:
       
    35     // State Machine
       
    36     enum State {
       
    37         SavePending = 0x01,
       
    38         Saving      = 0x02,
       
    39         Saved       = 0x04,
       
    40         SaveFailed  = 0x08
       
    41         };
       
    42 
       
    43     /**
       
    44      * Helper method to save file to Fs
       
    45      * @return symbian error code
       
    46      */
       
    47     virtual CxeError::Id save() = 0;
       
    48 
       
    49     /**
       
    50      * Get the current state for this item.
       
    51      *
       
    52      * @return State
       
    53      */
       
    54     virtual State state() const = 0;
       
    55 
       
    56     /**
       
    57      * Get the id of this item.
       
    58      */
       
    59     virtual int id() const = 0;
       
    60 
       
    61     /**
       
    62      * Get the id of this item.
       
    63      */
       
    64     virtual QString path() const = 0;
       
    65 
       
    66 signals:
       
    67     void imageSaved(CxeError::Id error, const QString &filename, int id);
       
    68     void stateChanged(State newState, CxeError::Id error);
       
    69 
       
    70 protected:
       
    71     CxeImageDataItem() {}
       
    72 
       
    73 private:
       
    74     Q_DISABLE_COPY(CxeImageDataItem)
       
    75 };
       
    76 
       
    77 Q_DECLARE_METATYPE(CxeImageDataItem::State)
       
    78 
       
    79 #endif // CXEIMAGEDATAITEM_H