2019-08-19 13:35:25 +00:00
|
|
|
#ifndef ADDRESSABLEITEMCONTEXTMENU_H
|
|
|
|
#define ADDRESSABLEITEMCONTEXTMENU_H
|
|
|
|
|
|
|
|
#include "core/Cutter.h"
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QKeySequence>
|
|
|
|
|
|
|
|
class AddressableItemContextMenu : public QMenu
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
AddressableItemContextMenu(QWidget *parent, MainWindow *mainWindow);
|
|
|
|
~AddressableItemContextMenu();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Configure if addressable item refers to whole function or specific address
|
|
|
|
* @param wholeFunciton
|
|
|
|
*/
|
|
|
|
void setWholeFunction(bool wholeFunciton);
|
|
|
|
public slots:
|
|
|
|
void setOffset(RVA offset);
|
|
|
|
void setTarget(RVA offset, QString name = QString());
|
2019-09-01 21:30:25 +00:00
|
|
|
void clearTarget();
|
|
|
|
signals:
|
|
|
|
void xrefsTriggered();
|
2019-08-19 13:35:25 +00:00
|
|
|
private:
|
|
|
|
void onActionCopyAddress();
|
|
|
|
void onActionShowXrefs();
|
|
|
|
void onActionAddComment();
|
|
|
|
|
|
|
|
virtual void aboutToShowSlot();
|
|
|
|
|
|
|
|
MainWindow *mainWindow;
|
|
|
|
|
|
|
|
RVA offset;
|
2019-09-01 21:30:25 +00:00
|
|
|
bool hasTarget = false;
|
2019-08-19 13:35:25 +00:00
|
|
|
protected:
|
2019-09-01 21:30:25 +00:00
|
|
|
void setHasTarget(bool hasTarget);
|
2019-08-19 13:35:25 +00:00
|
|
|
QAction actionShowInMenu;
|
|
|
|
QAction actionCopyAddress;
|
|
|
|
QAction actionShowXrefs;
|
|
|
|
QAction actionAddcomment;
|
|
|
|
|
|
|
|
QString name;
|
|
|
|
bool wholeFunction = false;
|
|
|
|
};
|
|
|
|
#endif // ADDRESSABLEITEMCONTEXTMENU_H
|