ginebra/chromerenderer.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 15:40:36 +0300
changeset 1 b0dd75e285d2
parent 0 1450b09d0cfd
permissions -rw-r--r--
Revision: 201015 Kit: 201019

/*
* 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".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


#ifndef GINEBRA_RENDERER_H
#define GINEBRA_RENDERER_H

#include "qwebpage.h"
#include <QtGui>

class QWebPage;
class ChromeWidget;

/**
 * \brief Manages the chrome web page. 
 * 
 * The ChromeRenderer class owns and manages the web page that contains a graphical
 * representation of the the components of the browser chrome.  These components are
 * layed-out and rendered by the web page but actually displayed by ChromeWidget and 
 * ChromeSnippet.
 * 
 * \sa ChromeSnippet
 * \sa ChromeWidget
 */
class ChromeRenderer : public QWidget
{
    Q_OBJECT

public:
    ChromeRenderer(QWidget *parent = 0);
    virtual ~ChromeRenderer();

    QWebPage *page() const;
    void setPage(QWebPage *page);
    void setWidget(ChromeWidget *widget) {m_widget = widget;}
    QVariant inputMethodQuery(Qt::InputMethodQuery property) const;

    QSize sizeHint() const;

    virtual bool event(QEvent *);
    
signals:
    void symbianCarriageReturn();  // HACK

protected:
    //void resizeEvent(QResizeEvent *e);
    //void paintEvent(QPaintEvent *ev);

    /*    virtual void changeEvent(QEvent*);

    virtual void mouseMoveEvent(QMouseEvent*);
    virtual void mousePressEvent(QMouseEvent*);
    virtual void mouseDoubleClickEvent(QMouseEvent*);
    virtual void mouseReleaseEvent(QMouseEvent*);*/
    virtual void keyPressEvent(QKeyEvent*);
    virtual void keyReleaseEvent(QKeyEvent*);
    virtual void focusInEvent(QFocusEvent*);
    virtual void focusOutEvent(QFocusEvent*);
    virtual void inputMethodEvent(QInputMethodEvent*);

    virtual bool focusNextPrevChild(bool next);

 private:
    QWebPage * m_page;
    ChromeWidget * m_widget;
};

#endif // GINEBRA_RENDERER_H