ExporterShell.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef EXPORTERSHELL_H
00011 #define EXPORTERSHELL_H
00012 
00013 #include "Exporter.h"
00014 #include "ExecutableShell.h"
00015 
00016 #include <string>
00017 #include <vector>
00018 
00019 class PlugInArgList;
00020 
00021 /**
00022  *  \ingroup ShellModule
00023  *  %Exporter Shell
00024  *
00025  *  This class represents the shell for an exporter plug-in.  %Exporter
00026  *  developers would take this class and extend it to support their
00027  *  exporter specific code.
00028  *
00029  *  @see     ExecutableShell, Exporter
00030  */
00031 class ExporterShell : public ExecutableShell, public Exporter
00032 {
00033 public:
00034    /**
00035     *  Creates an exporter plug-in.
00036     *
00037     *  The constructor sets the plug-in type to PlugInManagerServices::ExporterType().
00038     *
00039     *  @see     getType()
00040     */
00041    ExporterShell();
00042 
00043    /**
00044     *  Destroys the exporter plug-in.
00045     */
00046    ~ExporterShell();
00047 
00048    /**
00049     *  @copydoc Executable::getInputSpecification()
00050     *
00051     *  @default The default implementation adds the following args:
00052     *  <table><tr><th>Name</th>           <th>Type</th></tr>
00053     *         <tr><td>File Descriptor</td><td>FileDescriptor</td></tr>
00054     *         <tr><td>Progress</td>       <td>Progress</td></tr></table>
00055     */
00056    bool getInputSpecification(PlugInArgList*& pArgList);
00057 
00058    /**
00059     *  @copydoc Executable::getOutputSpecification()
00060     *
00061     *  @default The default implementation does not set any args in the arg
00062     *           list and returns \b true.
00063     */
00064    bool getOutputSpecification(PlugInArgList*& pArgList);
00065 
00066    /**
00067     *  @copydoc Exporter::getDefaultExtensions()
00068     *
00069     *  @default The default implementation returns the extension string that
00070     *           was passed into setExtensions().  If setExtensions() has not
00071     *           yet been called, an empty string is returned.
00072     */
00073    std::string getDefaultExtensions() const;
00074 
00075    /**
00076     *  @copydoc Exporter::validate()
00077     *
00078     *  @default The default implementation checks for the existence of a valid
00079     *           FileDescriptor argument in the arg list.
00080     */
00081    ValidationResultType validate(const PlugInArgList* pArgList, std::string& errorMessage) const;
00082 
00083    /**
00084     *  @copydoc Exporter::getExportOptionsWidget()
00085     *
00086     *  @default The default implementation returns \b NULL.
00087     */
00088    QWidget* getExportOptionsWidget(const PlugInArgList* pInArgList);
00089 
00090 protected:
00091    /**
00092     *  Sets the default file extensions recognized by the exporter.
00093     *
00094     *  @param   extensions
00095     *           The file extensions recognized by the exporter.  The string
00096     *           should consist of a description followed by one or more
00097     *           extensions separated by a space.  Multiple file types may
00098     *           be specified with a double semicolon.  Examples include
00099     *           "ENVI Header Files (*.hdr)", "TIFF Files (*.tif *.tiff)",
00100     *           and "Source Files (*.c*);;Header Files (*.h)".
00101     */
00102    void setExtensions(const std::string& extensions);
00103 
00104 private:
00105    std::string mExtension;
00106 };
00107 
00108 #endif

Software Development Kit - Opticks 4.9.0 Build 16218