]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.h
Make a string translatable
[lyx.git] / src / frontends / qt4 / GuiWorkArea.h
index a039f0e9b5d3eddc054cc9c1fca7b333e8d32c09..b22d2a5662924b1127bfce769c6c695bd9bb0f36 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef WORKAREA_H
 #define WORKAREA_H
 
+#include "ui_WorkAreaUi.h"
+
 #include "frontends/WorkArea.h"
 
 #include <QAbstractScrollArea>
@@ -31,6 +33,7 @@ class QWidget;
 namespace lyx {
 
 class Buffer;
+class FuncRequest;
 
 namespace frontend {
 
@@ -100,6 +103,8 @@ Q_SIGNALS:
        void titleChanged(GuiWorkArea *);
        ///
        void busy(bool);
+       ///
+       void bufferViewChanged();
 
 private Q_SLOTS:
        /// Scroll the BufferView.
@@ -188,6 +193,8 @@ private:
 }; // EmbeddedWorkArea
 
 
+class GuiWorkAreaContainer;
+
 /// A tabbed set of GuiWorkAreas.
 class TabWorkArea : public QTabWidget
 {
@@ -195,6 +202,10 @@ class TabWorkArea : public QTabWidget
 public:
        TabWorkArea(QWidget * parent = 0);
 
+       /// hide QTabWidget methods
+       GuiWorkAreaContainer * currentWidget() const;
+       GuiWorkAreaContainer * widget(int index) const;
+
        ///
        void setFullScreen(bool full_screen);
        void showBar(bool show);
@@ -202,9 +213,9 @@ public:
        bool setCurrentWorkArea(GuiWorkArea *);
        GuiWorkArea * addWorkArea(Buffer & buffer, GuiView & view);
        bool removeWorkArea(GuiWorkArea *);
-       GuiWorkArea * currentWorkArea();
-       GuiWorkArea * workArea(Buffer & buffer);
-       GuiWorkArea * workArea(int index);
+       GuiWorkArea * currentWorkArea() const;
+       GuiWorkArea * workArea(Buffer & buffer) const;
+       GuiWorkArea * workArea(int index) const;
        void paintEvent(QPaintEvent *);
 
 Q_SIGNALS:
@@ -224,7 +235,7 @@ public Q_SLOTS:
        void moveTab(int fromIndex, int toIndex);
        ///
        void updateTabTexts();
-       
+
 private Q_SLOTS:
        ///
        void on_currentTabChanged(int index);
@@ -235,8 +246,13 @@ private Q_SLOTS:
        void mouseReleaseEvent(QMouseEvent * me);
        ///
        void mouseDoubleClickEvent(QMouseEvent * event);
+       ///
+       int indexOfWorkArea(GuiWorkArea * w) const;
 
 private:
+       using QTabWidget::addTab;
+       using QTabWidget::insertTab;
+
        /// true if position is a tab (rather than the blank space in tab bar)
        bool posIsTab(QPoint position);
 
@@ -274,6 +290,31 @@ Q_SIGNALS:
        void tabMoveRequested(int fromIndex, int toIndex);
 };
 
+
+class GuiWorkAreaContainer : public QWidget, public Ui::WorkAreaUi
+{
+       Q_OBJECT
+       // non-null
+       GuiWorkArea * const wa_;
+       void dispatch(FuncRequest f) const;
+
+private Q_SLOTS:
+       void updateDisplay();
+       void reload() const;
+       void ignore() const;
+
+protected:
+       void mouseDoubleClickEvent(QMouseEvent * event); //override
+
+public:
+       /// wa != 0
+       GuiWorkAreaContainer(GuiWorkArea * wa, QWidget * parent = 0);
+       /// non-null
+       GuiWorkArea * workArea() const { return wa_; }
+};
+
+
+
 } // namespace frontend
 } // namespace lyx