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

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_PROCESSING_BIBLIOGRAPHYSERVICE_H
0021 #define KBIBTEX_PROCESSING_BIBLIOGRAPHYSERVICE_H
0022 
0023 #include <QObject>
0024 
0025 #ifdef HAVE_KF
0026 #include "kbibtexprocessing_export.h"
0027 #endif // HAVE_KF
0028 
0029 /**
0030  * To make (or test for) KBibTeX the default bibliography editor,
0031  * this class offers some essential functions. To make the association work,
0032  * KBibTeX's .desktop files have to be placed where KDE (including kbuildsycoca5)
0033  * can find them.
0034  *
0035  * @author Thomas Fischer <fischer@unix-ag.uni-kl.de>
0036  */
0037 class KBIBTEXPROCESSING_EXPORT BibliographyService : public QObject
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     explicit BibliographyService(QWidget *parentWidget);
0043     ~BibliographyService() override;
0044 
0045     /**
0046      * Set KBibTeX as default editor for supported
0047      * bibliographic file formats.
0048      */
0049     void setKBibTeXasDefault();
0050 
0051     /**
0052      * Test if KBibTeX is default editor for supported
0053      * bibliographic file formats.
0054      * @return true if KBibTeX is default editor, else false
0055      */
0056     bool isKBibTeXdefault() const;
0057 
0058 private:
0059     class Private;
0060     Private *const d;
0061 };
0062 
0063 #endif // KBIBTEX_PROCESSING_BIBLIOGRAPHYSERVICE_H