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_ACE_IMPORTER_H_
23 #define _U2_ACE_IMPORTER_H_
24 
25 #include <U2Core/DocumentImport.h>
26 #include <U2Core/DocumentProviderTask.h>
27 
28 namespace U2 {
29 
30 class ConvertAceToSqliteTask;
31 class CloneObjectTask;
32 class LoadDocumentTask;
33 
34 class AceImporterTask : public DocumentProviderTask {
35     Q_OBJECT
36 public:
37     AceImporterTask(const GUrl &url, const QVariantMap &settings);
38 
39     void prepare() override;
40     QList<Task *> onSubTaskFinished(Task *subTask) override;
41     ReportResult report() override;
42 
43 private:
44     void initCloneObjectTasks();
45     void initLoadDocumentTask();
46 
47     ConvertAceToSqliteTask *convertTask;
48     QList<Task *> cloneTasks;
49     LoadDocumentTask *loadDocTask;
50 
51     bool isSqliteDbTransit;
52 
53     QVariantMap settings;
54 
55     U2DbiRef localDbiRef;
56     U2DbiRef dstDbiRef;
57     GUrl srcUrl;
58     qint64 startTime;
59 };
60 
61 ///////////////////////////////////
62 //// AceImporter
63 ///////////////////////////////////
64 
65 class U2FORMATS_EXPORT AceImporter : public DocumentImporter {
66     Q_OBJECT
67 public:
68     AceImporter();
69 
70     FormatCheckResult checkRawData(const QByteArray &rawData, const GUrl &url) override;
71     DocumentProviderTask *createImportTask(const FormatDetectionResult &res, bool showGui, const QVariantMap &hints) override;
72 
73     static const QString ID;
74     static const QString SRC_URL;
75 };
76 
77 }  // namespace U2
78 
79 #endif  // _U2_ACE_IMPORTER_H_
80