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_GENEBYGENEREPORT_WORKER_H_
23 #define _U2_GENEBYGENEREPORT_WORKER_H_
24 
25 #include <QList>
26 #include <QMap>
27 
28 #include <U2Core/AnnotationData.h>
29 
30 #include <U2Lang/LocalDomain.h>
31 #include <U2Lang/WorkflowUtils.h>
32 
33 namespace U2 {
34 namespace LocalWorkflow {
35 
36 class GeneByGeneReportWorker : public BaseWorker {
37     Q_OBJECT
38 public:
39     GeneByGeneReportWorker(Actor *p);
40 
41     virtual void init();
42     virtual Task *tick();
43     virtual void cleanup();
44 
45     // for files in the report
46     virtual QStringList getOutputFiles();
47 
48 private:
49     IntegralBus *inChannel;
50     QStringList outFiles;
51     QMap<QString, QPair<DNASequence, QList<SharedAnnotationData>>> geneData;
52 
53 private slots:
54     void sl_taskFinished();
55 };  // GeneByGeneReportWorker
56 
57 class GeneByGeneReportWorkerFactory : public DomainFactory {
58 public:
59     static const QString ACTOR_ID;
60 
GeneByGeneReportWorkerFactory()61     GeneByGeneReportWorkerFactory()
62         : DomainFactory(ACTOR_ID) {
63     }
64     static void init();
65     virtual Worker *createWorker(Actor *a);
66 };  // GeneByGeneReportWorkerFactory
67 
68 class GeneByGeneReportPrompter : public PrompterBase<GeneByGeneReportPrompter> {
69     Q_OBJECT
70 public:
71     GeneByGeneReportPrompter(Actor *p = nullptr)
72         : PrompterBase<GeneByGeneReportPrompter>(p) {
73     }
74 
75 protected:
76     QString composeRichDoc();
77 
78 };  // GeneByGeneReportPrompter
79 
80 }  // namespace LocalWorkflow
81 }  // namespace U2
82 
83 #endif  //_U2_GENEBYGENEREPORT_WORKER_H_
84