#include <ViewerShell.h>

Public Member Functions | |
| ViewerShell () | |
| ~ViewerShell () | |
| bool | getInputSpecification (PlugInArgList *&pArgList) |
| bool | getOutputSpecification (PlugInArgList *&pArgList) |
| bool | abort () |
| void | cleanupWidget (Subject &subject, const std::string &signal, const boost::any &data) |
Protected Member Functions | |
| virtual QWidget * | getWidget () const =0 |
Protected Attributes | |
| AttachmentPtr < ApplicationServices > | mpAppSvcsAttachment |
This class contains functionality to properly destroy modeless dialogs in a plug-in. The default functionality of the class sets the destroy after execute flag to false so that the modeless dialog will not be destroyed when execute() successfully returns and the allow multiple instances flag to false so that only one modeless widget is available at any time.
The abort() method is used to register a PlugInCallback with DesktopServices to destroy the viewer widget. Derived plug-in classes should therefore provide an implementation for the getWidget() method to return a pointer to the modeless dialog or other viewer widget.
Derived plug-in classes must call the abort() method when the executable should be destroyed. This typically occurs in an overridden QWidget::closeEvent() method in the modeless dialog or when the executable has detected an error and needs to close.
Definition at line 52 of file ViewerShell.h.
| ViewerShell::ViewerShell | ( | ) |
Creates a viewer plug-in.
The constructor sets the plug-in type to PlugInManagerServices::ViewerType() and sets the plug-in to not be destroyed after execution.
| ViewerShell::~ViewerShell | ( | ) |
Destroys the viewer plug-in.
| bool ViewerShell::getInputSpecification | ( | PlugInArgList *& | pArgList | ) | [virtual] |
Retrieves the plug-in input parameters.
This method queries the plug-in for its input parameters that are needed to execute properly. The input arguments may be different in interactive mode and batch mode.
| pArgList | A plug-in arg list pointer that is set to a created input argument list specifying the plug-in input parameters. NULL is a valid pointer value if the plug-in does not require any input arguments. |
Implements Executable.
| bool ViewerShell::getOutputSpecification | ( | PlugInArgList *& | pArgList | ) | [virtual] |
Retrieves the plug-in output parameters.
This method queries the plug-in for its output parameters that are created during execution. The output arguments may be different in interactive mode and batch mode.
| pArgList | A plug-in arg list pointer that is set to a created output argument list specifying the plug-in output parameters. NULL is a valid pointer value if the plug-in does not provide any output arguments. |
Implements Executable.
| bool ViewerShell::abort | ( | ) | [virtual] |
Destroys the viewer dialog or widget.
To perform specialized cleanup, this method should be overridden to perform the cleanup before calling the base class to destroy the viewer widget.
Reimplemented from ExecutableShell.
| void ViewerShell::cleanupWidget | ( | Subject & | subject, | |
| const std::string & | signal, | |||
| const boost::any & | data | |||
| ) |
This slot is called when the ApplicationWindow closes.
The viewer widget is deleted so that proper cleanup order is preserved if the viewer is active during application shutdown.
| subject | This should be the DesktopServices pointer. | |
| signal | DesktopServices::ApplicationWindowClosed | |
| data | Invalid |
| virtual QWidget* ViewerShell::getWidget | ( | ) | const [protected, pure virtual] |
Returns the viewer widget.
A value of NULL implies that no viewer widget needs to be destroyed.
The viewer widget is typically a modeless dialog, but can be any QWidget. This method is called by the default implementation of the abort() method to destroy the widget. A derived plug-in should implement this method to return a pointer to the widget so that it can be destroyed.
Definition at line 137 of file ViewerShell.h.