File indexing completed on 2024-05-19 13:31:44

0001 // clang-format off
0002 /*
0003  * KDiff3 - Text Diff And Merge Tool
0004  *
0005  * SPDX-FileCopyrightText: 2002-2011 Joachim Eibl, joachim.eibl at gmx.de
0006  * SPDX-FileCopyrightText: 2018-2020 Michael Reeves reeves.87@gmail.com
0007  * SPDX-License-Identifier: GPL-2.0-or-later
0008  */
0009 // clang-format on
0010 
0011 #ifndef KDIFF3SHELL_H
0012 #define KDIFF3SHELL_H
0013 
0014 #include <memory>
0015 
0016 #include <QCommandLineParser>
0017 #include <QPointer>
0018 #include <QString>
0019 
0020 #include <KXmlGuiWindow>
0021 
0022 class KToggleAction;
0023 class KDiff3App;
0024 
0025 /**
0026  * This is the application "Shell".  It has a menubar, toolbar, and
0027  * statusbar but relies on the "Part" to do all the real work.
0028  *
0029  * @short Application Shell
0030  * @author Joachim Eibl <joachim.eibl at gmx.de>
0031  */
0032 class KDiff3Shell: public KXmlGuiWindow
0033 {
0034     Q_OBJECT
0035   public:
0036     /**
0037      * Default Constructor
0038      */
0039     explicit KDiff3Shell(const QString& fn1 = "", const QString& fn2 = "", const QString& fn3 = "");
0040 
0041     /**
0042      * Default Destructor
0043      */
0044     ~KDiff3Shell() override;
0045 
0046     bool queryClose() override;
0047     bool queryExit();
0048     void closeEvent(QCloseEvent* e) override;
0049 
0050     static inline std::unique_ptr<QCommandLineParser>& getParser()
0051     {
0052         static std::unique_ptr<QCommandLineParser> parser = std::make_unique<QCommandLineParser>();
0053         return parser;
0054     };
0055   private Q_SLOTS:
0056     void optionsShowToolbar();
0057     void optionsShowStatusbar();
0058     void optionsConfigureKeys();
0059     void optionsConfigureToolbars();
0060 
0061     void applyNewToolbarConfig();
0062     void slotNewInstance(const QString& fn1, const QString& fn2, const QString& fn3);
0063 
0064   private:
0065     QPointer<KDiff3App> m_widget;
0066 
0067     KToggleAction* m_toolbarAction;
0068     KToggleAction* m_statusbarAction;
0069 };
0070 
0071 #endif // _KDIFF3_H_