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 <[email protected]>
6  SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected]
7  SPDX-FileCopyrightText: 2009 Andras Mantia <[email protected]>
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 <QVector>
17 
18 class QUrl;
19 class QString;
20 class QPoint;
21 
22 namespace MimeTreeParser
23 {
24 class URLHandler;
25 }
26 
27 namespace MessageViewer
28 {
29 namespace Interface
30 {
31 class BodyPartURLHandler;
32 }
33 class ViewerPrivate;
34 class BodyPartURLHandlerManager;
35 /**
36  * @short Singleton to manage the list of URLHandlers
37  * @author Marc Mutz <[email protected]>
38  */
39 class MESSAGEVIEWER_TESTS_EXPORT URLHandlerManager
40 {
41  static URLHandlerManager *self;
42 
43  URLHandlerManager();
44 
45 public:
46  ~URLHandlerManager();
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  Q_REQUIRED_RESULT bool handleClick(const QUrl &url, ViewerPrivate *w = nullptr) const;
57  Q_REQUIRED_RESULT bool handleShiftClick(const QUrl &url, ViewerPrivate *window = nullptr) const;
58  Q_REQUIRED_RESULT bool handleContextMenuRequest(const QUrl &url, const QPoint &p, ViewerPrivate *w = nullptr) const;
59  Q_REQUIRED_RESULT bool willHandleDrag(const QUrl &url, ViewerPrivate *window = nullptr) const;
60  Q_REQUIRED_RESULT bool handleDrag(const QUrl &url, ViewerPrivate *window = nullptr) const;
61  Q_REQUIRED_RESULT QString statusBarMessage(const QUrl &url, ViewerPrivate *w = nullptr) const;
62 
63 private:
65  HandlerList mHandlers;
66  BodyPartURLHandlerManager *mBodyPartURLHandlerManager = nullptr;
67 };
68 }
69 
An interface to body part reader link handlers.
Singleton to manage the list of URLHandlers.
An interface to reader link handlers.
Definition: urlhandler.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Dec 5 2021 23:04:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.