18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
28e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Copyright (C) 2008 Apple Inc.  All rights reserved.
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    documentation and/or other materials provided with the distribution.
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef HostWindow_h
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define HostWindow_h
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include <wtf/Noncopyable.h>
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#include "Widget.h"
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace WebCore {
338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
340bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochclass HostWindow : public Noncopyable {
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectpublic:
365f1ab04193ad0130ca8204aadaceae083aca9881Feng Qian    virtual ~HostWindow() { }
378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    // The repaint method asks the host window to repaint a rect in the window's coordinate space.  The
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    // contentChanged boolean indicates whether or not the Web page content actually changed (or if a repaint
408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    // of unchanged content is being requested).
418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    // The paint method just causes a synchronous update of the window to happen for platforms that need it (Windows).
458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    void paint() { repaint(IntRect(), false, true); }
468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    // Methods for doing coordinate conversions to and from screen coordinates.
488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    virtual IntPoint screenToWindow(const IntPoint&) const = 0;
498e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    virtual IntRect windowToScreen(const IntRect&) const = 0;
50635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project
51231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    // Method for retrieving the native client of the page.
52231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    virtual PlatformPageClient platformPageClient() const = 0;
53635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project
54635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project    // For scrolling a rect into view recursively.  Useful in the cases where a WebView is embedded inside some containing
55635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project    // platform-specific ScrollView.
56635860845790a19bf50bbc51ba8fb66a96dde068The Android Open Source Project    virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const = 0;
57231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
58231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    // To notify WebKit of scrollbar mode changes.
59231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    virtual void scrollbarsModeDidChange() const = 0;
608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project};
618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
628e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project} // namespace WebCore
638e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
648e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif // HostWindow_h
65