widget/qt/mozqwidget.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* vim: set ts=4 et sw=4 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef MOZQWIDGET_H
michael@0 8 #define MOZQWIDGET_H
michael@0 9
michael@0 10 #include "nsIWidget.h"
michael@0 11
michael@0 12 #include <QtGui/QWindow>
michael@0 13
michael@0 14 QT_BEGIN_NAMESPACE
michael@0 15 class QPainter;
michael@0 16 class QExposeEvent;
michael@0 17 class QResizeEvent;
michael@0 18 QT_END_NAMESPACE
michael@0 19
michael@0 20 namespace mozilla {
michael@0 21 namespace widget {
michael@0 22
michael@0 23 class nsWindow;
michael@0 24
michael@0 25 class MozQWidget : public QWindow
michael@0 26 {
michael@0 27 Q_OBJECT
michael@0 28 public:
michael@0 29 explicit MozQWidget(nsWindow* aReceiver, QWindow* aParent = 0);
michael@0 30 ~MozQWidget();
michael@0 31
michael@0 32 virtual void render(QPainter* painter);
michael@0 33
michael@0 34 virtual nsWindow* getReceiver() { return mReceiver; };
michael@0 35 virtual void dropReceiver() { mReceiver = nullptr; };
michael@0 36 virtual void SetCursor(nsCursor aCursor);
michael@0 37
michael@0 38 public Q_SLOTS:
michael@0 39 void renderLater();
michael@0 40 void renderNow();
michael@0 41
michael@0 42 protected:
michael@0 43 virtual bool event(QEvent* event);
michael@0 44 virtual void exposeEvent(QExposeEvent* event);
michael@0 45 virtual void focusInEvent(QFocusEvent* event);
michael@0 46 virtual void focusOutEvent(QFocusEvent* event);
michael@0 47 virtual void hideEvent(QHideEvent* event);
michael@0 48 virtual void keyPressEvent(QKeyEvent* event);
michael@0 49 virtual void keyReleaseEvent(QKeyEvent* event);
michael@0 50 virtual void mouseDoubleClickEvent(QMouseEvent* event);
michael@0 51 virtual void mouseMoveEvent(QMouseEvent* event);
michael@0 52 virtual void mousePressEvent(QMouseEvent* event);
michael@0 53 virtual void mouseReleaseEvent(QMouseEvent* event);
michael@0 54 virtual void moveEvent(QMoveEvent* event);
michael@0 55 virtual void resizeEvent(QResizeEvent* event);
michael@0 56 virtual void showEvent(QShowEvent* event);
michael@0 57 virtual void tabletEvent(QTabletEvent* event);
michael@0 58 virtual void touchEvent(QTouchEvent* event);
michael@0 59 virtual void wheelEvent(QWheelEvent* event);
michael@0 60
michael@0 61 private:
michael@0 62 nsWindow* mReceiver;
michael@0 63 bool mUpdatePending;
michael@0 64 nsWindowType mWindowType;
michael@0 65 };
michael@0 66
michael@0 67 } // namespace widget
michael@0 68 } // namespace mozilla
michael@0 69
michael@0 70 #endif // MOZQWIDGET_H
michael@0 71

mercurial