summaryrefslogtreecommitdiffstats
path: root/src/qphotorec.h
blob: f5efb3679b358939f92145f59ce58b40dcbe540a (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
//
// C++ Interface: qphotorec
//
// Description: 
//
//
// Author: TestDisk and PhotoRec are written and maintained by Christophe GRENIER <grenier@cgsecurity.org>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef QPHOTOREC_H
#define QPHOTOREC_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <QWidget>
#include <QListWidget>
#include <QComboBox>
#include <QTableWidget>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QRadioButton>
#include <QProgressBar>
#include "types.h"
#include "common.h"
#include "filegen.h"
#include "photorec.h"

class QPhotorec: public QWidget
{
  	Q_OBJECT

        public:
                QPhotorec(QWidget *parent = 0);
		~QPhotorec();
        private slots:
		/* Setup recovery UI */
	  	void disk_changed(int index);
		void partition_selected();
		void setExistingDirectory();
		void qphotorec_search();
		void buttons_updateUI();
		/* Recovery UI */
		void qphotorec_search_updateUI();
		void stop_and_quit();
	protected:
                void setupUI();
		void clearWidgets();
                int no_disk_warning();
		QWidget *copyright(QWidget * qwparent = 0);
		QTableWidgetItem *offset_to_item(const disk_t *disk, const uint64_t offset);
		void PartListWidget_updateUI();
		int photorec(alloc_data_t *list_search_space);
		pstatus_t photorec_find_blocksize(alloc_data_t *list_search_space);
		pstatus_t photorec_aux(alloc_data_t *list_search_space);
		void qphotorec_search_setupUI();
		void photorec_info(const file_stat_t *file_stats);
	signals:
		void finished();
        private:
		/* */
		list_disk_t		*list_disk;
		disk_t      		*selected_disk;
		list_part_t 		*list_part;
		partition_t 		*selected_partition;
		struct ph_param 	*params;
		struct ph_options 	*options;
		bool			stop_the_recovery;
		/* Setup recovery UI */
                QComboBox 		*HDDlistWidget;
                QTableWidget 		*PartListWidget;
		QLineEdit 		*directoryLabel;
		QPushButton 		*button_search;
		QRadioButton 		*qextRadioButton;
		QRadioButton 		*qfatRadioButton;
		QRadioButton 		*qfreeRadioButton;
		QRadioButton 		*qwholeRadioButton;
		/* Recovery UI */
		QLabel 			*progress_info;
		QLabel 			*progress_filefound;
		QProgressBar 		*progress_bar;
		QTimer 			*timer;
                QTableWidget 		*filestatsWidget;
};
#endif