1 /* |
|
2 * Copyright (c) 2009 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 CXEIMAGEDATAQUEUE_H |
|
18 #define CXEIMAGEDATAQUEUE_H |
|
19 |
|
20 #include <QObject> |
|
21 |
|
22 class CxeImageDataItem; |
|
23 |
|
24 class QImage; |
|
25 |
|
26 /** |
|
27 * CxeImageDataQueue is responsible managing a queue of objects that are saved to |
|
28 * the file system in the background |
|
29 */ |
|
30 class CxeImageDataQueue : public QObject |
|
31 { |
|
32 Q_OBJECT |
|
33 public: |
|
34 /** |
|
35 * Get the number of objects in the queue. |
|
36 * |
|
37 * @return The number of items in the queue |
|
38 */ |
|
39 virtual int size() const = 0; |
|
40 |
|
41 /** |
|
42 * Clear the queue, cancel the current save operation (if any) and destroy |
|
43 * all unsaved objects |
|
44 */ |
|
45 virtual void clear() = 0; |
|
46 |
|
47 //virtual void deleteImage( int index ) = 0; |
|
48 //virtual void renameImage( int index, const QString& path ) = 0; |
|
49 |
|
50 /** |
|
51 * Access individual items in the queue. |
|
52 * |
|
53 * @param index Item index. Must be 0 <= index < size() |
|
54 * @return Reference to the item |
|
55 */ |
|
56 virtual CxeImageDataItem &operator[]( int index ) = 0; |
|
57 |
|
58 signals: |
|
59 |
|
60 void fileSaved( int index, int error ); // index, error |
|
61 |
|
62 protected: |
|
63 CxeImageDataQueue() {} |
|
64 |
|
65 private: |
|
66 Q_DISABLE_COPY( CxeImageDataQueue ) |
|
67 }; |
|
68 |
|
69 #endif // CXEIMAGEDATAQUEUE_H |
|