camerauis/cameraxui/cxengine/src/cxeimagedataqueuedesktop.cpp
changeset 48 42ba2d16bf40
equal deleted inserted replaced
37:64817133cd1d 48:42ba2d16bf40
       
     1 /*
       
     2 * Copyright (c) 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 #include <QImage>
       
    18 #include <QList>
       
    19 
       
    20 #include "cxeimagedataqueuedesktop.h"
       
    21 #include "cxeimagedataitemdesktop.h"
       
    22 #include "cxutils.h"
       
    23 
       
    24 
       
    25 CxeImageDataQueueDesktop::CxeImageDataQueueDesktop()
       
    26 {
       
    27     CX_DEBUG_IN_FUNCTION();
       
    28 }
       
    29 
       
    30 CxeImageDataQueueDesktop::~CxeImageDataQueueDesktop()
       
    31 {
       
    32     CX_DEBUG_ENTER_FUNCTION();
       
    33 
       
    34     // This will delete all remaining items!
       
    35     clear();
       
    36 
       
    37     CX_DEBUG_EXIT_FUNCTION();
       
    38 }
       
    39 
       
    40 int CxeImageDataQueueDesktop::size() const
       
    41 {
       
    42     return mList.size();
       
    43 }
       
    44 
       
    45 void CxeImageDataQueueDesktop::clear()
       
    46 {
       
    47     CX_DEBUG_ENTER_FUNCTION();
       
    48 
       
    49     // This will delete all remaining items!
       
    50     mList.clear();
       
    51 
       
    52     CX_DEBUG_EXIT_FUNCTION();
       
    53 }
       
    54 
       
    55 CxeImageDataItem &CxeImageDataQueueDesktop::operator[](int index)
       
    56 {
       
    57     CX_DEBUG_ASSERT( index >= 0 && index < mList.count() );
       
    58     return *mList[index];
       
    59 }
       
    60 
       
    61 CxeImageDataItem *CxeImageDataQueueDesktop::startSave(QByteArray data, QString path, int id)
       
    62 {
       
    63     CX_DEBUG_ENTER_FUNCTION();
       
    64     
       
    65     int index = mList.size(); 
       
    66     CxeImageDataItem *dataItem = new CxeImageDataItemDesktop(index, data, path, id);
       
    67     mList.append(dataItem);
       
    68     
       
    69     CX_DEBUG_EXIT_FUNCTION();
       
    70     return dataItem;
       
    71 }