Better wording
[kdepim.git] / messageviewer / urlhandlermanager.h
blobaa9b5d4cdf4617c1a346d30d0b98817d0a9f7ad6
1 /* -*- c++ -*-
2 urlhandlermanager.h
4 This file is part of KMail, the KDE mail client.
5 Copyright (c) 2003 Marc Mutz <mutz@kde.org>
6 Copyright (C) 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
7 Copyright (c) 2009 Andras Mantia <andras@kdab.net>
9 KMail is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License, version 2, as
11 published by the Free Software Foundation.
13 KMail is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 In addition, as a special exception, the copyright holders give
23 permission to link the code of this program with any edition of
24 the Qt library by Trolltech AS, Norway (or with modified versions
25 of Qt that use the same license as Qt), and distribute linked
26 combinations including the two. You must obey the GNU General
27 Public License in all respects for all of the code used other than
28 Qt. If you modify this file, you may extend this exception to
29 your version of the file, but you are not obligated to do so. If
30 you do not wish to do so, delete this exception statement from
31 your version.
34 #ifndef __MESSAGEVIEWER_URLHANDLERMANAGER_H__
35 #define __MESSAGEVIEWER_URLHANDLERMANAGER_H__
37 #include <QVector>
39 class KUrl;
41 class QString;
42 class QPoint;
44 namespace MessageViewer {
45 namespace Interface {
46 class BodyPartURLHandler;
49 class ViewerPrivate;
50 class URLHandler;
53 namespace MessageViewer {
55 /**
56 * @short Singleton to manage the list of URLHandlers
57 * @author Marc Mutz <mutz@kde.org>
59 class URLHandlerManager {
60 static URLHandlerManager * self;
62 URLHandlerManager();
63 public:
64 ~URLHandlerManager();
66 static URLHandlerManager * instance() {
67 if ( !self )
68 self = new URLHandlerManager();
69 return self;
72 void registerHandler( const URLHandler * handler );
73 void unregisterHandler( const URLHandler * handler );
75 void registerHandler( const Interface::BodyPartURLHandler * handler );
76 void unregisterHandler( const Interface::BodyPartURLHandler * handler );
78 bool handleClick( const KUrl & url, ViewerPrivate * w = 0 ) const;
79 bool handleShiftClick( const KUrl &url, ViewerPrivate *window = 0 ) const;
80 bool handleContextMenuRequest( const KUrl & url, const QPoint & p, ViewerPrivate * w = 0 ) const;
81 bool willHandleDrag( const KUrl &url, ViewerPrivate *window = 0 ) const;
82 bool handleDrag( const KUrl &url, ViewerPrivate *window = 0 ) const;
83 QString statusBarMessage( const KUrl & url, ViewerPrivate * w = 0 ) const;
85 private:
86 typedef QVector<const URLHandler*> HandlerList;
87 HandlerList mHandlers;
88 class BodyPartURLHandlerManager;
89 BodyPartURLHandlerManager * mBodyPartURLHandlerManager;
93 #endif // __MESSAGEVIEWER_URLHANDLERMANAGER_H__