1 /*
2 	Actiona
3 	Copyright (C) 2005 Jonathan Mercier-Ganady
4 
5 	Actiona is free software: you can redistribute it and/or modify
6 	it under the terms of the GNU General Public License as published by
7 	the Free Software Foundation, either version 3 of the License, or
8 	(at your option) any later version.
9 
10 	Actiona is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 	GNU General Public License for more details.
14 
15 	You should have received a copy of the GNU General Public License
16 	along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 	Contact : jmgr@jmgr.info
19 */
20 
21 #pragma once
22 
23 #include "actiontools_global.h"
24 
25 #include <QWidget>
26 #include <QTimer>
27 
28 namespace Ui
29 {
30     class PointListWidget;
31 }
32 
33 namespace ActionTools
34 {
35 	class ACTIONTOOLSSHARED_EXPORT PointListWidget : public QWidget
36 	{
37 		Q_OBJECT
38 
39 	public:
40 		explicit PointListWidget(QWidget *parent = nullptr);
41 		~PointListWidget() override;
42 
43 		QPolygon points() const;
44 		void setPoints(const QPolygon &points);
45 
46 		void addPoint(const QPoint &point);
47 		void clear();
48 
49 	private slots:
50 		void on_addPushButton_clicked();
51 		void on_addPositionPushButton_clicked();
52 		void on_removePushButton_clicked();
53 		void on_clearPushButton_clicked();
54         void positionChosen(QPointF position);
55 		void on_list_itemSelectionChanged();
56 		void on_capturePathPushButton_chooseStarted();
57 		void capture();
58 		void stopCapture();
59 
60 	private:
61 		void updateClearStatus();
62 
63 		Ui::PointListWidget *ui;
64 		QTimer mCaptureTimer;
65 
66 		Q_DISABLE_COPY(PointListWidget)
67 	};
68 }
69 
70