1 /*
2  * KDiff3 - Text Diff And Merge Tool
3  *
4  * SPDX-FileCopyrightText: 2002-2011 Joachim Eibl, joachim.eibl at gmx.de
5  * SPDX-FileCopyrightText: 2018-2020 Michael Reeves reeves.87@gmail.com
6  * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 
9 #ifndef KDIFF3SHELL_H
10 #define KDIFF3SHELL_H
11 
12 #include <KParts/MainWindow>
13 #include <QCommandLineParser>
14 #include <QString>
15 
16 class KToggleAction;
17 
18 namespace KParts {
19     class ReadWritePart;
20 }
21 
22 class KDiff3App;
23 
24 /**
25  * This is the application "Shell".  It has a menubar, toolbar, and
26  * statusbar but relies on the "Part" to do all the real work.
27  *
28  * @short Application Shell
29  * @author Joachim Eibl <joachim.eibl at gmx.de>
30  */
31 class KDiff3Shell : public KParts::MainWindow
32 {
33     Q_OBJECT
34 public:
35     /**
36      * Default Constructor
37      */
38     explicit KDiff3Shell(bool bCompleteInit=true);
39 
40     /**
41      * Default Destructor
42      */
43     ~KDiff3Shell() override;
44 
45     bool queryClose() override;
46     bool queryExit();
47     void closeEvent(QCloseEvent*e) override;
48 
getParser()49     static inline QCommandLineParser* getParser(){
50       static QCommandLineParser *parser = new QCommandLineParser();
51       return parser;
52     };
53 private Q_SLOTS:
54     void optionsShowToolbar();
55     void optionsShowStatusbar();
56     void optionsConfigureKeys();
57     void optionsConfigureToolbars();
58 
59     void applyNewToolbarConfig();
60     void slotNewInstance( const QString& fn1, const QString& fn2, const QString& fn3 );
61 
62 private:
63     KParts::ReadWritePart *m_part;
64     KDiff3App *m_widget;
65 
66     KToggleAction *m_toolbarAction;
67     KToggleAction *m_statusbarAction;
68     bool m_bUnderConstruction;
69 };
70 
71 #endif // _KDIFF3_H_
72