Messagelib

urlhandlermanager.h
1/* -*- c++ -*-
2 urlhandlermanager.h
3
4 This file is part of KMail, the KDE mail client.
5 SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
6 SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
7 SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#pragma once
13
14#include "messageviewer_private_export.h"
15
16#include <QList>
17
18class QUrl;
19class QString;
20class QPoint;
21
22namespace MimeTreeParser
23{
24class URLHandler;
25}
26
27namespace MessageViewer
28{
29namespace Interface
30{
31class BodyPartURLHandler;
32}
33class ViewerPrivate;
34class BodyPartURLHandlerManager;
35/**
36 * @short Singleton to manage the list of URLHandlers
37 * @author Marc Mutz <mutz@kde.org>
38 */
39class MESSAGEVIEWER_TESTS_EXPORT URLHandlerManager
40{
41 static URLHandlerManager *self;
42
44
45public:
47
48 static URLHandlerManager *instance();
49
50 void registerHandler(const MimeTreeParser::URLHandler *handler);
51 void unregisterHandler(const MimeTreeParser::URLHandler *handler);
52
53 void registerHandler(const Interface::BodyPartURLHandler *handler, const QString &mimeType);
54 void unregisterHandler(const Interface::BodyPartURLHandler *handler);
55
56 [[nodiscard]] bool handleClick(const QUrl &url, ViewerPrivate *w = nullptr) const;
57 [[nodiscard]] bool handleShiftClick(const QUrl &url, ViewerPrivate *window = nullptr) const;
58 [[nodiscard]] bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ViewerPrivate *w = nullptr) const;
59 [[nodiscard]] bool willHandleDrag(const QUrl &url, ViewerPrivate *window = nullptr) const;
60 [[nodiscard]] bool handleDrag(const QUrl &url, ViewerPrivate *window = nullptr) const;
61 [[nodiscard]] QString statusBarMessage(const QUrl &url, ViewerPrivate *w = nullptr) const;
62
63private:
65 HandlerList mHandlers;
66 BodyPartURLHandlerManager *mBodyPartURLHandlerManager = nullptr;
67};
68}
An interface to body part reader link handlers.
Singleton to manage the list of URLHandlers.
An interface to reader link handlers.
Definition urlhandler.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:53:09 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.