ExporterShell Class Reference
[Plug-In Shells]

Exporter Shell More...

#include <ExporterShell.h>

Inheritance diagram for ExporterShell:

Inheritance graph

List of all members.

Public Member Functions

 ExporterShell ()
 ~ExporterShell ()
bool getInputSpecification (PlugInArgList *&pArgList)
bool getOutputSpecification (PlugInArgList *&pArgList)
std::string getDefaultExtensions () const
ValidationResultType validate (const PlugInArgList *pArgList, std::string &errorMessage) const
QWidget * getExportOptionsWidget (const PlugInArgList *pInArgList)

Protected Member Functions

void setExtensions (const std::string &extensions)


Detailed Description

Exporter Shell

This class represents the shell for an exporter plug-in. Exporter developers would take this class and extend it to support their exporter specific code.

See also:
ExecutableShell, Exporter

Definition at line 31 of file ExporterShell.h.


Constructor & Destructor Documentation

ExporterShell::ExporterShell (  ) 

Creates an exporter plug-in.

The constructor sets the plug-in type to PlugInManagerServices::ExporterType().

See also:
getType()

ExporterShell::~ExporterShell (  ) 

Destroys the exporter plug-in.


Member Function Documentation

bool ExporterShell::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.

Parameters:
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.
Returns:
Returns true if the input parameter argument list was successfully created. If the plug-in does not require input arguments, true is returned, but the given plug-in arg list pointer may be NULL.
See also:
PlugInArgList

Default Implementation:
The default implementation adds the following args:
Name Type
File DescriptorFileDescriptor
Progress Progress

Implements Executable.

bool ExporterShell::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.

Parameters:
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.
Returns:
Returns true if the output parameter argument list was successfully created. If the plug-in does not provide output arguments, true is returned, but the given plug-in arg list pointer may be NULL.
See also:
PlugInArgList

Default Implementation:
The default implementation does not set any args in the arg list and returns true.

Implements Executable.

std::string ExporterShell::getDefaultExtensions (  )  const [virtual]

Returns the default file extensions recognized by the exporter.

Returns:
The file extensions recognized by the exporter as a string. The string consists of a description followed by one or more file extensions separated by a space. Multiple file types may be specified with a double semicolon. Examples include "ENVI Header Files (*.hdr)", "TIFF Files (*.tif *.tiff)", and "Source Files (*.c*);;Header Files (*.h)".

Default Implementation:
The default implementation returns the extension string that was passed into setExtensions(). If setExtensions() has not yet been called, an empty string is returned.

Implements Exporter.

ValidationResultType ExporterShell::validate ( const PlugInArgList pArgList,
std::string &  errorMessage 
) const [virtual]

Queries whether a given argument list can be successfully saved by the exporter.

This method is called for the exporter to parse the current settings in the plug-in argument list to see if it supports saving the data as currently specified. This allows exporters that do not support certain combinations of values and options to indicate as such. This method is called each time the user changes a value in the export options dialog.

Parameters:
pArgList The plug-in argument list as requested in getInputSpecification. This is populated as it would be in a call to execute.
errorMessage An error message that is populated with the reason why the exporter cannot save the given data descriptor. This message will be displayed to the user. When returning ValidationResultType::VALIDATE_INFO, a non-empty errorMessage is required.
Returns:
Returns a result based on the level of validation success. Either complete success, complete failure, a success with a caveat which will be reported to the user, or a potential success with additional input from the user.
See also:
ValidationResultType

Default Implementation:
The default implementation checks for the existence of a valid FileDescriptor argument in the arg list.

Implements Exporter.

QWidget* ExporterShell::getExportOptionsWidget ( const PlugInArgList pInArgList  )  [virtual]

Returns a widget to display custom export option values.

This method provides an interface for which specialized export options can be displayed to the user. The method returns a Qt widget that is added to the default export options dialog. The exporter should create the widget with a NULL parent, and should destroy the widget when the exporter itself is destroyed.

Exporters should call QWidget::setWindowTitle() on the widget that is returned to set the name that appears on the tab in the export options dialog. If the window title is not set, the exporter name is displayed. If the returned widget is the only widget to display, a tab widget is not used in the dialog.

Parameters:
pInArgList The input argument list specified by Executable::getInputSpecification() and populated as if being passed to Executable::execute().
Returns:
A QWidget that will be displayed as an additional tab in the default export options dialog. NULL should be returned if the exporter does not have custom options to display to the user.

Default Implementation:
The default implementation returns NULL.

Implements Exporter.

void ExporterShell::setExtensions ( const std::string &  extensions  )  [protected]

Sets the default file extensions recognized by the exporter.

Parameters:
extensions The file extensions recognized by the exporter. The string should consist of a description followed by one or more extensions separated by a space. Multiple file types may be specified with a double semicolon. Examples include "ENVI Header Files (*.hdr)", "TIFF Files (*.tif *.tiff)", and "Source Files (*.c*);;Header Files (*.h)".


Software Development Kit - Opticks 4.9.0 Build 16218