File indexing completed on 2024-05-19 05:05:51

0001 /***************************************************************************
0002  *   SPDX-License-Identifier: GPL-2.0-or-later
0003  *                                                                         *
0004  *   SPDX-FileCopyrightText: 2004-2019 Thomas Fischer <fischer@unix-ag.uni-kl.de>
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  *   This program is distributed in the hope that it will be useful,       *
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0014  *   GNU General Public License for more details.                          *
0015  *                                                                         *
0016  *   You should have received a copy of the GNU General Public License     *
0017  *   along with this program; if not, see <https://www.gnu.org/licenses/>. *
0018  ***************************************************************************/
0019 
0020 #ifndef KBIBTEX_PROGRAM_MAINWINDOW_H
0021 #define KBIBTEX_PROGRAM_MAINWINDOW_H
0022 
0023 #include <kparts/mainwindow.h>
0024 #include <KConfigGroup>
0025 
0026 #include "openfileinfo.h"
0027 
0028 class QTextEdit;
0029 class QDragEnterEvent;
0030 class QDropEvent;
0031 class QCloseEvent;
0032 
0033 class ReferencePreview;
0034 class FileView;
0035 
0036 class KBibTeXMainWindow : public KParts::MainWindow
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041     explicit KBibTeXMainWindow(QWidget *parent = nullptr);
0042     ~KBibTeXMainWindow() override;
0043 
0044 public Q_SLOTS:
0045     void openDocument(const QUrl &url);
0046 
0047 protected: // KMainWindow API
0048     void dragEnterEvent(QDragEnterEvent *event) override;
0049     void dropEvent(QDropEvent *event) override;
0050     void closeEvent(QCloseEvent *event) override;
0051 
0052 protected:
0053     void setupControllers();
0054 
0055 protected Q_SLOTS:
0056     void newDocument();
0057     void openDocumentDialog();
0058     void showPreferences();
0059     void documentSwitched(FileView *, FileView *);
0060 
0061 private Q_SLOTS:
0062     void showSearchResults();
0063     void documentListsChanged(OpenFileInfo::StatusFlags statusFlags);
0064     void openRecentFile();
0065     void queryCloseAll();
0066     void delayed();
0067 
0068 private:
0069     class KBibTeXMainWindowPrivate;
0070     KBibTeXMainWindowPrivate *d;
0071 };
0072 
0073 #endif // KBIBTEX_PROGRAM_MAINWINDOW_H