~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/html/HTMLPlugInElement.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
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
 
 
23
#ifndef HTMLPlugInElement_h
 
24
#define HTMLPlugInElement_h
 
25
 
 
26
#include "HTMLFrameOwnerElement.h"
 
27
#include "Image.h"
 
28
#include "ImageLoaderClient.h"
 
29
#include "ScriptInstance.h"
 
30
 
 
31
#if ENABLE(NETSCAPE_PLUGIN_API)
 
32
struct NPObject;
 
33
#endif
 
34
 
 
35
namespace WebCore {
 
36
 
 
37
class RenderEmbeddedObject;
 
38
class RenderWidget;
 
39
class Widget;
 
40
 
 
41
class HTMLPlugInElement : public HTMLFrameOwnerElement {
 
42
public:
 
43
    virtual ~HTMLPlugInElement();
 
44
 
 
45
    void resetInstance();
 
46
 
 
47
    PassScriptInstance getInstance();
 
48
 
 
49
    Widget* pluginWidget() const;
 
50
 
 
51
    enum DisplayState {
 
52
        WaitingForSnapshot,
 
53
        DisplayingSnapshot,
 
54
        PlayingWithPendingMouseClick,
 
55
        Playing
 
56
    };
 
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() { }
 
61
 
 
62
#if ENABLE(NETSCAPE_PLUGIN_API)
 
63
    NPObject* getNPObject();
 
64
#endif
 
65
 
 
66
    bool isCapturingMouseEvents() const { return m_isCapturingMouseEvents; }
 
67
    void setIsCapturingMouseEvents(bool capturing) { m_isCapturingMouseEvents = capturing; }
 
68
 
 
69
    bool canContainRangeEndPoint() const { return false; }
 
70
 
 
71
    bool canProcessDrag() const;
 
72
 
 
73
    virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
74
 
 
75
protected:
 
76
    HTMLPlugInElement(const QualifiedName& tagName, Document*);
 
77
 
 
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; }
 
82
 
 
83
    bool m_inBeforeLoadEventHandler;
 
84
    // Subclasses should use guardedDispatchBeforeLoadEvent instead of calling dispatchBeforeLoadEvent directly.
 
85
    bool guardedDispatchBeforeLoadEvent(const String& sourceURL);
 
86
 
 
87
private:
 
88
    bool dispatchBeforeLoadEvent(const String& sourceURL); // Not implemented, generates a compile error if subclasses call this by mistake.
 
89
 
 
90
    virtual void defaultEventHandler(Event*);
 
91
 
 
92
    virtual RenderWidget* renderWidgetForJSBindings() const = 0;
 
93
 
 
94
    virtual bool isKeyboardFocusable(KeyboardEvent*) const;
 
95
    virtual bool isPluginElement() const;
 
96
 
 
97
private:
 
98
    mutable ScriptInstance m_instance;
 
99
#if ENABLE(NETSCAPE_PLUGIN_API)
 
100
    NPObject* m_NPObject;
 
101
#endif
 
102
    bool m_isCapturingMouseEvents;
 
103
 
 
104
    DisplayState m_displayState;
 
105
};
 
106
 
 
107
} // namespace WebCore
 
108
 
 
109
#endif // HTMLPlugInElement_h