2013-10-08 15:07:03 +08:00
|
|
|
/* uefitool.h
|
|
|
|
|
2014-01-11 17:20:58 +08:00
|
|
|
Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
|
2013-10-08 15:07:03 +08:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
2014-07-25 07:59:51 +08:00
|
|
|
*/
|
2013-10-08 15:07:03 +08:00
|
|
|
|
|
|
|
#ifndef __UEFITOOL_H__
|
|
|
|
#define __UEFITOOL_H__
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QByteArray>
|
2014-07-14 06:38:34 +08:00
|
|
|
#include <QClipboard>
|
2013-10-08 15:07:03 +08:00
|
|
|
#include <QDragEnterEvent>
|
|
|
|
#include <QDropEvent>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QFileDialog>
|
|
|
|
#include <QFileInfo>
|
2013-12-05 04:27:12 +08:00
|
|
|
#include <QListWidget>
|
2013-11-23 06:25:15 +08:00
|
|
|
#include <QMenu>
|
2013-10-08 15:07:03 +08:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QMimeData>
|
2013-12-05 04:27:12 +08:00
|
|
|
#include <QPlainTextEdit>
|
|
|
|
#include <QSettings>
|
|
|
|
#include <QSplitter>
|
2013-10-08 15:07:03 +08:00
|
|
|
#include <QString>
|
2013-12-05 04:27:12 +08:00
|
|
|
#include <QTreeView>
|
2013-10-08 15:07:03 +08:00
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "basetypes.h"
|
2013-11-15 18:48:14 +08:00
|
|
|
#include "ffs.h"
|
2013-10-15 23:19:15 +08:00
|
|
|
#include "ffsengine.h"
|
2013-12-05 04:27:12 +08:00
|
|
|
#include "searchdialog.h"
|
2013-10-08 15:07:03 +08:00
|
|
|
|
|
|
|
namespace Ui {
|
2014-07-25 07:59:51 +08:00
|
|
|
class UEFITool;
|
2013-10-08 15:07:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
class UEFITool : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2013-10-08 15:07:03 +08:00
|
|
|
public:
|
|
|
|
explicit UEFITool(QWidget *parent = 0);
|
|
|
|
~UEFITool();
|
|
|
|
|
|
|
|
void openImageFile(QString path);
|
|
|
|
|
2014-07-25 07:59:51 +08:00
|
|
|
private slots:
|
2013-10-08 15:07:03 +08:00
|
|
|
void init();
|
2013-12-05 04:27:12 +08:00
|
|
|
void populateUi(const QModelIndex ¤t);
|
2013-11-23 06:25:15 +08:00
|
|
|
void scrollTreeView(QListWidgetItem* item);
|
|
|
|
|
2013-12-05 04:27:12 +08:00
|
|
|
void openImageFile();
|
|
|
|
void saveImageFile();
|
2014-01-12 07:02:54 +08:00
|
|
|
void search();
|
|
|
|
|
2013-12-05 04:27:12 +08:00
|
|
|
void extract(const UINT8 mode);
|
2013-11-17 17:01:11 +08:00
|
|
|
void extractAsIs();
|
2013-11-07 21:46:28 +08:00
|
|
|
void extractBody();
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2013-12-05 04:27:12 +08:00
|
|
|
void insert(const UINT8 mode);
|
2013-11-07 21:46:28 +08:00
|
|
|
void insertInto();
|
|
|
|
void insertBefore();
|
|
|
|
void insertAfter();
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2014-01-12 07:02:54 +08:00
|
|
|
void replace(const UINT8 mode);
|
2013-12-12 19:28:39 +08:00
|
|
|
void replaceAsIs();
|
|
|
|
void replaceBody();
|
|
|
|
|
2014-01-12 07:02:54 +08:00
|
|
|
void rebuild();
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2014-01-12 07:02:54 +08:00
|
|
|
void remove();
|
|
|
|
|
2014-07-14 06:38:34 +08:00
|
|
|
void copyMessage();
|
2014-07-27 15:54:38 +08:00
|
|
|
void copyAllMessages();
|
|
|
|
void enableMessagesCopyActions(QListWidgetItem* item);
|
2014-01-12 07:02:54 +08:00
|
|
|
void clearMessages();
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2013-12-05 04:27:12 +08:00
|
|
|
void about();
|
2013-11-18 23:23:59 +08:00
|
|
|
void aboutQt();
|
2013-11-23 06:25:15 +08:00
|
|
|
|
2013-11-20 10:08:39 +08:00
|
|
|
void exit();
|
2014-01-12 07:02:54 +08:00
|
|
|
void writeSettings();
|
2013-10-08 15:07:03 +08:00
|
|
|
|
|
|
|
private:
|
2013-12-05 04:27:12 +08:00
|
|
|
Ui::UEFITool* ui;
|
2013-10-15 23:19:15 +08:00
|
|
|
FfsEngine* ffsEngine;
|
2013-12-05 04:27:12 +08:00
|
|
|
SearchDialog* searchDialog;
|
2014-07-14 06:38:34 +08:00
|
|
|
QClipboard* clipboard;
|
2014-07-25 07:59:51 +08:00
|
|
|
QString currentDir;
|
2014-11-18 23:01:20 +08:00
|
|
|
QQueue<MessageListItem> messageItems;
|
|
|
|
const QString version;
|
2014-07-14 06:38:34 +08:00
|
|
|
|
2013-12-05 04:27:12 +08:00
|
|
|
void showMessages();
|
2014-07-25 07:59:51 +08:00
|
|
|
|
2013-10-08 15:07:03 +08:00
|
|
|
void dragEnterEvent(QDragEnterEvent* event);
|
|
|
|
void dropEvent(QDropEvent* event);
|
2013-12-05 04:27:12 +08:00
|
|
|
void contextMenuEvent(QContextMenuEvent* event);
|
2014-01-12 07:02:54 +08:00
|
|
|
void readSettings();
|
2013-10-08 15:07:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|