1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * Copyright (C) 2007 David Faure <faure@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22#ifndef KHTML_GLOBAL_H
23#define KHTML_GLOBAL_H
24
25#include <khtml_export.h>
26
27#include <kparts/historyprovider.h>
28#include <kurl.h>
29
30class KComponentData;
31class KIconLoader;
32class KAboutData;
33class KHTMLSettings;
34class KHTMLPart;
35
36namespace KParts
37{
38 class HistoryProvider;
39}
40namespace DOM
41{
42 class DocumentImpl;
43}
44
45/**
46 * @internal
47 * Exported for khtml test programs, but not installed
48 */
49class KHTML_EXPORT KHTMLGlobal
50{
51 friend class KHTMLViewPrivate;
52
53public:
54 KHTMLGlobal();
55 ~KHTMLGlobal();
56
57 static void registerPart( KHTMLPart *part );
58 static void deregisterPart( KHTMLPart *part );
59
60 static void registerDocumentImpl( DOM::DocumentImpl *doc );
61 static void deregisterDocumentImpl( DOM::DocumentImpl *doc );
62
63 static const KComponentData &componentData();
64 static KIconLoader *iconLoader();
65
66 static KHTMLSettings *defaultHTMLSettings();
67
68 // list of visited URLs
69 static KParts::HistoryProvider *vLinks() {
70 return KParts::HistoryProvider::self();
71 }
72
73 // Called when khtml part is unloaded
74 static void finalCheck();
75
76private:
77 static void ref();
78 static void deref();
79private:
80 static unsigned long s_refcnt;
81 static KHTMLGlobal *s_self;
82 static KComponentData *s_componentData;
83 static KIconLoader *s_iconLoader;
84 static KAboutData *s_about;
85 static KHTMLSettings *s_settings;
86};
87
88#endif
89
90