File indexing completed on 2024-10-06 12:54:08

0001 // SPDX-FileCopyrightText: 2022 Nicolas Fella <nicolas.fella@gmx.de>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #pragma once
0005 
0006 #include <QObject>
0007 #include <QUrl>
0008 
0009 /**
0010  * @class UrlHelper
0011  *
0012  * A class to help manage URLs.
0013  */
0014 class UrlHelper : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018     /**
0019      * @brief Open the given URL in an appropriate app.
0020      */
0021     Q_INVOKABLE void openUrl(const QUrl &url);
0022 
0023     /**
0024      * @brief Copy the given URL to the given location.
0025      */
0026     Q_INVOKABLE void copyTo(const QUrl &origin, const QUrl &destination);
0027 };