#include "config.h"
#include "PageClientQt.h"
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
namespace WebCore {
void PageClientQWidget::scroll(int dx, int dy, const QRect& rectToScroll)
{
view->scroll(qreal(dx), qreal(dy), rectToScroll);
}
void PageClientQWidget::update(const QRect & dirtyRect)
{
view->update(dirtyRect);
}
void PageClientQWidget::setInputMethodEnabled(bool enable)
{
view->setAttribute(Qt::WA_InputMethodEnabled, enable);
}
bool PageClientQWidget::inputMethodEnabled() const
{
return view->testAttribute(Qt::WA_InputMethodEnabled);
}
#if QT_VERSION >= 0x040600
void PageClientQWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable)
{
if (enable)
view->setInputMethodHints(view->inputMethodHints() | hint);
else
view->setInputMethodHints(view->inputMethodHints() & ~hint);
}
#endif
#ifndef QT_NO_CURSOR
QCursor PageClientQWidget::cursor() const
{
return view->cursor();
}
void PageClientQWidget::updateCursor(const QCursor& cursor)
{
view->setCursor(cursor);
}
#endif
QPalette PageClientQWidget::palette() const
{
return view->palette();
}
int PageClientQWidget::screenNumber() const
{
#if defined(Q_WS_X11)
return view->x11Info().screen();
#endif
return 0;
}
QWidget* PageClientQWidget::ownerWidget() const
{
return view;
}
QRect PageClientQWidget::geometryRelativeToOwnerWidget() const
{
return view->geometry();
}
QObject* PageClientQWidget::pluginParent() const
{
return view;
}
QStyle* PageClientQWidget::style() const
{
return view->style();
}
}