]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index 4742757907bf057dafc894958aa049ce2b72fabc..39d2054217b658682c741f3a96951805ecb489b3 100644 (file)
@@ -16,6 +16,7 @@
 #include "ui_WorkAreaUi.h"
 
 #include "frontends/WorkArea.h"
+#include "frontends/KeySymbol.h"
 
 #include <QAbstractScrollArea>
 #include <QTabBar>
@@ -59,19 +60,14 @@ public:
        /// is GuiView in fullscreen mode?
        bool isFullScreen() const;
        ///
-       void scheduleRedraw();
-       ///
        BufferView & bufferView();
        ///
        BufferView const & bufferView() const;
        ///
-       void redraw(bool update_metrics);
+       void scheduleRedraw(bool update_metrics);
 
        /// 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);
 
        bool inDialogMode() const;
        void setDialogMode(bool mode);
@@ -87,6 +83,9 @@ public:
        double pixelRatio() const;
 
 public Q_SLOTS:
+       /// Process Key pressed event.
+       /// This needs to be public because it is accessed externally by GuiView.
+       void processKeySym(KeySymbol const & key, KeyModifier mod);
        ///
        void stopBlinkingCaret();
        ///
@@ -99,6 +98,8 @@ Q_SIGNALS:
        void busy(bool);
        ///
        void bufferViewChanged();
+       /// send key event to CompressorProxy
+       void compressKeySym(KeySymbol sym, KeyModifier mod, bool isAutoRepeat);
 
 private Q_SLOTS:
        /// Scroll the BufferView.
@@ -109,7 +110,7 @@ private Q_SLOTS:
        void scrollTo(int value);
        /// timer to limit triple clicks
        void doubleClickTimeout();
-       /// toggle the cursor's visibility
+       /// toggle the caret's visibility
        void toggleCaret();
        /// close this work area.
        /// Slot for Buffer::closing signal.
@@ -159,6 +160,23 @@ private:
 }; // GuiWorkArea
 
 
+/// CompressorProxy adapted from Kuba Ober https://stackoverflow.com/a/21006207
+class CompressorProxy : public QObject
+{
+    Q_OBJECT
+       bool emitCheck(bool isAutoRepeat);
+       bool flag_;
+       // input: event to compress
+       Q_SLOT void slot(KeySymbol sym, KeyModifier mod, bool isAutoRepeat);
+       // output: compressed event
+    Q_SIGNAL void signal(KeySymbol sym, KeyModifier mod);
+public:
+    // No default constructor, since the proxy must be a child of the
+    // target object.
+       explicit CompressorProxy(GuiWorkArea * wa);
+};
+
+
 class EmbeddedWorkArea : public GuiWorkArea
 {
        Q_OBJECT