blob: 60330b182cc573f71ea189a2acc3047ae74c36d0 [file] [log] [blame] [raw]
/* PE Header Editor
Copyright 2007-2014 PC GO Ld.
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 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.
*/
#ifndef _MAINWINDOW_H
#define _MAINWINDOW_H
#include <stdint.h>
#include <QtGui/QMainWindow>
#define VERSION "1.0"
namespace Ui {
class MainWindow;
}
class QSettings;
class QTreeWidget;
class QTreeWidgetItem;
typedef struct portable_executable PortableExecutable;
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void load(const QString &);
void load_ui_layout();
QSettings *config;
private:
Ui::MainWindow *ui;
bool save_file(const QString &);
bool maybe_save();
void set_current_file(const QString &);
QString stripped_name(const QString &);
void init_value_reference();
void set_pe_header_item(const QString &, uint8_t, const QString &);
void set_pe_header_item(const QString &, uint16_t, const QString &);
void set_pe_header_item(const QString &, uint32_t, const QString &);
void set_pe_header_item(const QString &, const QString &, const QString &, const QString &);
QString get_comment_from_value_reference(const QTreeWidget *, const QString &);
QString get_comment_and_update(const QString &, uint32_t, bool, bool);
//void update_references(const QString &);
void update_table();
void save_ui_layout();
PortableExecutable *pe;
unsigned char pe_offset;
bool is_modified;
//bool is_untitled;
QString current_file;
private slots:
void open_file();
bool save_file();
bool save_file_as();
void modified();
void update_item_value(QTreeWidgetItem *);
void update_references(QTreeWidgetItem *);
void edit_item(QTreeWidgetItem *, int);
void about();
void options();
protected:
void closeEvent(QCloseEvent *);
};
#endif // _MAINWINDOW_H