1 //
2 // C++ Interface: qphotorec
3 //
4 // Description:
5 //
6 //
7 // Author: TestDisk and PhotoRec are written and maintained by Christophe GRENIER <grenier@cgsecurity.org>, (C) 2008
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef QPHOTOREC_H
13 #define QPHOTOREC_H
14 #ifdef HAVE_CONFIG_H
15 #include <config.h>
16 #endif
17 #include <stdio.h>
18 #include <QWidget>
19 #include <QListWidget>
20 #include <QComboBox>
21 #include <QTableWidget>
22 #include <QPushButton>
23 #include <QLabel>
24 #include <QLineEdit>
25 #include <QRadioButton>
26 #include <QProgressBar>
27 #include "types.h"
28 #include "common.h"
29 #include "filegen.h"
30 #include "photorec.h"
31 
32 class QPhotorec: public QWidget
33 {
34   	Q_OBJECT
35 
36         public:
37                 QPhotorec(QWidget *parent = 0);
38 		~QPhotorec();
39         private slots:
40 		/* Setup recovery UI */
41 	  	void disk_changed(int index);
42 		void partition_selected();
43 		void setExistingDirectory();
44 		void newSourceFile();
45 		void qphotorec_about();
46 		void qphotorec_formats();
47 		void qphotorec_search();
48 		void buttons_updateUI();
49 		/* Recovery UI */
50 		void qphotorec_search_updateUI();
51 		void stop_and_quit();
52 		/* Formats */
53 		void formats_reset();
54 		void formats_restore();
55 	protected:
56                 void setupUI();
57 		void clearWidgets();
58                 int no_disk_warning();
59 		QWidget *copyright(QWidget * qwparent = 0);
60 		QTableWidgetItem *offset_to_item(const disk_t *disk, const uint64_t offset);
61 		void PartListWidget_updateUI();
62 		void HDDlistWidget_updateUI();
63 		int photorec(alloc_data_t *list_search_space);
64 		pstatus_t photorec_find_blocksize(alloc_data_t *list_search_space);
65 		pstatus_t photorec_aux(alloc_data_t *list_search_space);
66 		void qphotorec_search_setupUI();
67 		void photorec_info(const file_stat_t *file_stats);
68 		void select_disk(disk_t *disk);
69 	signals:
70 		void finished();
71         private:
72 		/* */
73 		list_disk_t		*list_disk;
74 		disk_t      		*selected_disk;
75 		list_part_t 		*list_part;
76 		partition_t 		*selected_partition;
77 		struct ph_param 	*params;
78 		struct ph_options 	*options;
79 		bool			stop_the_recovery;
80 		/* Setup recovery UI */
81                 QComboBox 		*HDDlistWidget;
82                 QTableWidget 		*PartListWidget;
83 		QLineEdit 		*directoryLabel;
84 		QPushButton 		*button_search;
85 		QRadioButton 		*qextRadioButton;
86 		QRadioButton 		*qfatRadioButton;
87 		QRadioButton 		*qfreeRadioButton;
88 		QRadioButton 		*qwholeRadioButton;
89 		/* Recovery UI */
90 		QLabel			*folder_txt;
91 		QLabel 			*progress_info;
92 		QLabel 			*progress_filefound;
93 		QProgressBar 		*progress_bar;
94 		QTimer 			*timer;
95                 QTableWidget 		*filestatsWidget;
96 		/* Formats */
97 		QListWidget		*formats;
98 
99 };
100 #endif
101