UIContextNotification Class Reference

Detailed Description

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 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 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 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...
 

Member Function Documentation

◆ 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

◆ 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

◆ 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)

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ OnContextClose()

virtual void UIContextNotification::OnContextClose ( UIContext context)
inlinevirtual

Callback right before closing a UIContext.

Parameters
contextClosing context

◆ OnContextOpen()

virtual void UIContextNotification::OnContextOpen ( UIContext context)
inlinevirtual

Callback after a UIContext is opened (eg MainWindow)

Parameters
contextOpened context

◆ 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.

◆ 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.


The documentation for this class was generated from the following file: