summaryrefslogtreecommitdiffstats
path: root/digikam/imageplugins/hotpixels/blackframelistview.h
blob: fe296d01cb41fb5ed8b39240844c8c3e94173390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2005-07-05
 * Description : a ListView to display black frames
 * 
 * Copyright (C) 2005-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
 * Copyright (C) 2005-2006 by Unai Garro <ugarro at users dot sourceforge dot net>
 * 
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option)
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * ============================================================ */

#ifndef BLACKFRAMELISTVIEW_H
#define BLACKFRAMELISTVIEW_H

// TQt includes.

#include <tqimage.h>
#include <tqstring.h>
#include <tqsize.h>
#include <tqpoint.h>
#include <tqvaluelist.h>
#include <tqlistview.h>

// KDE includes.

#include <kurl.h>
#include <tdelocale.h>

// Local includes.

#include "blackframeparser.h"
#include "hotpixel.h"

namespace DigikamHotPixelsImagesPlugin
{

class BlackFrameListView : public TQListView
{
    Q_OBJECT
  

public:

    BlackFrameListView(TQWidget* parent=0);
    ~BlackFrameListView(){};

signals:

    void blackFrameSelected(TQValueList<HotPixel>, const KURL&);

private slots:

    void slotParsed(TQValueList<HotPixel> hotPixels, const KURL& blackFrameURL)
    {
       emit blackFrameSelected(hotPixels, blackFrameURL);
    };
};

// --------------------------------------------------------------------------

class BlackFrameListViewItem : public TQObject, TQListViewItem
{
Q_OBJECT
  

public:

    BlackFrameListViewItem(BlackFrameListView* parent, const KURL &url);
    ~BlackFrameListViewItem(){};

    virtual TQString text(int column)const;
    virtual void paintCell(TQPainter* p, const TQColorGroup& cg, int column, int width, int align);
    virtual int width(const TQFontMetrics& fm, const TQListView* lv, int c)const;

signals:

    void parsed(TQValueList<HotPixel>, const KURL&);
    void signalLoadingProgress(float);
    void signalLoadingComplete();

protected:

    void activate();

private:

    TQPixmap thumb(const TQSize& size);

private slots:

    void slotParsed(TQValueList<HotPixel>);

private:

    // Data contained within each listview item
    TQImage                m_thumb;
    TQImage                m_image;

    TQSize                 m_imageSize;

    TQValueList <HotPixel> m_hotPixels;

    TQString               m_blackFrameDesc;

    KURL                  m_blackFrameURL;

    BlackFrameParser     *m_parser;

    BlackFrameListView   *m_parent;
};

}  // NameSpace DigikamHotPixelsImagesPlugin

#endif  // BLACKFRAMELISTVIEW_H