UIContext

Detailed Description

Classes

class  UIContextNotification
 Interface used to receive notifications related to files and contexts. More...
 
class  UIContextHandler
 
class  UIContext
 

Functions

void InitUIViews ()
 
void InitUIActions ()
 
void InitUIPlugins ()
 
void SetCurrentUIPluginLoadOrder (BNPluginLoadOrder order)
 
void AddRequiredUIPluginDependency (const std::string &name)
 
void AddOptionalUIPluginDependency (const std::string &name)
 

Class Documentation

◆ UIContextNotification

class UIContextNotification

Interface used to receive notifications related to files and contexts.

Many notifications include the ability to modify the behavior of the context.

Public Member Functions

virtual ~UIContextNotification ()
 
virtual void OnContextOpen (UIContext *context)
 Callback after a UIContext is opened (eg MainWindow) More...
 
virtual void OnContextClose (UIContext *context)
 Callback right before closing a UIContext. More...
 
virtual bool OnBeforeOpenDatabase (UIContext *context, FileMetadataRef metadata)
 Callback before a database (specifically a database, not a raw file) is opened. More...
 
virtual bool OnAfterOpenDatabase (UIContext *context, FileMetadataRef metadata, BinaryViewRef data)
 Callback after a database (specifically a database, not a raw file) is opened. More...
 
virtual void OnAfterOpenProject (UIContext *context, ProjectRef project)
 Callback after a project is opened. More...
 
virtual bool OnBeforeOpenProjectFile (UIContext *context, ProjectFileRef projectFile)
 Callback before a project file is opened. More...
 
virtual void OnAfterOpenProjectFile (UIContext *context, ProjectFileRef projectFile, ViewFrame *frame)
 Callback after a project file is opened. More...
 
virtual bool OnBeforeOpenFile (UIContext *context, FileContext *file)
 Callback before a file (raw or database) is opened (after OnAfterOpenDatabase if opening a database) More...
 
virtual void OnAfterOpenFile (UIContext *context, FileContext *file, ViewFrame *frame)
 Callback after a file (raw or database) is opened. More...
 
virtual bool OnBeforeSaveFile (UIContext *context, FileContext *file, ViewFrame *frame)
 Callback before a file is saved (either as a database or raw) More...
 
virtual void OnAfterSaveFile (UIContext *context, FileContext *file, ViewFrame *frame)
 Callback after a file is saved (either as a database or raw) More...
 
virtual bool OnBeforeCloseFile (UIContext *context, FileContext *file, ViewFrame *frame)
 Callback before a file is closed. More...
 
virtual void OnAfterCloseFile (UIContext *context, FileContext *file, ViewFrame *frame)
 Callback after a file is closed. More...
 
