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 PLUGINDESCRIPTOR_H 00011 #define PLUGINDESCRIPTOR_H 00012 00013 #include "SessionItem.h" 00014 00015 #include <map> 00016 #include <string> 00017 #include <vector> 00018 00019 class PlugInArgList; 00020 00021 /** 00022 * Caches plug-in metadata returned from the Importer, Exporter, Testable, 00023 * Interpreter, Executable, and PlugIn interfaces. 00024 * 00025 * This class provides 00026 * metadata without ever instantiating the plug-in. 00027 */ 00028 class PlugInDescriptor : public SessionItem 00029 { 00030 public: 00031 /** 00032 * @copydoc PlugIn::getVersion() 00033 */ 00034 virtual std::string getVersion() const = 0; 00035 00036 /** 00037 * @copydoc PlugIn::isProduction() 00038 */ 00039 virtual bool isProduction() const = 0; 00040 00041 /** 00042 * @copydoc PlugIn::getCreator() 00043 */ 00044 virtual std::string getCreator() const = 0; 00045 00046 /** 00047 * @copydoc PlugIn::getCopyright() 00048 */ 00049 virtual std::string getCopyright() const = 0; 00050 00051 /** 00052 * @copydoc PlugIn::getDependencyCopyright() 00053 */ 00054 virtual std::map<std::string, std::string> getDependencyCopyright() const = 0; 00055 00056 /** 00057 * @copydoc PlugIn::getDescription() 00058 */ 00059 virtual std::string getDescription() const = 0; 00060 00061 /** 00062 * @copydoc PlugIn::getShortDescription() 00063 */ 00064 virtual std::string getShortDescription() const = 0; 00065 00066 /** 00067 * @copydoc PlugIn::getType() 00068 */ 00069 virtual std::string getType() const = 0; 00070 00071 /** 00072 * @copydoc PlugIn::getSubtype() 00073 */ 00074 virtual std::string getSubtype() const = 0; 00075 00076 /** 00077 * @copydoc PlugIn::areMultipleInstancesAllowed() 00078 */ 00079 virtual bool areMultipleInstancesAllowed() const = 0; 00080 00081 /** 00082 * Queries the value of 00083 * Executable::isExecutedOnStartup() for Executable plug-ins. 00084 * 00085 * @return Returns the value provided by Executable::isExecutedOnStartup() 00086 * or false if the plug-in is not of type Executable. 00087 */ 00088 virtual bool isExecutedOnStartup() const = 0; 00089 00090 /** 00091 * Queries the value of 00092 * Executable::isDestroyedAfterExecute() for Executable plug-ins. 00093 * 00094 * @return Returns the value provided by Executable::isDestroyedAfterExecute() 00095 * or true if the plug-in is not of type Executable. 00096 */ 00097 virtual bool isDestroyedAfterExecute() const = 0; 00098 00099 /** 00100 * Queries the value of 00101 * Executable::getMenuLocations() for Executable plug-ins. 00102 * 00103 * @return Returns the value provided by Executable::getMenuLocations() 00104 * or an empty vector if the plug-in is not of type Executable. 00105 */ 00106 virtual const std::vector<std::string>& getMenuLocations() const = 0; 00107 00108 /** 00109 * Queries the value of 00110 * Executable::hasAbort() for Executable plug-ins. 00111 * 00112 * @return Returns the value provided by Executable::hasAbort() 00113 * or false if the plug-in is not of type Executable. 00114 */ 00115 virtual bool hasAbort() const = 0; 00116 00117 /** 00118 * Queries the value of 00119 * Executable::setBatch() for Executable plug-ins. 00120 * 00121 * @return Returns true if Executable::setBatch() 00122 * will return true, false otherwise. If 00123 * the plug-in is not of type Executable, false 00124 * will be returned. 00125 */ 00126 virtual bool hasBatchSupport() const = 0; 00127 00128 /** 00129 * Queries the value of 00130 * Executable::setInteractive() for Executable plug-ins. 00131 * 00132 * @return Returns true if Executable::setInteractive() 00133 * will return true, false otherwise. If 00134 * the plug-in is not of type Executable, false 00135 * will be returned. 00136 */ 00137 virtual bool hasInteractiveSupport() const = 0; 00138 00139 /** 00140 * Queries the value of 00141 * Executable::hasWizardSupport() for Executable plug-ins. 00142 * 00143 * @return Returns the value provided by Executable::hasWizardSupport() 00144 * or false if the plug-in is not of type Executable. 00145 */ 00146 virtual bool hasWizardSupport() const = 0; 00147 00148 /** 00149 * Returns the batch input argument list for Executable plug-ins. 00150 * 00151 * The returned PlugInArgList is owned by this object, 00152 * so do not attempt to delete it. 00153 * 00154 * @return Returns the PlugInArgList that was returned 00155 * via the pArgList parameter of Executable::getInputSpecification() 00156 * after setBatch() was called on the plug-in instance. If 00157 * the plug-in is not of type Executable, NULL will be returned. 00158 */ 00159 virtual const PlugInArgList* getBatchInputArgList() const = 0; 00160 00161 /** 00162 * Returns the interactive input argument list for Executable plug-ins. 00163 * 00164 * The returned PlugInArgList is owned by this object, 00165 * so do not attempt to delete it. 00166 * 00167 * @return Returns the PlugInArgList that was returned 00168 * via the pArgList parameter of Executable::getInputSpecification() 00169 * after setInteractive() was called on the plug-in instance. If 00170 * the plug-in is not of type Executable, NULL will be returned. 00171 */ 00172 virtual const PlugInArgList* getInteractiveInputArgList() const = 0; 00173 00174 /** 00175 * Returns the batch output argument list for Executable plug-ins. 00176 * 00177 * The returned PlugInArgList is owned by this object, 00178 * so do not attempt to delete it. 00179 * 00180 * @return Returns the PlugInArgList that was returned 00181 * via the pArgList parameter of Executable::getOutputSpecification() 00182 * after setBatch() was called on the plug-in instance. If 00183 * the plug-in is not of type Executable, NULL will be returned. 00184 */ 00185 virtual const PlugInArgList* getBatchOutputArgList() const = 0; 00186 00187 /** 00188 * Returns the interactive output argument list for Executable plug-ins. 00189 * 00190 * The returned PlugInArgList is owned by this object, 00191 * so do not attempt to delete it. 00192 * 00193 * @return Returns the PlugInArgList that was returned 00194 * via the pArgList parameter of Executable::getOutputSpecification() 00195 * after setInteractive() was called on the plug-in instance. If 00196 * the plug-in is not of type Executable, NULL will be returned. 00197 */ 00198 virtual const PlugInArgList* getInteractiveOutputArgList() const = 0; 00199 00200 /** 00201 * Returns the file extensions supported by this plug-in. 00202 * 00203 * If the plug-in is of type Importer, then the returned 00204 * value will be Importer::getDefaultExtensions(). If the 00205 * plug-in is of type Exporter, then the returned value 00206 * will be Exporter::getDefaultExtensions(). If the plug-in 00207 * is of type Interpreter, then the returned value will be 00208 * Interpreter::getFileExtensions(). If the plug-in is 00209 * none of these types, then an empty string will be 00210 * returned. 00211 * 00212 * @return The file extensions supported by this plug-in. 00213 */ 00214 virtual std::string getFileExtensions() const = 0; 00215 00216 /** 00217 * Queries whether the plug-in is Testable. 00218 * 00219 * @return Returns true if the plug-in instance could 00220 * be successfully cast to a Testable*, false 00221 * otherwise. 00222 */ 00223 virtual bool isTestable() const = 0; 00224 00225 protected: 00226 /** 00227 * This will be cleaned up during application close. Plug-ins do not 00228 * need to destroy it. 00229 */ 00230 virtual ~PlugInDescriptor() {} 00231 }; 00232 00233 #endif