File indexing completed on 2024-11-24 04:34:15

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_GUI_ASSOCIATEDFILESUI_H
0021 #define KBIBTEX_GUI_ASSOCIATEDFILESUI_H
0022 
0023 #include <QWidget>
0024 
0025 #include <Entry>
0026 #include <File>
0027 #include <AssociatedFiles>
0028 
0029 #include "kbibtexgui_export.h"
0030 
0031 /**
0032  * @author Thomas Fischer <fischer@unix-ag.uni-kl.de>
0033  */
0034 class KBIBTEXGUI_EXPORT AssociatedFilesUI: public QWidget
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     ~AssociatedFilesUI() override;
0040 
0041     static QString associateUrl(const QUrl &url, QSharedPointer<Entry> &entry, const File *bibTeXfile, const bool doInsertUrl, QWidget *parent);
0042 
0043     AssociatedFiles::RenameOperation renameOperation() const;
0044     AssociatedFiles::MoveCopyOperation moveCopyOperation() const;
0045     AssociatedFiles::PathType pathType() const;
0046     QString userDefinedFilename() const;
0047 
0048 protected:
0049     explicit AssociatedFilesUI(const QString &entryId, const File *bibTeXfile, QWidget *parent);
0050 
0051 private Q_SLOTS:
0052     void updateUIandPreview();
0053 
0054 private:
0055     class Private;
0056     Private *const d;
0057 
0058     void setupForRemoteUrl(const QUrl &url, const QString &entryId);
0059     void setupForLocalFile(const QUrl &url, const QString &entryId);
0060 };
0061 
0062 #endif // KBIBTEX_GUI_ASSOCIATEDFILESUI_H