~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/imageplugins/hotpixels/blackframelistview.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

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        : 2005-07-05
 
7
 * Description : a ListView to display black frames
 
8
 * 
 
9
 * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
 
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 BLACKFRAMELISTVIEW_H
 
26
#define BLACKFRAMELISTVIEW_H
 
27
 
 
28
// Qt includes.
 
29
 
 
30
#include <qimage.h>
 
31
#include <qstring.h>
 
32
#include <qsize.h>
 
33
#include <qpoint.h>
 
34
#include <qvaluelist.h>
 
35
#include <qlistview.h>
 
36
 
 
37
// KDE includes.
 
38
 
 
39
#include <kurl.h>
 
40
#include <klocale.h>
 
41
 
 
42
// Local includes.
 
43
 
 
44
#include "blackframeparser.h"
 
45
#include "hotpixel.h"
 
46
 
 
47
namespace DigikamHotPixelsImagesPlugin
 
48
{
 
49
 
 
50
class BlackFrameListView : public QListView
 
51
{
 
52
    Q_OBJECT
 
53
 
 
54
public:
 
55
 
 
56
    BlackFrameListView(QWidget* parent=0);
 
57
    ~BlackFrameListView(){};
 
58
 
 
59
signals:
 
60
 
 
61
    void blackFrameSelected(QValueList<HotPixel>, const KURL&);
 
62
 
 
63
private slots:
 
64
 
 
65
    void slotParsed(QValueList<HotPixel> hotPixels, const KURL& blackFrameURL)
 
66
    {
 
67
       emit blackFrameSelected(hotPixels, blackFrameURL);
 
68
    };
 
69
};
 
70
 
 
71
// --------------------------------------------------------------------------
 
72
 
 
73
class BlackFrameListViewItem : public QObject, QListViewItem
 
74
{
 
75
Q_OBJECT
 
76
 
 
77
public:
 
78
 
 
79
    BlackFrameListViewItem(BlackFrameListView* parent, const KURL &url);
 
80
    ~BlackFrameListViewItem(){};
 
81
 
 
82
    virtual QString text(int column)const;
 
83
    virtual void paintCell(QPainter* p, const QColorGroup& cg, int column, int width, int align);
 
84
    virtual int width(const QFontMetrics& fm, const QListView* lv, int c)const;
 
85
 
 
86
signals:
 
87
 
 
88
    void parsed(QValueList<HotPixel>, const KURL&);
 
89
    void signalLoadingProgress(float);
 
90
    void signalLoadingComplete();
 
91
 
 
92
protected:
 
93
 
 
94
    void activate();
 
95
 
 
96
private:
 
97
 
 
98
    QPixmap thumb(const QSize& size);
 
99
 
 
100
private slots:
 
101
 
 
102
    void slotParsed(QValueList<HotPixel>);
 
103
 
 
104
private:
 
105
 
 
106
    // Data contained within each listview item
 
107
    QImage                m_thumb;
 
108
    QImage                m_image;
 
109
 
 
110
    QSize                 m_imageSize;
 
111
 
 
112
    QValueList <HotPixel> m_hotPixels;
 
113
 
 
114
    QString               m_blackFrameDesc;
 
115
 
 
116
    KURL                  m_blackFrameURL;
 
117
 
 
118
    BlackFrameParser     *m_parser;
 
119
 
 
120
    BlackFrameListView   *m_parent;
 
121
};
 
122
 
 
123
}  // NameSpace DigikamHotPixelsImagesPlugin
 
124
 
 
125
#endif  // BLACKFRAMELISTVIEW_H