fix selection in redirected sub-frames.
[kdelibs.git] / khtml / khtmladaptorpart.h
blob2e0628e14a9cc025024169473fb45e8ab274bcca
1 /*
2 * This file is part of the KDE libraries
3 * Copyright (C) 2007 Harri Porten (porten@kde.org)
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef KHTMLADAPTORPART_H
21 #define KHTMLADAPTORPART_H
23 #include <khtml_export.h>
24 #include <kparts/part.h>
25 #include <kparts/browserextension.h>
26 #include <kparts/factory.h>
28 namespace KJS
30 class ExecState;
31 class JSObject;
34 class ScriptingInterface
36 public:
37 virtual ~ScriptingInterface() { }
39 virtual void initScripting(KJS::ExecState *exec) = 0;
40 virtual void stopScripting() = 0;
42 virtual KJS::JSObject* scriptObject() = 0;
45 Q_DECLARE_INTERFACE(ScriptingInterface, "org.kde.khtml.ScriptingInterface")
47 class KHTMLAdaptorPartFactory : public KParts::Factory {
48 Q_OBJECT
49 public:
50 KHTMLAdaptorPartFactory ();
51 virtual KParts::Part *createPartObject(QWidget *wparent,
52 QObject *parent,
53 const char *className,
54 const QStringList &args);
57 class AdaptorView : public KParts::ReadOnlyPart,
58 public ScriptingInterface {
59 Q_OBJECT
60 Q_INTERFACES(ScriptingInterface)
61 public:
62 AdaptorView(QWidget* wparent, QObject* parent, const QStringList& args);
64 void initScripting(KJS::ExecState *exec);
65 void stopScripting() { }
66 KJS::JSObject* scriptObject();
68 protected:
69 bool openFile();
72 #endif