widget/qt/mozqwidget.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/qt/mozqwidget.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* vim: set ts=4 et sw=4 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef MOZQWIDGET_H
    1.11 +#define MOZQWIDGET_H
    1.12 +
    1.13 +#include "nsIWidget.h"
    1.14 +
    1.15 +#include <QtGui/QWindow>
    1.16 +
    1.17 +QT_BEGIN_NAMESPACE
    1.18 +class QPainter;
    1.19 +class QExposeEvent;
    1.20 +class QResizeEvent;
    1.21 +QT_END_NAMESPACE
    1.22 +
    1.23 +namespace mozilla {
    1.24 +namespace widget {
    1.25 +
    1.26 +class nsWindow;
    1.27 +
    1.28 +class MozQWidget : public QWindow
    1.29 +{
    1.30 +    Q_OBJECT
    1.31 +public:
    1.32 +    explicit MozQWidget(nsWindow* aReceiver, QWindow* aParent = 0);
    1.33 +    ~MozQWidget();
    1.34 +
    1.35 +    virtual void render(QPainter* painter);
    1.36 +
    1.37 +    virtual nsWindow* getReceiver() { return mReceiver; };
    1.38 +    virtual void dropReceiver() { mReceiver = nullptr; };
    1.39 +    virtual void SetCursor(nsCursor aCursor);
    1.40 +
    1.41 +public Q_SLOTS:
    1.42 +    void renderLater();
    1.43 +    void renderNow();
    1.44 +
    1.45 +protected:
    1.46 +    virtual bool event(QEvent* event);
    1.47 +    virtual void exposeEvent(QExposeEvent* event);
    1.48 +    virtual void focusInEvent(QFocusEvent* event);
    1.49 +    virtual void focusOutEvent(QFocusEvent* event);
    1.50 +    virtual void hideEvent(QHideEvent* event);
    1.51 +    virtual void keyPressEvent(QKeyEvent* event);
    1.52 +    virtual void keyReleaseEvent(QKeyEvent* event);
    1.53 +    virtual void mouseDoubleClickEvent(QMouseEvent* event);
    1.54 +    virtual void mouseMoveEvent(QMouseEvent* event);
    1.55 +    virtual void mousePressEvent(QMouseEvent* event);
    1.56 +    virtual void mouseReleaseEvent(QMouseEvent* event);
    1.57 +    virtual void moveEvent(QMoveEvent* event);
    1.58 +    virtual void resizeEvent(QResizeEvent* event);
    1.59 +    virtual void showEvent(QShowEvent* event);
    1.60 +    virtual void tabletEvent(QTabletEvent* event);
    1.61 +    virtual void touchEvent(QTouchEvent* event);
    1.62 +    virtual void wheelEvent(QWheelEvent* event);
    1.63 +
    1.64 +private:
    1.65 +    nsWindow* mReceiver;
    1.66 +    bool mUpdatePending;
    1.67 +    nsWindowType mWindowType;
    1.68 +};
    1.69 +
    1.70 +} // namespace widget
    1.71 +} // namespace mozilla
    1.72 +
    1.73 +#endif // MOZQWIDGET_H
    1.74 +

mercurial