~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/imageeditor/widgets/previewlist.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2010-04-09 21:30:01 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409213001-4bfyibrd359rn7o3
Tags: 2:1.2.0-0ubuntu1
* New upstream release (LP: #560576)
* Remove all patches, fixed upstream
  - Remove quilt build-depend

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2010-02-13
 
7
 * Description : a list of selectable options with preview
 
8
 *               effects as thumbnails.
 
9
 *
 
10
 * Copyright (C) 2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#ifndef PREVIEWLIST_H
 
26
#define PREVIEWLIST_H
 
27
 
 
28
// Qt includes
 
29
 
 
30
#include <QtCore/QObject>
 
31
#include <QtGui/QPixmap>
 
32
#include <QtGui/QTreeWidget>
 
33
#include <QtGui/QTreeWidgetItem>
 
34
 
 
35
// Local includes
 
36
 
 
37
#include "digikam_export.h"
 
38
 
 
39
namespace Digikam
 
40
{
 
41
  
 
42
class DImgThreadedFilter;
 
43
class PreviewThreadWrapperPriv;
 
44
 
 
45
class DIGIKAM_EXPORT PreviewThreadWrapper : public QObject
 
46
{
 
47
    Q_OBJECT
 
48
 
 
49
public:
 
50
 
 
51
    PreviewThreadWrapper(QObject* parent=0);
 
52
    ~PreviewThreadWrapper();
 
53
    
 
54
    void registerFilter(int id, DImgThreadedFilter* filter);
 
55
    
 
56
    void startFilters();
 
57
    void stopFilters();
 
58
 
 
59
Q_SIGNALS:
 
60
 
 
61
    void signalFilterStarted(int);
 
62
    void signalFilterFinished(int, const QPixmap&);
 
63
    
 
64
private Q_SLOTS:
 
65
 
 
66
    void slotFilterStarted();
 
67
    void slotFilterFinished(bool success);
 
68
    void slotFilterProgress(int progress);
 
69
 
 
70
private:
 
71
 
 
72
    PreviewThreadWrapperPriv* const d;  
 
73
};  
 
74
 
 
75
// -------------------------------------------------------------------
 
76
 
 
77
class PreviewListItemPriv;
 
78
 
 
79
class DIGIKAM_EXPORT PreviewListItem : public QTreeWidgetItem
 
80
{
 
81
 
 
82
public:
 
83
 
 
84
    PreviewListItem(QTreeWidget* parent=0);
 
85
    ~PreviewListItem();
 
86
 
 
87
    void setPixmap(const QPixmap& pix);
 
88
 
 
89
    void setId(int id);
 
90
    int  id();
 
91
 
 
92
    void setBusy(bool b);
 
93
    bool isBusy();
 
94
 
 
95
private:
 
96
 
 
97
    PreviewListItemPriv* const d;
 
98
};
 
99
 
 
100
// -------------------------------------------------------------------
 
101
 
 
102
class PreviewListPriv;
 
103
 
 
104
class DIGIKAM_EXPORT PreviewList : public QTreeWidget
 
105
{
 
106
    Q_OBJECT
 
107
 
 
108
public:
 
109
 
 
110
    PreviewList(QObject* parent = 0);
 
111
    ~PreviewList();
 
112
 
 
113
    PreviewListItem* addItem(DImgThreadedFilter* filter, const QString& txt, int id);
 
114
 
 
115
    void setCurrentId(int id);
 
116
    int currentId();
 
117
 
 
118
    void startFilters();
 
119
    void stopFilters();
 
120
 
 
121
private Q_SLOTS:
 
122
 
 
123
    void slotProgressTimerDone();
 
124
    void slotFilterStarted(int);
 
125
    void slotFilterFinished(int, const QPixmap&);
 
126
 
 
127
private:
 
128
 
 
129
    PreviewListItem* findItem(int id);
 
130
 
 
131
private:
 
132
 
 
133
    PreviewListPriv* const d;
 
134
};
 
135
 
 
136
} // namespace Digikam
 
137
 
 
138
#endif /* PREVIEWLIST_H */