FileTypes CellMLSupportPlugin::fileTypes() const { // Return the CellML file type that the CellMLSupport plugin supports return FileTypes() << FileType(qobject_cast<FileInterface *>(this), CellmlMimeType, CellmlFileExtension); }
CellMLSupportPlugin::CellMLSupportPlugin() { // The file types that we support mFileTypes = FileTypes() << new FileType(qobject_cast<FileTypeInterface *>(this), CellmlMimeType, CellmlFileExtension); }
void CorePlugin::pluginsInitialized(const Plugins &pLoadedPlugins) { // Retrieve the different file types supported by our various plugins and // make our central widget aware of them FileTypes supportedFileTypes = FileTypes(); foreach (Plugin *plugin, pLoadedPlugins) { FileTypeInterface *fileTypeInterface = qobject_cast<FileTypeInterface *>(plugin->instance()); if (fileTypeInterface) // The plugin implements our file type interface, so add the // supported file types, but only if they are not already in our // list foreach (FileType *fileType, fileTypeInterface->fileTypes()) if (!supportedFileTypes.contains(fileType)) supportedFileTypes << fileType; }
FileTypes FileInterface::fileTypes() const { // By default, there are no file types return FileTypes(); }
FileTypeInterface::FileTypeInterface() : mFileTypes(FileTypes()) { }