2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
15 * its contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef InspectorClientQt_h
31 #define InspectorClientQt_h
33 #include "InspectorClient.h"
34 #include "InspectorFrontendClientLocal.h"
36 #include "PassOwnPtr.h"
37 #include <QtCore/QString>
38 #include <wtf/Forward.h>
44 class InspectorFrontendClientQt;
45 class InspectorServerRequestHandlerQt;
48 class RemoteFrontendChannel;
50 class InspectorClientQt : public InspectorClient {
52 InspectorClientQt(QWebPage*);
54 virtual void inspectorDestroyed();
56 virtual void openInspectorFrontend(WebCore::InspectorController*);
58 virtual void highlight(Node*);
59 virtual void hideHighlight();
61 virtual bool sendMessageToFrontend(const String&);
63 void releaseFrontendPage();
65 void attachAndReplaceRemoteFrontend(RemoteFrontendChannel *channel);
66 void detachRemoteFrontend();
69 QWebPage* m_inspectedWebPage;
70 QWebPage* m_frontendWebPage;
71 InspectorFrontendClientQt* m_frontendClient;
72 bool m_remoteInspector;
74 friend class InspectorServerRequestHandlerQt;
77 class InspectorFrontendClientQt : public InspectorFrontendClientLocal {
79 InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient);
80 virtual ~InspectorFrontendClientQt();
82 virtual void frontendLoaded();
84 virtual String localizedStringsURL();
86 virtual String hiddenPanels();
88 virtual void bringToFront();
89 virtual void closeWindow();
90 virtual void disconnectFromBackend();
92 virtual void attachWindow();
93 virtual void detachWindow();
95 virtual void setAttachedWindowHeight(unsigned height);
97 virtual void inspectedURLChanged(const String& newURL);
99 void inspectorClientDestroyed();
102 void updateWindowTitle();
103 void destroyInspectorView(bool notifyInspectorController);
104 QWebPage* m_inspectedWebPage;
105 OwnPtr<QWebView> m_inspectorView;
106 QString m_inspectedURL;
107 bool m_destroyingInspectorView;
108 InspectorClientQt* m_inspectorClient;