forked from scantailor/scantailor
/
StageListView.h
83 lines (64 loc) · 2.15 KB
/
StageListView.h
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
/*
Scan Tailor - Interactive post-processing tool for scanned pages.
Copyright (C) 2007-2009 Joseph Artsimovich <joseph_a@mail.ru>
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 3 of the License, 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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STAGELISTVIEW_H_
#define STAGELISTVIEW_H_
#include "IntrusivePtr.h"
#include <QTableView>
#include <QPixmap>
#include <vector>
class StageSequence;
class StageListView : public QTableView
{
Q_OBJECT
public:
StageListView(QWidget* parent);
virtual ~StageListView();
void setStages(IntrusivePtr<StageSequence> const& stages);
virtual QSize sizeHint() const { return m_sizeHint; }
signals:
void launchBatchProcessing();
public slots:
void setBatchProcessingPossible(bool possible);
void setBatchProcessingInProgress(bool in_progress);
protected slots:
virtual void selectionChanged(
QItemSelection const& selected,
QItemSelection const& deselected);
private slots:
void ensureSelectedRowVisible();
protected:
virtual void timerEvent(QTimerEvent* event);
private:
class Model;
class LeftColDelegate;
class RightColDelegate;
void removeLaunchButton(int row);
void placeLaunchButton(int row);
void initiateBatchAnimationFrameRendering();
void createBatchAnimationSequence(int square_side);
void updateRowSpans();
int selectedRow() const;
QSize m_sizeHint;
Model* m_pModel;
LeftColDelegate* m_pFirstColDelegate;
RightColDelegate* m_pSecondColDelegate;
QWidget* m_pLaunchBtn;
std::vector<QPixmap> m_batchAnimationPixmaps;
int m_curBatchAnimationFrame;
int m_timerId;
bool m_batchProcessingPossible;
bool m_batchProcessingInProgress;
};
#endif