diff -r b0dd75e285d2 -r 0f2326c2a325 ginebra2/ChromeRenderer.h --- a/ginebra2/ChromeRenderer.h Fri May 14 15:40:36 2010 +0300 +++ b/ginebra2/ChromeRenderer.h Wed Jun 23 17:59:43 2010 +0300 @@ -1,56 +1,55 @@ /* * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. * -* Initial Contributors: -* Nokia Corporation - initial contribution. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. * -* Contributors: +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". * -* Description: +* Description: * */ - #ifndef __GINEBRA_CHROMERENDERER_H__ #define __GINEBRA_CHROMERENDERER_H__ -#include -#include -class QFocusEvent; +#include +#include +#include + namespace GVA { class WebChromeItem; - class ChromeRenderer : public QGraphicsWebView + class ChromeRenderer : public QObject { Q_OBJECT public: - ChromeRenderer(QWebPage * chromePage, QGraphicsItem * parent = 0); + ChromeRenderer(QWebPage * chromePage, QObject * parent = 0); virtual ~ChromeRenderer(); - //QPixmap * pageBits() {return m_pageBits;} + QWebPage * page() { return m_page; } + void setPage(QWebPage * page) {m_page = page;} + QWebFrame * frame() { if (m_page) return m_page->mainFrame(); return 0;} + void resize(QSizeF newSize); void addRenderItem(WebChromeItem * item) {m_renderList.append(item);} - void clearRenderList() {m_renderList.clear();} + void clearRenderList() {if(!m_renderList.isEmpty()) m_renderList.clear();} + void updateChromeLayout() { emit chromeResized(); } public slots: void repaintRequested(const QRect& dirtyRect); - void onContentsSizeChanged(const QSize & size); - void onInitialLayoutCompleted(); signals: void chromeRepainted(const QRectF& rect = QRectF()); void chromeResized(); -#ifdef Q_OS_SYMBIAN //Ginebra 1 hack for symbian fep key handler - void symbianCarriageReturn(); -#endif - protected: - virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0); - virtual void resizeEvent(QGraphicsSceneResizeEvent * ev); - virtual void keyPressEvent( QKeyEvent * ev ); - void focusInEvent(QFocusEvent* event); private: + QWebPage * m_page; QList m_renderList; };