]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
Merge branch 'master' into biblatex2
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index 16720b1db7432ad1f0d881bd84a28be8d0a39961..a8b7c5a64d3fadbe20ffdd2427d2386b3034ce0d 100644 (file)
@@ -15,8 +15,6 @@
 
 #include "frontends/WorkArea.h"
 
-#include "support/docstring.h"
-
 #include <QAbstractScrollArea>
 #include <QTabBar>
 #include <QTabWidget>
@@ -69,10 +67,9 @@ public:
        BufferView const & bufferView() const;
        ///
        void redraw(bool update_metrics);
-       ///
-       void stopBlinkingCursor();
-       ///
-       void startBlinkingCursor();
+
+       /// return true if the key is part of a shortcut
+       bool queryKeySym(KeySymbol const & key, KeyModifier mod) const;
        /// Process Key pressed event.
        /// This needs to be public because it is accessed externally by GuiView.
        void processKeySym(KeySymbol const & key, KeyModifier mod);
@@ -89,9 +86,22 @@ public:
        GuiView const & view() const;
        GuiView & view();
 
+       /// Current ratio between physical pixels and device-independent pixels
+       double pixelRatio() const;
+
+public Q_SLOTS:
+       ///
+       void stopBlinkingCursor();
+       ///
+       void startBlinkingCursor();
+
 Q_SIGNALS:
        ///
        void titleChanged(GuiWorkArea *);
+       ///
+       void busy(bool);
+       ///
+       void bufferViewChanged();
 
 private Q_SLOTS:
        /// Scroll the BufferView.
@@ -135,7 +145,8 @@ private:
        void mouseMoveEvent(QMouseEvent * ev);
        /// wheel event
        void wheelEvent(QWheelEvent * ev);
-       /// key press
+       /// key press event. It also knows how to handle ShortcutOverride events to
+       /// avoid code duplication.
        void keyPressEvent(QKeyEvent * ev);
        /// IM events
        void inputMethodEvent(QInputMethodEvent * ev);
@@ -196,6 +207,7 @@ public:
        GuiWorkArea * currentWorkArea();
        GuiWorkArea * workArea(Buffer & buffer);
        GuiWorkArea * workArea(int index);
+       void paintEvent(QPaintEvent *);
 
 Q_SIGNALS:
        ///
@@ -211,6 +223,8 @@ public Q_SLOTS:
        /// close the tab given by \c index
        void closeTab(int index);
        ///
+       void moveTab(int fromIndex, int toIndex);
+       ///
        void updateTabTexts();
        
 private Q_SLOTS:
@@ -218,15 +232,20 @@ private Q_SLOTS:
        void on_currentTabChanged(int index);
        ///
        void showContextMenu(const QPoint & pos);
-       ///
-       void moveTab(int fromIndex, int toIndex);
+       /// enable closing tab on middle-click
+       void mousePressEvent(QMouseEvent * me);
+       void mouseReleaseEvent(QMouseEvent * me);
        ///
        void mouseDoubleClickEvent(QMouseEvent * event);
 
 private:
-       ///
+       /// true if position is a tab (rather than the blank space in tab bar)
+       bool posIsTab(QPoint position);
+
        int clicked_tab_;
        ///
+       int midpressed_tab_;
+       ///
        QToolButton * closeBufferButton;
 }; // TabWorkArea
 
@@ -238,11 +257,6 @@ public:
        ///
        DragTabBar(QWidget * parent = 0);
 
-#if QT_VERSION < 0x040300
-       ///
-       int tabAt(QPoint const & position) const;
-#endif
-
 protected:
        ///
        void mousePressEvent(QMouseEvent * event);
@@ -256,8 +270,6 @@ protected:
 private:
        ///
        QPoint dragStartPos_;
-       ///
-       int dragCurrentIndex_;
 
 Q_SIGNALS:
        ///