2
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3
* (C) 1999 Antti Koivisto (koivisto@kde.org)
4
* Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
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.
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.
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.
23
#ifndef HTMLPlugInElement_h
24
#define HTMLPlugInElement_h
26
#include "HTMLFrameOwnerElement.h"
28
#include "ImageLoaderClient.h"
29
#include "ScriptInstance.h"
31
#if ENABLE(NETSCAPE_PLUGIN_API)
37
class RenderEmbeddedObject;
41
class HTMLPlugInElement : public HTMLFrameOwnerElement {
43
virtual ~HTMLPlugInElement();
47
PassScriptInstance getInstance();
49
Widget* pluginWidget() const;
54
PlayingWithPendingMouseClick,
57
DisplayState displayState() const { return m_displayState; }
58
void setDisplayState(DisplayState state) { m_displayState = state; }
59
virtual void updateSnapshot(PassRefPtr<Image>) { }
60
virtual void dispatchPendingMouseClick() { }
62
#if ENABLE(NETSCAPE_PLUGIN_API)
63
NPObject* getNPObject();
66
bool isCapturingMouseEvents() const { return m_isCapturingMouseEvents; }
67
void setIsCapturingMouseEvents(bool capturing) { m_isCapturingMouseEvents = capturing; }
69
bool canContainRangeEndPoint() const { return false; }
71
bool canProcessDrag() const;
73
virtual bool willRespondToMouseClickEvents() OVERRIDE;
76
HTMLPlugInElement(const QualifiedName& tagName, Document*);
78
virtual void detach();
79
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
80
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
81
virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
83
bool m_inBeforeLoadEventHandler;
84
// Subclasses should use guardedDispatchBeforeLoadEvent instead of calling dispatchBeforeLoadEvent directly.
85
bool guardedDispatchBeforeLoadEvent(const String& sourceURL);
88
bool dispatchBeforeLoadEvent(const String& sourceURL); // Not implemented, generates a compile error if subclasses call this by mistake.
90
virtual void defaultEventHandler(Event*);
92
virtual RenderWidget* renderWidgetForJSBindings() const = 0;
94
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
95
virtual bool isPluginElement() const;
98
mutable ScriptInstance m_instance;
99
#if ENABLE(NETSCAPE_PLUGIN_API)
100
NPObject* m_NPObject;
102
bool m_isCapturingMouseEvents;
104
DisplayState m_displayState;
107
} // namespace WebCore
109
#endif // HTMLPlugInElement_h