00001 #ifndef _IALGORITHM_H_4648117994131_ 00002 #define _IALGORITHM_H_4648117994131_ 00003 00004 #include "iautomaton.h" 00005 00006 #include <QSharedPointer> 00007 #include <QRect> 00008 00009 class IAlgorithm 00010 { 00011 public: 00012 // types 00013 typedef QList<QSharedPointer<IAlgorithm> > TAlgorithmList; 00014 00015 virtual ~IAlgorithm() {} 00016 00017 //! Algorithm can implement own IAutomaton, IState and ITransition classes, 00018 //! in that case doesn't require creator to be set 00019 virtual bool requireCreator() const = 0; 00020 virtual void setAutomataCreator(const QSharedPointer<IAutomataCreator> &creator) = 0; 00021 00022 virtual bool hasSettingsDialog() const = 0; 00023 virtual void runSettingsDialog(QWidget *parent = NULL) = 0; 00024 00025 virtual QString getName() const = 0; 00026 00027 virtual int getInputCount() const = 0; 00028 00029 virtual bool run(const IAutomaton::TAutomataList &input, 00030 QSharedPointer<IAutomaton> &result, 00031 QString *report = 0) const = 0; 00032 }; 00033 00034 class IAlgorithmHolder 00035 { 00036 public: 00037 virtual ~IAlgorithmHolder() {} 00038 00039 virtual IAlgorithm::TAlgorithmList getAlgorithms() const = 0; 00040 00041 //! Returns version of AutomataEditor for which algorithms are implemented, tested ... 00042 virtual QString getVersion() const = 0; 00043 00044 //! Returns plugin name 00045 virtual QString getPluginName() const = 0; 00046 }; 00047 00048 Q_DECLARE_INTERFACE(IAlgorithmHolder, "AutomataEditor/IAlgorithmHolder/2.0"); 00049 00050 #endif //_IALGORITHM_H_4648117994131_