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_REMOVE_PART_FROM_SEQUENCE_CONTROLLER_H_
23 #define _U2_REMOVE_PART_FROM_SEQUENCE_CONTROLLER_H_
24 
25 #include <QDialog>
26 
27 #include <U2Core/U1AnnotationUtils.h>
28 #include <U2Core/U2Region.h>
29 
30 class Ui_RemovePartFromSequenceDialog;
31 
32 namespace U2 {
33 
34 class SaveDocumentController;
35 
36 class U2GUI_EXPORT RemovePartFromSequenceDialogController : public QDialog {
37     Q_OBJECT
38 public:
39     RemovePartFromSequenceDialogController(U2Region _toDelete, U2Region _source, const QString &docUrl, QWidget *p = nullptr);
40     ~RemovePartFromSequenceDialogController();
41     void accept();
42 
43     bool modifyCurrentDocument() const;
44     QString getNewDocumentPath() const;
45     U1AnnotationUtils::AnnotationStrategyForResize getStrategy();
46     U2Region getRegionToDelete() const;
47     bool mergeAnnotations() const;
48     bool recalculateQualifiers() const;
49     DocumentFormatId getDocumentFormatId() const;
50 
51 private slots:
52     void sl_mergeAnnotationsToggled(bool);
53 
54 private:
55     void initSaveController(const QString &docUrl);
56 
57     QString filter;
58     U2Region toDelete;
59     U2Region source;
60     Ui_RemovePartFromSequenceDialog *ui;
61     SaveDocumentController *saveController;
62 };
63 
64 }  // namespace U2
65 
66 #endif
67