PlugIn.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 PLUGIN_H
00011 #define PLUGIN_H
00012 
00013 #include "SessionItem.h"
00014 
00015 #include <map>
00016 #include <string>
00017 
00018 class SessionItemId;
00019 
00020 /**
00021  *  Descriptive abstract interface to all plug-ins.
00022  *
00023  *  Defines the descriptive abstract interface to all plug-ins.  This
00024  *  interface is used to query all plug-ins for textual descriptive
00025  *  information.
00026  *
00027  *  @see        SessionItem
00028  */
00029 class PlugIn : public SessionItem
00030 {
00031 public:
00032    /**
00033     *  Returns the plug-in version.
00034     *
00035     *  This method returns the plug-in version as a string.
00036     *  For example, "1.1.1" is a valid version string.
00037     *
00038     *  @return  The plug-in version.
00039     */
00040    virtual std::string getVersion() const = 0;
00041 
00042    /**
00043     *  Returns the plug-in production status.
00044     *
00045     *  This method returns the plug-in production status as a bool.
00046     *
00047     *  @return  The plug-in production status.
00048     */
00049    virtual bool isProduction() const = 0;
00050 
00051    /**
00052     *  Returns the name of the organization that created the plug-in.
00053     *
00054     *  This method returns the string name of the organization
00055     *  responsible for creating the plug-in.  For example,
00056     *  "Ball Aerospace & Technologies Corp." is a valid creator string.
00057     *
00058     *  @return  The organization that created the plug-in.
00059     */
00060    virtual std::string getCreator() const = 0;
00061 
00062    /**
00063     *  Returns the full copyright information for the plug-in.
00064     *
00065     *  @return  The copyright information for the plug-in.
00066     */
00067    virtual std::string getCopyright() const = 0;
00068 
00069    /**
00070     *  Returns copyright information for plug-in dependencies.
00071     *
00072     *  This information will appear in the About box. If information
00073     *  for a given dependency name already exists, it will not be replaced.
00074     *  The copyright message may be formatted with HTML markup.
00075     *
00076     *  @return A map containing copyright information for dependencies.
00077     *          The key should be a short name for the dependency. (for example: libtiff)
00078     *          The value should be the verbatim copyright message for that plug-in.
00079     */
00080    virtual std::map<std::string, std::string> getDependencyCopyright() const = 0;
00081 
00082    /**
00083     *  Returns a text description for the plug-in.
00084     *
00085     *  This method returns the full textual description for
00086     *  a plug-in.  The description string is of arbitrary length.
00087     *
00088     *  @return  The full plug-in description.
00089     *
00090     *  @see     getShortDescription()
00091     */
00092    virtual std::string getDescription() const = 0;
00093 
00094    /**
00095     *  Returns a short description for the plug-in.
00096     *
00097     *  This method returns a short 50-charater or less 
00098     *  description about the plug-in.  This short description 
00099     *  is used for brief descriptive table entries in the GUI.
00100     *
00101     *  @return  The short plug-in description.
00102     *
00103     *  @see     getDescription()
00104     */
00105    virtual std::string getShortDescription() const = 0;
00106 
00107    /**
00108     *  Returns a unique id for the type of plug-in.
00109     *
00110     *  This method returns a unique id for the plug-in class. This string  
00111     *  should be formatted as a UUID. This value must be the same between
00112     *  instances of the application.
00113     *
00114     *  @return  The UUID
00115     */
00116    virtual std::string getDescriptorId() const = 0;
00117 
00118    /**
00119     *  Returns the plug-in type.
00120     *
00121     *  Default plug-in types include the following:
00122     *  <ul>
00123     *    <li>PlugInManagerServices::AlgorithmType()</li>
00124     *    <li>PlugInManagerServices::ExporterType()</li>
00125     *    <li>PlugInManagerServices::GeoreferenceType()</li>
00126     *    <li>PlugInManagerServices::ImporterType()</li>
00127     *    <li>PlugInManagerServices::InterpreterType()</li>
00128     *    <li>PlugInManagerServices::OptionType()</li>
00129     *    <li>PlugInManagerServices::PropertiesType()</li>
00130     *    <li>PlugInManagerServices::RasterPagerType()</li>
00131     *    <li>PlugInManagerServices::ViewerType()</li>
00132     *    <li>PlugInManagerServices::WizardType()</li>
00133     *  </ul>
00134     *
00135     *  @return  The plug-in type.
00136     */
00137    virtual std::string getType() const = 0;
00138 
00139    /**
00140     *  Returns the plug-in subtype.
00141     *
00142     *  Plug-ins can optionally define a subtype to further distinguish between
00143     *  multiple kinds of plug-ins with the same type, typically importers and
00144     *  exporters.  The subtype is used internally to populate file selection
00145     *  dialogs so that they contain only a subset of plug-ins of a given type.
00146     *  Default plug-in subtypes include the following:
00147     *  <ul>
00148     *    <li>%Layer</li>
00149     *    <li>Model Element</li>
00150     *    <li>Product</li>
00151     *    <li>Raster Element</li>
00152     *    <li>Shape File</li>
00153     *    <li>%Signature</li>
00154     *    <li>%Signature Set</li>
00155     *  </ul>
00156     *
00157     *  @return  The plug-in subtype.  An empty string may be returned,
00158     *           indicating that the plug-in does not have a specific
00159     *           subtype.
00160     *
00161     *  @see     getType()
00162     */
00163    virtual std::string getSubtype() const = 0;
00164 
00165    /**
00166     *  Queries whether multiple instances of the plug-in can be instantiated
00167     *  simultaneously.
00168     *
00169     *  If multiple instances of a plug-in are allowed, the plug-in should have
00170     *  no static variables and can have instance-independent input and output
00171     *  files.
00172     *
00173     *  @return  Returns \b true if the multiple instances of the plug-in can be
00174     *           created and executed simultaneously; otherwise returns
00175     *           \b false.
00176     */
00177    virtual bool areMultipleInstancesAllowed() const = 0;
00178 
00179    /**
00180     *  @copydoc SettableSessionItem::setId()
00181     */
00182    virtual bool setId(const SessionItemId& id) = 0;
00183 
00184 protected:
00185    /**
00186     * This should be destroyed by calling PlugInManagerServices::destroyPlugIn.
00187     */
00188    virtual ~PlugIn() {}
00189 
00190 private:
00191    friend class ModuleDescriptor;
00192    friend class PlugInDescriptorImp;
00193    friend class CoreModuleDescriptor;
00194 };
00195 
00196 #endif

Software Development Kit - Opticks 4.9.0 Build 16218