1 /** 2 * UGENE - Integrated Bioinformatics Tools. 3 * Copyright (C) 2008-2021 UniPro <ugene@unipro.ru> 4 * http://ugene.net 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 #ifndef _U2_GENERATE_DNA_WORKER_H_ 23 #define _U2_GENERATE_DNA_WORKER_H_ 24 25 #include <U2Lang/LocalDomain.h> 26 #include <U2Lang/WorkflowUtils.h> 27 28 namespace U2 { 29 namespace LocalWorkflow { 30 31 class GenerateDNAPrompter : public PrompterBase<GenerateDNAPrompter> { 32 Q_OBJECT 33 public: 34 GenerateDNAPrompter(Actor *p = 0) 35 : PrompterBase<GenerateDNAPrompter>(p) { 36 } 37 38 protected: 39 QString composeRichDoc(); 40 }; 41 42 class GenerateDNAWorker : public BaseWorker { 43 Q_OBJECT 44 public: GenerateDNAWorker(Actor * a)45 GenerateDNAWorker(Actor *a) 46 : BaseWorker(a), ch(nullptr) { 47 } 48 49 virtual void init(); 50 virtual Task *tick(); cleanup()51 virtual void cleanup() { 52 } 53 54 private slots: 55 void sl_taskFinished(Task *); 56 57 private: 58 CommunicationChannel *ch; 59 }; 60 61 class GenerateDNAWorkerFactory : public DomainFactory { 62 public: 63 static const QString ACTOR_ID; 64 static void init(); GenerateDNAWorkerFactory()65 GenerateDNAWorkerFactory() 66 : DomainFactory(ACTOR_ID) { 67 } createWorker(Actor * a)68 virtual Worker *createWorker(Actor *a) { 69 return new GenerateDNAWorker(a); 70 } 71 }; 72 73 } // namespace LocalWorkflow 74 } // namespace U2 75 76 #endif 77