TypeBrowserView Class Reference

Signals

void typeNameNavigated (const std::string &typeName, bool newSelection)
 

Public Member Functions

 TypeBrowserView (BinaryViewRef data, TypeBrowserContainer *container)
 
TypeBrowserContainergetContainer ()
 
TypeBrowserModelgetModel ()
 
TypeBrowserFilterModelgetFilterModel ()
 
QTreeView * getTreeView ()
 
TypeEditorgetTypeEditor ()
 
virtual BinaryViewRef getData () override
 
virtual uint64_t getCurrentOffset () override
 
virtual void setSelectionOffsets (BNAddressRange range) override
 
virtual bool navigate (uint64_t offset) override
 
virtual SelectionInfoForXref getSelectionForXref () override
 
virtual QFont getFont () override
 
virtual void updateFonts () override
 
virtual void showEvent (QShowEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual StatusBarWidgetgetStatusBarWidget () override
 
virtual QWidget * getHeaderOptionsWidget () override
 
virtual void setFilter (const std::string &filter) override
 
virtual void scrollToFirstItem () override
 
virtual void scrollToCurrentItem () override
 
virtual void selectFirstItem () override
 
virtual void activateFirstItem () override
 
virtual void notifyRefresh () override
 
void showSelectedTypes ()
 
void showTypes (const std::vector< TypeReference > &types)
 
void selectTypeByName (const std::string &name, bool newSelection)
 
bool navigateToType (const std::string &typeName, uint64_t offset)
 
void scrollToIndexWithContext (const QModelIndex &index, int context=1)
 
void setPrimaryOrientation (Qt::Orientation orientation)
 
std::vector< std::shared_ptr< TypeBrowserTreeNode > > selectedNodes () const
 
std::optional< BinaryViewRefselectedBV () const
 
std::optional< std::unordered_set< BinaryNinja::QualifiedName > > selectedBVTypeNames () const
 
std::optional< std::pair< BinaryNinja::TypeContainer, BinaryNinja::QualifiedName > > selectedTypeNameAndContainer () const
 
std::vector< std::pair< BinaryNinja::TypeContainer, std::vector< BinaryNinja::QualifiedName > > > selectedTypeNamesByContainers () const
 
std::optional< TypeReferenceselectedType () const
 
std::vector< TypeReferenceselectedTypes () const
 
std::optional< BinaryNinja::TypeContainerselectedTypeContainer (bool makeSureItHasPlatform=true, bool preferView=false) const
 
std::optional< BinaryNinja::TypeContainerselectedTypeContainerOrMData (bool makeSureItHasPlatform=true, bool preferView=false) const
 
std::optional< TypeArchiveRefselectedTA () const
 
std::optional< std::string > selectedTAId () const
 
std::optional< std::unordered_set< TypeArchiveRef > > selectedTAs () const
 
std::optional< std::unordered_set< std::string > > selectedTAIds () const
 
std::optional< std::unordered_map< std::string, std::unordered_set< std::string > > > selectedTATypeIds () const
 
std::vector< TypeArchiveRefconnectedTAs (BinaryViewRef view) const
 
std::optional< BinaryNinja::TypeContainercontainerForId (const std::string &containerId, bool makeSureItHasPlatform=false, bool preferView=false) const
 
void bindActions ()
 
void showContextMenu ()
 
bool canConnectTypeArchive ()
 
void connectTypeArchive ()
 
bool canCreateTypeArchive ()
 
void createTypeArchive ()
 
bool canAttachTypeArchive ()
 
void attachTypeArchive ()
 
bool canDetachTypeArchive ()
 
void detachTypeArchive ()
 
bool canSyncSelectedTypes ()
 
void syncSelectedTypes ()
 
bool canPushSelectedTypes ()
 
void pushSelectedTypes ()
 
bool canPullSelectedTypes ()
 
void pullSelectedTypes ()
 
bool canDisassociateSelectedTypes ()
 
void disassociateSelectedTypes ()
 
bool canCreateNewTypes ()
 
void createNewTypes ()
 
bool canCreateNewStructure ()
 
void createNewStructure ()
 
bool canCreateNewEnumeration ()
 
void createNewEnumeration ()
 
bool canCreateNewUnion ()
 
void createNewUnion ()
 
bool canRenameTypes ()
 
void renameTypes ()
 
bool canCopyTypeNames ()
 
void copyTypeNames ()
 
bool canCopyTypeDefinitions ()
 
void copyTypeDefinitions ()
 
bool canDeleteTypes ()
 
void deleteTypes ()
 
bool canChangeTypes ()
 
void changeTypes ()
 
bool canImportType ()
 
void importType ()
 
bool canImportTypeByGUID (BinaryViewRef view)
 
void importTypeByGUID ()
 
bool canAddTypeLibrary ()
 
void addTypeLibrary ()
 
bool canExpandAll ()
 
void expandAll ()
 
bool canCollapseAll ()
 
void collapseAll ()
 
bool canSwitchLayout ()
 
void switchLayout ()
 
- Public Member Functions inherited from View
 View ()
 
virtual ~View ()
 
void enableRefreshTimer (QWidget *owner, int interval)
 
void setRefreshQuiesce (bool enable)
 
bool isQuiesced () const
 
virtual void notifyRefresh ()
 
virtual void notifyQuiesce (bool)
 
void setupView (QWidget *widget)
 
virtual bool canAssemble ()
 
virtual bool canCompile ()
 
virtual bool findNextData (uint64_t start, uint64_t end, const BinaryNinja::DataBuffer &data, uint64_t &addr, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findNextText (uint64_t start, uint64_t end, const std::string &text, uint64_t &addr, DisassemblySettingsRef settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findNextConstant (uint64_t start, uint64_t end, uint64_t constant, uint64_t &addr, DisassemblySettingsRef settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb)
 
virtual bool findAllData (uint64_t start, uint64_t end, const BinaryNinja::DataBuffer &data, BNFindFlag flags, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const BinaryNinja::DataBuffer &match)> &matchCallback)
 
virtual bool findAllText (uint64_t start, uint64_t end, const std::string &data, DisassemblySettingsRef settings, BNFindFlag flags, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const std::string &match, const BinaryNinja::LinearDisassemblyLine &line)> &matchCallback)
 
virtual bool findAllConstant (uint64_t start, uint64_t end, uint64_t constant, DisassemblySettingsRef settings, BNFunctionGraphType graph, const std::function< bool(size_t current, size_t total)> &cb, const std::function< bool(uint64_t addr, const BinaryNinja::LinearDisassemblyLine &line)> &matchCallback)
 
virtual BinaryViewRef getData ()=0
 
virtual uint64_t getCurrentOffset ()=0
 
virtual BNAddressRange getSelectionOffsets ()
 
virtual SelectionInfoForXref getSelectionForXref ()
 
virtual void setSelectionOffsets (BNAddressRange range)=0
 
virtual bool navigate (uint64_t offset)=0
 
virtual bool navigateToFunction (FunctionRef func, uint64_t offset)
 
virtual bool goToReference (FunctionRef func, uint64_t source, uint64_t target)
 
virtual bool navigateToViewLocation (const ViewLocation &viewLocation, bool center=false)
 
bool navigateOnOtherPane (uint64_t offset)
 
bool navigateToFunctionOnOtherPane (FunctionRef func, uint64_t offset)
 
bool isBinaryDataNavigable ()
 
void setBinaryDataNavigable (bool navigable)
 
virtual bool closeRequest ()
 
virtual void closing ()
 
virtual void updateFonts ()
 
virtual void updateTheme ()
 
virtual void undo ()
 
virtual void redo ()
 
virtual bool canUndo ()
 
virtual bool canRedo ()
 
virtual void cut ()
 
virtual void copy (TransformRef xform=nullptr)
 
virtual void copyAddress ()
 
virtual void paste (TransformRef xform=nullptr)
 
virtual bool canCut ()
 
virtual bool canCopy ()
 
virtual bool canCopyWithTransform ()
 
virtual bool canCopyAddress ()
 
virtual bool canPaste ()
 
virtual bool canPasteWithTransform ()
 
virtual void transform (TransformRef xform, bool encode)
 
virtual bool canTransform ()
 
virtual void writeData (const BinaryNinja::DataBuffer &data, uint64_t addr)
 
virtual bool canDisplayAs (const UIActionContext &context, const BNIntegerDisplayType)
 
virtual void displayAs (const UIActionContext &context, BNIntegerDisplayType type)
 
virtual BinaryNinja::Ref< HistoryEntrygetHistoryEntry ()
 
virtual void navigateToHistoryEntry (BinaryNinja::Ref< HistoryEntry > entry)
 
virtual StatusBarWidgetgetStatusBarWidget ()
 
virtual ViewPaneHeaderSubtypeWidgetgetHeaderSubtypeWidget ()
 
virtual QWidget * getHeaderOptionsWidget ()
 
virtual FunctionRef getCurrentFunction ()
 
virtual BasicBlockRef getCurrentBasicBlock ()
 
virtual ArchitectureRef getCurrentArchitecture ()
 
virtual LowLevelILFunctionRef getCurrentLowLevelILFunction ()
 
virtual MediumLevelILFunctionRef getCurrentMediumLevelILFunction ()
 
virtual HighLevelILFunctionRef getCurrentHighLevelILFunction ()
 
virtual BNFunctionGraphType getILViewType ()
 
virtual void setILViewType (BNFunctionGraphType ilViewType)
 
virtual size_t getCurrentILInstructionIndex ()
 
virtual size_t getSelectionStartILInstructionIndex ()
 
virtual BNILIndexRange getILIndexRange ()
 
virtual QFont getFont ()=0
 
virtual DisassemblySettingsRef getDisassemblySettings ()
 
virtual void setDisassemblySettings (DisassemblySettingsRef settings)
 
virtual HighlightTokenState getHighlightTokenState ()
 
virtual UIActionContext actionContext ()
 
MenucontextMenu ()
 
UIActionHandleractionHandler ()
 
QWidget * widget ()
 
QString viewType ()
 
void updateCrossReferenceSelection (ViewFrame *frame=nullptr)
 
void forceSyncFromView (ViewFrame *frame=nullptr)
 
virtual void clearRelatedHighlights ()
 
virtual void setRelatedIndexHighlights (FunctionRef func, const std::set< size_t > &related)
 
virtual void setRelatedInstructionHighlights (FunctionRef func, const std::set< uint64_t > &related)
 
- Public Member Functions inherited from FilterTarget
virtual ~FilterTarget ()
 
virtual void setFilter (const std::string &filter)=0
 
virtual void scrollToFirstItem ()=0
 
virtual void scrollToCurrentItem ()=0
 
virtual void selectFirstItem ()=0
 
virtual void activateFirstItem ()=0
 
virtual void closeFilter ()
 

Static Public Member Functions

static std::optional< std::unordered_set< std::string > > typeIdsFromNames (BinaryViewRef view, const std::unordered_set< BinaryNinja::QualifiedName > &names)
 
static std::unordered_map< std::optional< TypeArchiveRef >, std::unordered_set< std::string > > associatedTypeArchivesForTypeIds (BinaryViewRef view, const std::unordered_set< std::string > &typeIds)
 
static void registerActions ()
 
- Static Public Member Functions inherited from View
static ViewgetViewFromWidget (QWidget *widget)
 
static void registerActions ()
 
static void registerLateActions ()
 

Protected Member Functions

void itemSelected (const QItemSelection &selected, const QItemSelection &deselected)
 
void itemDoubleClicked (const QModelIndex &index)
 
virtual void contextMenuEvent (QContextMenuEvent *event) override
 
- Protected Member Functions inherited from View
bool writeDataToClipboard (const BinaryNinja::DataBuffer &data, bool binary, TransformRef xform)
 
BinaryNinja::DataBuffer readDataFromClipboard (TransformRef xform)
 
virtual std::string getNavigationMode ()
 
virtual void setNavigationMode (std::string mode)
 
virtual std::vector< std::string > getNavigationModes ()
 

Additional Inherited Members

- Protected Attributes inherited from View
Menu m_contextMenu
 
UIActionHandler m_actionHandler
 
bool m_binaryDataNavigable = false
 
QPointer< TransformParameterDialogm_transformParamDialog
 
bool m_quiesceState = true
 
QTimer * m_updateTimer = nullptr
 

Constructor & Destructor Documentation

◆ TypeBrowserView()

TypeBrowserView::TypeBrowserView ( BinaryViewRef  data,
TypeBrowserContainer container 
)

Member Function Documentation

◆ getContainer()

TypeBrowserContainer * TypeBrowserView::getContainer ( )
inline

◆ getModel()

TypeBrowserModel * TypeBrowserView::getModel ( )
inline

◆ getFilterModel()

TypeBrowserFilterModel * TypeBrowserView::getFilterModel ( )
inline

◆ getTreeView()

QTreeView * TypeBrowserView::getTreeView ( )
inline

◆ getTypeEditor()

TypeEditor * TypeBrowserView::getTypeEditor ( )
inline

◆ getData()

virtual BinaryViewRef TypeBrowserView::getData ( )
inlineoverridevirtual

Implements View.

◆ getCurrentOffset()

virtual uint64_t TypeBrowserView::getCurrentOffset ( )
overridevirtual

Implements View.

◆ setSelectionOffsets()

virtual void TypeBrowserView::setSelectionOffsets ( BNAddressRange  range)
overridevirtual

Implements View.

◆ navigate()

virtual bool TypeBrowserView::navigate ( uint64_t  offset)
overridevirtual

Implements View.

◆ getSelectionForXref()

virtual SelectionInfoForXref TypeBrowserView::getSelectionForXref ( )
overridevirtual

Reimplemented from View.

◆ getFont()

virtual QFont TypeBrowserView::getFont ( )
overridevirtual

Implements View.

◆ updateFonts()

virtual void TypeBrowserView::updateFonts ( )
overridevirtual

Reimplemented from View.

◆ showEvent()

virtual void TypeBrowserView::showEvent ( QShowEvent *  event)
overridevirtual

◆ resizeEvent()

virtual void TypeBrowserView::resizeEvent ( QResizeEvent *  event)
overridevirtual

◆ getStatusBarWidget()

virtual StatusBarWidget * TypeBrowserView::getStatusBarWidget ( )
overridevirtual

Reimplemented from View.

◆ getHeaderOptionsWidget()

virtual QWidget * TypeBrowserView::getHeaderOptionsWidget ( )
overridevirtual

Reimplemented from View.

◆ setFilter()

virtual void TypeBrowserView::setFilter ( const std::string &  filter)
overridevirtual

Implements FilterTarget.

◆ scrollToFirstItem()

virtual void TypeBrowserView::scrollToFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ scrollToCurrentItem()

virtual void TypeBrowserView::scrollToCurrentItem ( )
overridevirtual

Implements FilterTarget.

◆ selectFirstItem()

virtual void TypeBrowserView::selectFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ activateFirstItem()

virtual void TypeBrowserView::activateFirstItem ( )
overridevirtual

Implements FilterTarget.

◆ notifyRefresh()

virtual void TypeBrowserView::notifyRefresh ( )
overridevirtual

Reimplemented from View.

◆ showSelectedTypes()

void TypeBrowserView::showSelectedTypes ( )

◆ showTypes()

void TypeBrowserView::showTypes ( const std::vector< TypeReference > &  types)

◆ selectTypeByName()

void TypeBrowserView::selectTypeByName ( const std::string &  name,
bool  newSelection 
)

◆ navigateToType()

bool TypeBrowserView::navigateToType ( const std::string &  typeName,
uint64_t  offset 
)

◆ scrollToIndexWithContext()

void TypeBrowserView::scrollToIndexWithContext ( const QModelIndex &  index,
int  context = 1 
)

◆ setPrimaryOrientation()

void TypeBrowserView::setPrimaryOrientation ( Qt::Orientation  orientation)

◆ selectedNodes()

std::vector< std::shared_ptr< TypeBrowserTreeNode > > TypeBrowserView::selectedNodes ( ) const

◆ selectedBV()

std::optional< BinaryViewRef > TypeBrowserView::selectedBV ( ) const

◆ selectedBVTypeNames()

std::optional< std::unordered_set< BinaryNinja::QualifiedName > > TypeBrowserView::selectedBVTypeNames ( ) const

◆ selectedTypeNameAndContainer()

std::optional< std::pair< BinaryNinja::TypeContainer, BinaryNinja::QualifiedName > > TypeBrowserView::selectedTypeNameAndContainer ( ) const

◆ selectedTypeNamesByContainers()

std::vector< std::pair< BinaryNinja::TypeContainer, std::vector< BinaryNinja::QualifiedName > > > TypeBrowserView::selectedTypeNamesByContainers ( ) const

◆ selectedType()

std::optional< TypeReference > TypeBrowserView::selectedType ( ) const

◆ selectedTypes()

std::vector< TypeReference > TypeBrowserView::selectedTypes ( ) const

◆ selectedTypeContainer()

std::optional< BinaryNinja::TypeContainer > TypeBrowserView::selectedTypeContainer ( bool  makeSureItHasPlatform = true,
bool  preferView = false 
) const

◆ selectedTypeContainerOrMData()

std::optional< BinaryNinja::TypeContainer > TypeBrowserView::selectedTypeContainerOrMData ( bool  makeSureItHasPlatform = true,
bool  preferView = false 
) const

◆ selectedTA()

std::optional< TypeArchiveRef > TypeBrowserView::selectedTA ( ) const

◆ selectedTAId()

std::optional< std::string > TypeBrowserView::selectedTAId ( ) const

◆ selectedTAs()

std::optional< std::unordered_set< TypeArchiveRef > > TypeBrowserView::selectedTAs ( ) const

◆ selectedTAIds()

std::optional< std::unordered_set< std::string > > TypeBrowserView::selectedTAIds ( ) const

◆ selectedTATypeIds()

std::optional< std::unordered_map< std::string, std::unordered_set< std::string > > > TypeBrowserView::selectedTATypeIds ( ) const

◆ connectedTAs()

std::vector< TypeArchiveRef > TypeBrowserView::connectedTAs ( BinaryViewRef  view) const

◆ typeIdsFromNames()

static std::optional< std::unordered_set< std::string > > TypeBrowserView::typeIdsFromNames ( BinaryViewRef  view,
const std::unordered_set< BinaryNinja::QualifiedName > &  names 
)
static

◆ associatedTypeArchivesForTypeIds()

static std::unordered_map< std::optional< TypeArchiveRef >, std::unordered_set< std::string > > TypeBrowserView::associatedTypeArchivesForTypeIds ( BinaryViewRef  view,
const std::unordered_set< std::string > &  typeIds 
)
static

◆ containerForId()

std::optional< BinaryNinja::TypeContainer > TypeBrowserView::containerForId ( const std::string &  containerId,
bool  makeSureItHasPlatform = false,
bool  preferView = false 
) const

◆ registerActions()

static void TypeBrowserView::registerActions ( )
static

◆ bindActions()

void TypeBrowserView::bindActions ( )

◆ showContextMenu()

void TypeBrowserView::showContextMenu ( )

◆ canConnectTypeArchive()

bool TypeBrowserView::canConnectTypeArchive ( )

◆ connectTypeArchive()

void TypeBrowserView::connectTypeArchive ( )

◆ canCreateTypeArchive()

bool TypeBrowserView::canCreateTypeArchive ( )

◆ createTypeArchive()

void TypeBrowserView::createTypeArchive ( )

◆ canAttachTypeArchive()

bool TypeBrowserView::canAttachTypeArchive ( )

◆ attachTypeArchive()

void TypeBrowserView::attachTypeArchive ( )

◆ canDetachTypeArchive()

bool TypeBrowserView::canDetachTypeArchive ( )

◆ detachTypeArchive()

void TypeBrowserView::detachTypeArchive ( )

◆ canSyncSelectedTypes()

bool TypeBrowserView::canSyncSelectedTypes ( )

◆ syncSelectedTypes()

void TypeBrowserView::syncSelectedTypes ( )

◆ canPushSelectedTypes()

bool TypeBrowserView::canPushSelectedTypes ( )

◆ pushSelectedTypes()

void TypeBrowserView::pushSelectedTypes ( )

◆ canPullSelectedTypes()

bool TypeBrowserView::canPullSelectedTypes ( )

◆ pullSelectedTypes()

void TypeBrowserView::pullSelectedTypes ( )

◆ canDisassociateSelectedTypes()

bool TypeBrowserView::canDisassociateSelectedTypes ( )

◆ disassociateSelectedTypes()

void TypeBrowserView::disassociateSelectedTypes ( )

◆ canCreateNewTypes()

bool TypeBrowserView::canCreateNewTypes ( )

◆ createNewTypes()

void TypeBrowserView::createNewTypes ( )

◆ canCreateNewStructure()

bool TypeBrowserView::canCreateNewStructure ( )

◆ createNewStructure()

void TypeBrowserView::createNewStructure ( )

◆ canCreateNewEnumeration()

bool TypeBrowserView::canCreateNewEnumeration ( )

◆ createNewEnumeration()

void TypeBrowserView::createNewEnumeration ( )

◆ canCreateNewUnion()

bool TypeBrowserView::canCreateNewUnion ( )

◆ createNewUnion()

void TypeBrowserView::createNewUnion ( )

◆ canRenameTypes()

bool TypeBrowserView::canRenameTypes ( )

◆ renameTypes()

void TypeBrowserView::renameTypes ( )

◆ canCopyTypeNames()

bool TypeBrowserView::canCopyTypeNames ( )

◆ copyTypeNames()

void TypeBrowserView::copyTypeNames ( )

◆ canCopyTypeDefinitions()

bool TypeBrowserView::canCopyTypeDefinitions ( )

◆ copyTypeDefinitions()

void TypeBrowserView::copyTypeDefinitions ( )

◆ canDeleteTypes()

bool TypeBrowserView::canDeleteTypes ( )

◆ deleteTypes()

void TypeBrowserView::deleteTypes ( )

◆ canChangeTypes()

bool TypeBrowserView::canChangeTypes ( )

◆ changeTypes()

void TypeBrowserView::changeTypes ( )

◆ canImportType()

bool TypeBrowserView::canImportType ( )

◆ importType()

void TypeBrowserView::importType ( )

◆ canImportTypeByGUID()

bool TypeBrowserView::canImportTypeByGUID ( BinaryViewRef  view)

◆ importTypeByGUID()

void TypeBrowserView::importTypeByGUID ( )

◆ canAddTypeLibrary()

bool TypeBrowserView::canAddTypeLibrary ( )

◆ addTypeLibrary()

void TypeBrowserView::addTypeLibrary ( )

◆ canExpandAll()

bool TypeBrowserView::canExpandAll ( )

◆ expandAll()

void TypeBrowserView::expandAll ( )

◆ canCollapseAll()

bool TypeBrowserView::canCollapseAll ( )

◆ collapseAll()

void TypeBrowserView::collapseAll ( )

◆ canSwitchLayout()

bool TypeBrowserView::canSwitchLayout ( )

◆ switchLayout()

void TypeBrowserView::switchLayout ( )

◆ typeNameNavigated

void TypeBrowserView::typeNameNavigated ( const std::string &  typeName,
bool  newSelection 
)
signal

◆ itemSelected()

void TypeBrowserView::itemSelected ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
protected

◆ itemDoubleClicked()

void TypeBrowserView::itemDoubleClicked ( const QModelIndex &  index)
protected

◆ contextMenuEvent()

virtual void TypeBrowserView::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotectedvirtual