Messagelib

openurlwithmanager.h
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "messageviewer_export.h"
10#include "openwithurlinfo.h"
11#include <QList>
12#include <QObject>
13namespace MessageViewer
14{
15class MESSAGEVIEWER_EXPORT OpenUrlWithManager : public QObject
16{
17 Q_OBJECT
18public:
19 explicit OpenUrlWithManager(QObject *parent = nullptr);
20 ~OpenUrlWithManager() override;
21
22 static OpenUrlWithManager *self();
23
24 void clear();
25
26 [[nodiscard]] const QList<OpenWithUrlInfo> &openWithUrlInfo() const;
27 void setOpenWithUrlInfo(const QList<OpenWithUrlInfo> &newOpenWithUrlInfo);
28 void saveRules();
29
30 [[nodiscard]] OpenWithUrlInfo openWith(const QUrl &url);
31 [[nodiscard]] bool alwaysRuleForHost(const QUrl &url);
32
33 [[nodiscard]] QStringList hosts() const;
34
35private:
36 MESSAGEVIEWER_NO_EXPORT void loadSettings();
37 MESSAGEVIEWER_NO_EXPORT void loadUserSettings();
38 MESSAGEVIEWER_NO_EXPORT void loadGlobalSettings();
39 [[nodiscard]] MESSAGEVIEWER_NO_EXPORT QStringList openUrlWithListPath() const;
40
41 QList<OpenWithUrlInfo> mOpenWithUrlInfo;
42};
43}
KGuiItem clear()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.