virtual void OnViewReplaced (UIContext *context, FileContext *file, ViewFrame *oldFrame, ViewFrame *newFrame)
 Callback after a ViewFrame is replaced in an open file (e.g. More...
 
virtual void OnDataViewReplaced (UIContext *context, FileContext *file, BinaryViewRef oldData, BinaryViewRef newData)
 Callback after a BinaryView is replaced in an open file (e.g. More...
 
virtual void OnViewChange (UIContext *context, ViewFrame *frame, const QString &type)
 Callback when the ui changes views. More...
 
virtual void OnAddressChange (UIContext *context, ViewFrame *frame, View *view, const ViewLocation &location)
 Callback when the ui changes address. More...
 
virtual bool GetNameForFile (UIContext *context, FileContext *file, QString &name)
 Callback to modify the displayed file name for a FileContext (eg in the window title or tab title) Note: Due to the out param &name, this is not usable from Python with PySide. More...
 
virtual bool GetNameForPath (UIContext *context, const QString &path, QString &name)
 Callback to modify the displayed file name for a file path (eg in the new tab widget) Note: Due to the out param &name, this is not usable from Python with PySide. More...
 
virtual void OnNewSelectionForXref (UIContext *context, ViewFrame *frame, View *view, const SelectionInfoForXref &selection)
 Callback when the ui changes selection and should update cross references. More...
 
virtual void OnActionExecuted (UIContext *context, UIActionHandler *handler, const QString &name, const UIActionContext &ctx, std::function< void(const UIActionContext &)> &action)
 Callback when an action is executed, allowing plugins to intercept and modify the behavior of the action. More...
 

Constructor & Destructor Documentation

◆ ~UIContextNotification()

virtual UIContextNotification::~UIContextNotification ( )
virtual

Member Function Documentation

◆ OnContextOpen()

virtual void UIContextNotification::OnContextOpen ( UIContext context)
inlinevirtual

Callback after a UIContext is opened (eg MainWindow)

Parameters
contextOpened context

◆ OnContextClose()

virtual void UIContextNotification::OnContextClose ( UIContext context)
inlinevirtual

Callback right before closing a UIContext.

Parameters
contextClosing context

◆ OnBeforeOpenDatabase()

virtual bool UIContextNotification::OnBeforeOpenDatabase ( UIContext context,
FileMetadataRef  metadata 
)
inlinevirtual

Callback before a database (specifically a database, not a raw file) is opened.

Parameters
contextContext opening the database
metadataObject with info about the database file
Returns
True if the database should be opened

◆ OnAfterOpenDatabase()

virtual bool UIContextNotification::OnAfterOpenDatabase ( UIContext context,
FileMetadataRef  metadata,
BinaryViewRef  data 
)
inlinevirtual

Callback after a database (specifically a database, not a raw file) is opened.

Parameters
contextContext which opened the database
metadataObject with info about the database file
dataRaw data which is backed by the database
Returns
True if the database should be opened

◆ OnAfterOpenProject()

virtual void UIContextNotification::OnAfterOpenProject ( UIContext context,
ProjectRef  project 
)
inlinevirtual

Callback after a project is opened.

Parameters
contextContext which opened the project
projectProject that was opened
frameViewFrame constructed to display the project

◆ OnBeforeOpenProjectFile()

virtual bool UIContextNotification::OnBeforeOpenProjectFile ( UIContext context,
ProjectFileRef  projectFile 
)
inlinevirtual

Callback before a project file is opened.

Parameters
contextContext opening the project file
projectFileProject file that is being opened
Returns
True if the project file should be opened

◆ OnAfterOpenProjectFile()

virtual void UIContextNotification::OnAfterOpenProjectFile ( UIContext context,
ProjectFileRef  projectFile,
ViewFrame frame 
)
inlinevirtual

Callback after a project file is opened.

Parameters
contextContext which opened the project file
projectFileProject file that was opened
frameViewFrame constructed to display the project file

◆ OnBeforeOpenFile()

virtual bool UIContextNotification::OnBeforeOpenFile ( UIContext context,
FileContext file 
)
inlinevirtual

Callback before a file (raw or database) is opened (after OnAfterOpenDatabase if opening a database)

Parameters
contextContext opening the file
fileContext with the file and ui views
Returns
True if the file should be opened

◆ OnAfterOpenFile()

virtual void UIContextNotification::OnAfterOpenFile ( UIContext context,
FileContext file,
ViewFrame frame 
)
inlinevirtual

Callback after a file (raw or database) is opened.

Parameters
contextContext which opened the file
fileContext with the file and ui views
frameViewFrame constructed to display the file

◆ OnBeforeSaveFile()

virtual bool UIContextNotification::OnBeforeSaveFile ( UIContext context,
FileContext file,
ViewFrame frame 
)
inlinevirtual

Callback before a file is saved (either as a database or raw)

Parameters
contextContext which is saving the file
fileContext with the file and ui views
frameViewFrame for the file
Returns
True if the file should be saved

◆ OnAfterSaveFile()

virtual void UIContextNotification::OnAfterSaveFile ( UIContext context,
FileContext file,
ViewFrame frame 
)
inlinevirtual

Callback after a file is saved (either as a database or raw)

Parameters
contextContext which saved the file
fileContext with the file and ui views
frameViewFrame for the file

◆ OnBeforeCloseFile()

virtual bool UIContextNotification::OnBeforeCloseFile ( UIContext context,
FileContext file,
ViewFrame frame 
)
inlinevirtual

Callback before a file is closed.

Parameters
contextContext which is closing the file
fileContext with the file and ui views
frameViewFrame for the file
Returns
True if the file should be closed

◆ OnAfterCloseFile()

virtual void UIContextNotification::OnAfterCloseFile ( UIContext context,
FileContext file,
ViewFrame frame 
)
inlinevirtual

Callback after a file is closed.

Parameters
contextContext which closed the file
fileContext with the file and ui views
frameViewFrame which former showed the file (will be deleted after this)

◆ OnViewReplaced()

virtual void UIContextNotification::OnViewReplaced ( UIContext context,
FileContext file,
ViewFrame oldFrame,
ViewFrame newFrame 
)
inlinevirtual

Callback after a ViewFrame is replaced in an open file (e.g.

on Rebase or Sync)

Parameters
contextContext which replaced the view
fileContext with the file and ui views
oldFrameOld ViewFrame being deleted
newFrameNew ViewFrame being created

◆ OnDataViewReplaced()

virtual void UIContextNotification::OnDataViewReplaced ( UIContext context,
FileContext file,
BinaryViewRef  oldData,
BinaryViewRef  newData 
)
inlinevirtual

Callback after a BinaryView is replaced in an open file (e.g.

on Rebase)

Parameters
contextContext which replaced the view
fileContext with the file and ui views
oldDataOld BinaryView with that name
newDataNew BinaryView with that name

◆ OnViewChange()

virtual void UIContextNotification::OnViewChange ( UIContext context,
ViewFrame frame,
const QString &  type 
)
inlinevirtual

Callback when the ui changes views.

Parameters
contextContext changing views
frameViewFrame which changed views
typeNew view name

Reimplemented in MiniGraph.

◆ OnAddressChange()

virtual void UIContextNotification::OnAddressChange ( UIContext context,
ViewFrame frame,
View view,
const ViewLocation location 
)
inlinevirtual

Callback when the ui changes address.

Parameters
contextContext changing address
frameViewFrame which changed address
viewCurrently open View
locationNew location

◆ GetNameForFile()

virtual bool UIContextNotification::GetNameForFile ( UIContext context,
FileContext file,
QString &  name 
)
inlinevirtual

Callback to modify the displayed file name for a FileContext (eg in the window title or tab title) Note: Due to the out param &name, this is not usable from Python with PySide.

Parameters
contextContext which will display this name
fileFile whose name to get
name[Out] Name to be displayed
Returns
True if the value in name should be used

◆ GetNameForPath()

virtual bool UIContextNotification::GetNameForPath ( UIContext context,
const QString &  path,
QString &  name 
)
inlinevirtual

Callback to modify the displayed file name for a file path (eg in the new tab widget) Note: Due to the out param &name, this is not usable from Python with PySide.

Parameters
contextContext which will display this name
pathPath to file whose name to get
name[Out] Name to be displayed
Returns
True if the value in name should be used

◆ OnNewSelectionForXref()

virtual void UIContextNotification::OnNewSelectionForXref ( UIContext context,
ViewFrame frame,
View view,
const SelectionInfoForXref selection 
)
inlinevirtual

Callback when the ui changes selection and should update cross references.

Parameters
contextContext changing selection
frameViewFrame which changed selection
viewView that changed selection
selectionNew selection

Reimplemented in CrossReferenceWidget.

◆ OnActionExecuted()

virtual void UIContextNotification::OnActionExecuted ( UIContext context,
UIActionHandler handler,
const QString &  name,
const UIActionContext ctx,
std::function< void(const UIActionContext &)> &  action 
)
inlinevirtual

Callback when an action is executed, allowing plugins to intercept and modify the behavior of the action.

Plugins may modify the `action` parameter and specify new behavior for the action to execute, which will happen immediately after all registered notifications have been notified.

The original behavior (potentially modified by another notification) can be executed by saving a copy of the value of `action` and calling it from within your modified value.

Parameters
context
handler
name
ctx
action

◆ UIContextHandler

class UIContextHandler

Public Member Functions

virtual ~UIContextHandler ()
 
virtual void updateStatus ()=0
 
virtual void notifyThemeChanged ()=0
 
virtual void registerFileOpenMode (const QString &buttonName, const QString &description, const QString &action)
 

Constructor & Destructor Documentation

◆ ~UIContextHandler()

virtual UIContextHandler::~UIContextHandler ( )
virtual

Member Function Documentation

◆ updateStatus()

virtual void UIContextHandler::updateStatus ( )
pure virtual

◆ notifyThemeChanged()

virtual void UIContextHandler::notifyThemeChanged ( )
pure virtual

◆ registerFileOpenMode()

virtual void UIContextHandler::registerFileOpenMode ( const QString &  buttonName,
const QString &  description,
const QString &  action 
)
virtual

◆ UIContext

class UIContext

Public Member Functions

 UIContext ()
 
virtual ~UIContext ()
 
virtual QMainWindow * mainWindow ()=0
 
virtual void releaseBinaryView (BinaryViewRef view)
 
virtual void viewChanged (ViewFrame *frame, const QString &type)
 
virtual bool navigateForBinaryView (BinaryViewRef view, uint64_t addr)
 
virtual bool navigateToType (const std::string &name, uint64_t offset=0)=0
 Navigate to a named type in the context, optionally at a member offset. More...
 
virtual std::vector< std::pair< BinaryViewRef, QString > > getAvailableBinaryViews ()=0
 Get a list of all opened binary views, and their names. More...
 
virtual QWidget * getTabForSessionId (uint64_t sessionId)=0
 Gets the tab for for a given sessionId. More...
 
virtual QString getTabNameForSessionId (uint64_t sessionId)=0
 Gets the name of a tab for the given session. More...
 
virtual ViewgetCurrentView ()=0
 Get the currently visible View for the currently visible ViewFrame (if it exists) More...
 
virtual ViewFramegetCurrentViewFrame ()=0
 Get the currently visible ViewFrame (if it exists) More...
 
virtual UIActionHandlergetCurrentActionHandler ()=0
 Get the current Action Handler for the focused widget. More...
 
virtual int createTabForWidget (const QString &name, QWidget *widget)=0
 Open a tab containing the given widget with the given name. More...
 
virtual void splitToNewWindowAndNavigateToLocation (uint64_t location)=0
 Open a new window with the same file context and Navigate to a given location. More...
 
virtual void splitToNewTabAndNavigateToLocation (uint64_t location)=0
 Open a new tab with the same file context and Navigate to a given location. More...
 
virtual void openPane (Pane *pane, Qt::Orientation primaryDirection=Qt::Vertical)=0
 Open a new pane in the active tab. More...
 
virtual QList< QWidget * > getTabs ()=0
 Get a list of all tabs as QWidgets. More...
 
virtual QWidget * getTabForName (const QString &name)=0
 Get the QWidget responsible for the tab with the given name. More...
 
virtual QWidget * getTabForFile (FileContext *file)=0
 Get the QWidget responsible for the tab with the given file. More...
 
virtual QString getNameForTab (QWidget *tab)=0
 Get the name of the tab with the given QWidget. More...
 
virtual void activateTab (QWidget *tab)=0
 Activate and make visible the tab with the given QWidget. More...
 
virtual void closeTab (QWidget *tab, bool closeWindowIfLast=false)=0
 Close the tab with the given QWidget. More...
 
virtual QWidget * getCurrentTab ()=0
 Get the QWidget in the currently open tab. More...
 
virtual QWidget * createNewTab (bool focus=true)=0
 
virtual ViewgetViewForTab (QWidget *tab)=0
 Get the current View associated with the given QWidget, if it exists. More...
 
virtual ViewFramegetViewFrameForTab (QWidget *tab) const =0
 Get the active ViewFrame associated with the given QWidget, if it exists. More...
 
virtual std::vector< ViewFrame * > getAllViewFramesForTab (QWidget *tab) const =0
 Get all ViewFrame instances associated with the given QWidget, if they exist. More...
 
virtual ProjectRef getProject ()
 
virtual ProjectStatusWidgetgetProjectStatusWidget ()
 
virtual bool openFilename (const QString &path, bool openOptions=false)
 
virtual ProjectRef openProject (const QString &path)
 
virtual ViewFrameopenFileContext (FileContext *file, const QString &forcedView="", bool addTab=true)
 
virtual bool openProjectFile (ProjectFileRef file, ExternalLocationRef loc=nullptr, bool openWithOptions=false)
 
virtual void recreateViewFrames (FileContext *file)=0
 
UIActionHandlerglobalActions ()
 
virtual UIActionHandlercontentActionHandler ()=0
 
virtual Sidebarsidebar ()=0
 
virtual GlobalAreaglobalArea ()=0
 
void NotifyOnContextOpen ()
 
void NotifyOnContextClose ()
 
bool NotifyOnBeforeOpenDatabase (FileMetadataRef metadata)
 
bool NotifyOnAfterOpenDatabase (FileMetadataRef metadata, BinaryViewRef data)
 
void NotifyOnAfterOpenProject (ProjectRef project)
 
bool NotifyOnBeforeOpenProjectFile (ProjectFileRef projectFile)
 
void NotifyOnAfterOpenProjectFile (ProjectFileRef projectFile, ViewFrame *frame)
 
bool NotifyOnBeforeOpenFile (FileContext *file)
 
void NotifyOnAfterOpenFile (FileContext *file, ViewFrame *frame)
 
bool NotifyOnBeforeSaveFile (FileContext *file, ViewFrame *frame)
 
void NotifyOnAfterSaveFile (FileContext *file, ViewFrame *frame)
 
bool NotifyOnBeforeCloseFile (FileContext *file, ViewFrame *frame)
 
void NotifyOnAfterCloseFile (FileContext *file, ViewFrame *frame)
 
void NotifyOnViewReplaced (FileContext *file, ViewFrame *oldFrame, ViewFrame *newFrame)
 
void NotifyOnDataViewReplaced (FileContext *file, BinaryViewRef oldView, BinaryViewRef newView)
 
void NotifyOnViewChange (ViewFrame *frame, const QString &type)
 
void NotifyOnAddressChange (ViewFrame *frame, View *view, const ViewLocation &location)
 
void updateCrossReferences (ViewFrame *frame, View *view, const SelectionInfoForXref &selection)
 
void NotifyOnActionExecuted (UIActionHandler *handler, const QString &name, const UIActionContext &ctx, std::function< void(const UIActionContext &)> &action)
 
virtual void findAll (const BinaryNinja::FindParameters &params)
 
QString GetNameForFile (FileContext *file)
 Get the displayed name for a given file. More...
 
QString GetNameForPath (const QString &path)
 Get the displayed name for a path to a file. More...
 
virtual QWidget * fileContentsLockStatusWidget ()=0
 
void associateAdditionalWindowWithContext (QWidget *window)
 

Static Public Member Functions

static void registerNotification (UIContextNotification *notification)
 Register an object to receive notifications of UIContext events. More...
 
static void unregisterNotification (UIContextNotification *notification)
 Unregister an object from receiving notifications of UIContext events. More...
 
static void deassociateAdditionalWindowWithContext (QWidget *window)
 
static void setHandler (UIContextHandler *handler)
 
static QSize getScaledWindowSize (int x, int y)
 
static void updateStatus ()
 
static void notifyThemeChanged ()
 
static void showPreview (QWidget *parent, PreviewWidget *preview, QPoint localPos, bool anchorAtPoint=false)
 
static void closePreview ()
 
static bool sendPreviewWheelEvent (QWheelEvent *event)
 
static void closeOtherActiveModalWidget (QWidget *current)
 
static void registerFileOpenMode (const QString &buttonName, const QString &description, const QString &action)
 
static UIContextcontextForWidget (QWidget *widget)
 
static UIContextactiveContext ()
 
static std::set< UIContext * > allContexts ()
 
static QWidget * topLevelAt (const QPoint &pt, QWidget *ignoreWidget=nullptr)
 
static QRect placeNewTopLevelWindow (QScreen *screen, const QPoint &pos, QWidget *existingWidget)
 
static ViewFramecurrentViewFrameForWidget (QWidget *widget)
 

Protected Member Functions

void setupUIContext (QWidget *obj)
 

Constructor & Destructor Documentation

◆ UIContext()

UIContext::UIContext ( )

◆ ~UIContext()

virtual UIContext::~UIContext ( )
virtual

Member Function Documentation

◆ setupUIContext()

void UIContext::setupUIContext ( QWidget *  obj)
protected

◆ mainWindow()

virtual QMainWindow * UIContext::mainWindow ( )
pure virtual

◆ releaseBinaryView()

virtual void UIContext::releaseBinaryView ( BinaryViewRef  view)
virtual

◆ viewChanged()

virtual void UIContext::viewChanged ( ViewFrame frame,
const QString &  type 
)
virtual

◆ navigateForBinaryView()

virtual bool UIContext::navigateForBinaryView ( BinaryViewRef  view,
uint64_t  addr 
)
virtual

◆ navigateToType()

virtual bool UIContext::navigateToType ( const std::string &  name,
uint64_t  offset = 0 
)
pure virtual

Navigate to a named type in the context, optionally at a member offset.

Parameters
nameName of type to which to navigate
offsetOffset of member in type to which to navigate
Returns
True if navigation succeeded

◆ getAvailableBinaryViews()

virtual std::vector< std::pair< BinaryViewRef, QString > > UIContext::getAvailableBinaryViews ( )
pure virtual

Get a list of all opened binary views, and their names.

Returns
List of binary views and names

◆ getTabForSessionId()

virtual QWidget * UIContext::getTabForSessionId ( uint64_t  sessionId)
pure virtual

Gets the tab for for a given sessionId.

◆ getTabNameForSessionId()

virtual QString UIContext::getTabNameForSessionId ( uint64_t  sessionId)
pure virtual

Gets the name of a tab for the given session.

◆ getCurrentView()

virtual View * UIContext::getCurrentView ( )
pure virtual

Get the currently visible View for the currently visible ViewFrame (if it exists)

Returns
Current View or nullptr if the current ViewFrame is null or does not have a View

◆ getCurrentViewFrame()

virtual ViewFrame * UIContext::getCurrentViewFrame ( )
pure virtual

Get the currently visible ViewFrame (if it exists)

Returns
Current ViewFrame or nullptr if the current widget does not have a ViewFrame

◆ getCurrentActionHandler()

virtual UIActionHandler * UIContext::getCurrentActionHandler ( )
pure virtual

Get the current Action Handler for the focused widget.

Returns
Current Action Handler if the focused widget (or one of its parents) has one, else nullptr

◆ createTabForWidget()

virtual int UIContext::createTabForWidget ( const QString &  name,
QWidget *  widget 
)
pure virtual

Open a tab containing the given widget with the given name.

Parameters
nameName for tab
widgetWidget to display in the tab (optionally a ViewFrame)
Returns
Index of created tab

◆ splitToNewWindowAndNavigateToLocation()

virtual void UIContext::splitToNewWindowAndNavigateToLocation ( uint64_t  location)
pure virtual

Open a new window with the same file context and Navigate to a given location.

Parameters
location

◆ splitToNewTabAndNavigateToLocation()

virtual void UIContext::splitToNewTabAndNavigateToLocation ( uint64_t  location)
pure virtual

Open a new tab with the same file context and Navigate to a given location.

Parameters
location

◆ openPane()

virtual void UIContext::openPane ( Pane pane,
Qt::Orientation  primaryDirection = Qt::Vertical 
)
pure virtual

Open a new pane in the active tab.

Parameters
panePane widget to open
primaryDirectionPrimary axis for content in pane (determines default split direction)

◆ getTabs()

virtual QList< QWidget * > UIContext::getTabs ( )
pure virtual

Get a list of all tabs as QWidgets.

Returns
All tabs

◆ getTabForName()

virtual QWidget * UIContext::getTabForName ( const QString &  name)
pure virtual

Get the QWidget responsible for the tab with the given name.

Parameters
nameName of tab to get
Returns
QWidget of tab if one with that name exists

◆ getTabForFile()

virtual QWidget * UIContext::getTabForFile ( FileContext file)
pure virtual

Get the QWidget responsible for the tab with the given file.

Parameters
fileFile of tab to get
Returns
QWidget of tab if one with that file exists

◆ getNameForTab()

virtual QString UIContext::getNameForTab ( QWidget *  tab)
pure virtual

Get the name of the tab with the given QWidget.

Parameters
tabQWidget which is in a tab
Returns
Name of the tab, or empty string if no tab is found

◆ activateTab()

virtual void UIContext::activateTab ( QWidget *  tab)
pure virtual

Activate and make visible the tab with the given QWidget.

Parameters
tabQWidget which is in a tab

◆ closeTab()

virtual void UIContext::closeTab ( QWidget *  tab,
bool  closeWindowIfLast = false 
)
pure virtual

Close the tab with the given QWidget.

Parameters
tabQWidget which is in a tab
closeWindowIfLastIf false, displays the new tab page if the widget was the last tab

◆ getCurrentTab()

virtual QWidget * UIContext::getCurrentTab ( )
pure virtual

Get the QWidget in the currently open tab.

Returns
QWidget for current tab. Qt claims "this value is never 0 (but if you try hard enough, it can be)"

◆ createNewTab()

virtual QWidget * UIContext::createNewTab ( bool  focus = true)
pure virtual

◆ getViewForTab()

virtual View * UIContext::getViewForTab ( QWidget *  tab)
pure virtual

Get the current View associated with the given QWidget, if it exists.

Parameters
tabQWidget which could be a ViewFrame
Returns
View for the QWidget, or nullptr if the QWidget is not a ViewFrame or does not have a View

◆ getViewFrameForTab()

virtual ViewFrame * UIContext::getViewFrameForTab ( QWidget *  tab) const
pure virtual

Get the active ViewFrame associated with the given QWidget, if it exists.

Parameters
tabQWidget which could be a ViewFrame
Returns
ViewFrame for the QWidget (which is likely itself), or nullptr if the QWidget is not a ViewFrame

◆ getAllViewFramesForTab()

virtual std::vector< ViewFrame * > UIContext::getAllViewFramesForTab ( QWidget *  tab) const
pure virtual

Get all ViewFrame instances associated with the given QWidget, if they exist.

Parameters
tabQWidget which could contain a ViewFrame
Returns
List of ViewFrame objects for the QWidget

◆ getProject()

virtual ProjectRef UIContext::getProject ( )
virtual

◆ getProjectStatusWidget()

virtual ProjectStatusWidget * UIContext::getProjectStatusWidget ( )
virtual

◆ openFilename()

virtual bool UIContext::openFilename ( const QString &  path,
bool  openOptions = false 
)
virtual

◆ openProject()

virtual ProjectRef UIContext::openProject ( const QString &  path)
virtual

◆ openFileContext()

virtual ViewFrame * UIContext::openFileContext ( FileContext file,
const QString &  forcedView = "",
bool  addTab = true 
)
virtual

◆ openProjectFile()

virtual bool UIContext::openProjectFile ( ProjectFileRef  file,
ExternalLocationRef  loc = nullptr,
bool  openWithOptions = false 
)
virtual

◆ recreateViewFrames()

virtual void UIContext::recreateViewFrames ( FileContext file)
pure virtual

◆ globalActions()

UIActionHandler * UIContext::globalActions ( )
inline

◆ contentActionHandler()

virtual UIActionHandler * UIContext::contentActionHandler ( )
pure virtual

◆ sidebar()

virtual Sidebar * UIContext::sidebar ( )
pure virtual

◆ globalArea()

virtual GlobalArea * UIContext::globalArea ( )
pure virtual

◆ NotifyOnContextOpen()

void UIContext::NotifyOnContextOpen ( )

◆ NotifyOnContextClose()

void UIContext::NotifyOnContextClose ( )

◆ NotifyOnBeforeOpenDatabase()

bool UIContext::NotifyOnBeforeOpenDatabase ( FileMetadataRef  metadata)

◆ NotifyOnAfterOpenDatabase()

bool UIContext::NotifyOnAfterOpenDatabase ( FileMetadataRef  metadata,
BinaryViewRef  data 
)

◆ NotifyOnAfterOpenProject()

void UIContext::NotifyOnAfterOpenProject ( ProjectRef  project)

◆ NotifyOnBeforeOpenProjectFile()

bool UIContext::NotifyOnBeforeOpenProjectFile ( ProjectFileRef  projectFile)

◆ NotifyOnAfterOpenProjectFile()

void UIContext::NotifyOnAfterOpenProjectFile ( ProjectFileRef  projectFile,
ViewFrame frame 
)

◆ NotifyOnBeforeOpenFile()

bool UIContext::NotifyOnBeforeOpenFile ( FileContext file)

◆ NotifyOnAfterOpenFile()

void UIContext::NotifyOnAfterOpenFile ( FileContext file,
ViewFrame frame 
)

◆ NotifyOnBeforeSaveFile()

bool UIContext::NotifyOnBeforeSaveFile ( FileContext file,
ViewFrame frame 
)

◆ NotifyOnAfterSaveFile()

void UIContext::NotifyOnAfterSaveFile ( FileContext file,
ViewFrame frame 
)

◆ NotifyOnBeforeCloseFile()

bool UIContext::NotifyOnBeforeCloseFile ( FileContext file,
ViewFrame frame 
)

◆ NotifyOnAfterCloseFile()

void UIContext::NotifyOnAfterCloseFile ( FileContext file,
ViewFrame frame 
)

◆ NotifyOnViewReplaced()

void UIContext::NotifyOnViewReplaced ( FileContext file,
ViewFrame oldFrame,
ViewFrame newFrame 
)

◆ NotifyOnDataViewReplaced()

void UIContext::NotifyOnDataViewReplaced ( FileContext file,
BinaryViewRef  oldView,
BinaryViewRef  newView 
)

◆ NotifyOnViewChange()

void UIContext::NotifyOnViewChange ( ViewFrame frame,
const QString &  type 
)

◆ NotifyOnAddressChange()

void UIContext::NotifyOnAddressChange ( ViewFrame frame,
View view,
const ViewLocation location 
)

◆ updateCrossReferences()

void UIContext::updateCrossReferences ( ViewFrame frame,
View view,
const SelectionInfoForXref selection 
)

◆ NotifyOnActionExecuted()

void UIContext::NotifyOnActionExecuted ( UIActionHandler handler,
const QString &  name,
const UIActionContext ctx,
std::function< void(const UIActionContext &)> &  action 
)

◆ findAll()

virtual void UIContext::findAll ( const BinaryNinja::FindParameters params)
virtual

◆ registerNotification()

static void UIContext::registerNotification ( UIContextNotification notification)
static

Register an object to receive notifications of UIContext events.

Parameters
notificationObject which will receive notifications

◆ unregisterNotification()

static void UIContext::unregisterNotification ( UIContextNotification notification)
static

Unregister an object from receiving notifications of UIContext events.

Parameters
notificationObject which will no longer receive notifications

◆ GetNameForFile()

QString UIContext::GetNameForFile ( FileContext file)

Get the displayed name for a given file.

Parameters
fileFile whose displayed name to get
Returns
Name to display for this file

◆ GetNameForPath()

QString UIContext::GetNameForPath ( const QString &  path)

Get the displayed name for a path to a file.

Parameters
pathPath to file whose displayed name you want
Returns
Name to display for this path

◆ fileContentsLockStatusWidget()

virtual QWidget * UIContext::fileContentsLockStatusWidget ( )
pure virtual

◆ associateAdditionalWindowWithContext()

void UIContext::associateAdditionalWindowWithContext ( QWidget *  window)

◆ deassociateAdditionalWindowWithContext()

static void UIContext::deassociateAdditionalWindowWithContext ( QWidget *  window)
static

◆ setHandler()

static void UIContext::setHandler ( UIContextHandler handler)
static

◆ getScaledWindowSize()

static QSize UIContext::getScaledWindowSize ( int  x,
int  y 
)
static

◆ updateStatus()

static void UIContext::updateStatus ( )
static

◆ notifyThemeChanged()

static void UIContext::notifyThemeChanged ( )
static

◆ showPreview()

static void UIContext::showPreview ( QWidget *  parent,
PreviewWidget preview,
QPoint  localPos,
bool  anchorAtPoint = false 
)
static

◆ closePreview()

static void UIContext::closePreview ( )
static

◆ sendPreviewWheelEvent()

static bool UIContext::sendPreviewWheelEvent ( QWheelEvent *  event)
static

◆ closeOtherActiveModalWidget()

static void UIContext::closeOtherActiveModalWidget ( QWidget *  current)
static

◆ registerFileOpenMode()

static void UIContext::registerFileOpenMode ( const QString &  buttonName,
const QString &  description,
const QString &  action 
)
static

◆ contextForWidget()

static UIContext * UIContext::contextForWidget ( QWidget *  widget)
static

◆ activeContext()

static UIContext * UIContext::activeContext ( )
static

◆ allContexts()

static std::set< UIContext * > UIContext::allContexts ( )
static

◆ topLevelAt()

static QWidget * UIContext::topLevelAt ( const QPoint &  pt,
QWidget *  ignoreWidget = nullptr 
)
static

◆ placeNewTopLevelWindow()

static QRect UIContext::placeNewTopLevelWindow ( QScreen *  screen,
const QPoint &  pos,
QWidget *  existingWidget 
)
static

◆ currentViewFrameForWidget()

static ViewFrame * UIContext::currentViewFrameForWidget ( QWidget *  widget)
static

Function Documentation

◆ InitUIViews()

void InitUIViews ( )

◆ InitUIActions()

void InitUIActions ( )

◆ InitUIPlugins()

void InitUIPlugins ( )

◆ SetCurrentUIPluginLoadOrder()

void SetCurrentUIPluginLoadOrder ( BNPluginLoadOrder  order)

◆ AddRequiredUIPluginDependency()

void AddRequiredUIPluginDependency ( const std::string &  name)

◆ AddOptionalUIPluginDependency()

void AddOptionalUIPluginDependency ( const std::string &  name)