cutter/src/menus/AddressableItemContextMenu.h
karliss 567f852c3a
Common behaviour for lists with items that have address part 2 (#1718)
* Seperate addressable item list widget from ListDockWidget.
* Convert ResourceWidget, strings widget, flags widget, search widget, MemoryMapWidget, xrefs dialog
* Don't silently overwrite comment in add comment action.
2019-09-02 00:30:25 +03:00

49 lines
1.1 KiB
C++

#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());
void clearTarget();
signals:
void xrefsTriggered();
private:
void onActionCopyAddress();
void onActionShowXrefs();
void onActionAddComment();
virtual void aboutToShowSlot();
MainWindow *mainWindow;
RVA offset;
bool hasTarget = false;
protected:
void setHasTarget(bool hasTarget);
QAction actionShowInMenu;
QAction actionCopyAddress;
QAction actionShowXrefs;
QAction actionAddcomment;
QString name;
bool wholeFunction = false;
};
#endif // ADDRESSABLEITEMCONTEXTMENU_H