+
+ ///
+ GuiCompleter * completer_;
+
+ /// Special mode in which Esc and Enter (with or without Shift)
+ /// are ignored
+ bool dialog_mode_;
+ /// store the position of the rightclick when the mouse is
+ /// pressed. This is used to get the correct context menu
+ /// when the menu is actually shown (after releasing on Windwos).
+ QPoint context_target_pos_;
+}; // GuiWorkArea
+
+
+class EmbeddedWorkArea : public GuiWorkArea
+{
+ Q_OBJECT
+public:
+ ///
+ EmbeddedWorkArea(QWidget *);
+ ~EmbeddedWorkArea();
+
+ /// Dummy methods for Designer.
+ void setWidgetResizable(bool) {}
+ void setWidget(QWidget *) {}
+
+ QSize sizeHint () const;
+ ///
+ void disable();
+
+protected:
+ ///
+ void closeEvent(QCloseEvent * ev);
+ ///
+ void hideEvent(QHideEvent *ev);
+
+private:
+ /// Embedded Buffer.
+ Buffer * buffer_;
+}; // EmbeddedWorkArea
+
+
+/// A tabbed set of GuiWorkAreas.
+class TabWorkArea : public QTabWidget
+{
+ Q_OBJECT
+public:
+ TabWorkArea(QWidget * parent = 0);
+
+ ///
+ void setFullScreen(bool full_screen);
+ void showBar(bool show);
+ void closeAll();
+ bool setCurrentWorkArea(GuiWorkArea *);
+ GuiWorkArea * addWorkArea(Buffer & buffer, GuiView & view);
+ bool removeWorkArea(GuiWorkArea *);
+ GuiWorkArea * currentWorkArea();
+ GuiWorkArea * workArea(Buffer & buffer);
+
+Q_SIGNALS:
+ ///
+ void currentWorkAreaChanged(GuiWorkArea *);
+ ///
+ void lastWorkAreaRemoved();
+
+public Q_SLOTS:
+ /// close current buffer, or the one given by \c clicked_tab_
+ void closeCurrentBuffer();
+ /// hide current tab, or the one given by \c clicked_tab_
+ void hideCurrentTab();
+ /// close the tab given by \c index
+ void closeTab(int index);
+ ///
+ void updateTabTexts();
+
+private Q_SLOTS:
+ ///
+ void on_currentTabChanged(int index);
+ ///
+ void showContextMenu(const QPoint & pos);
+ ///
+ void moveTab(int fromIndex, int toIndex);
+ ///
+ void mouseDoubleClickEvent(QMouseEvent * event);
+
+private:
+ ///
+ int clicked_tab_;
+ ///
+ QToolButton * closeBufferButton;
+}; // TabWorkArea
+
+
+class DragTabBar : public QTabBar
+{
+ Q_OBJECT
+public:
+ ///
+ DragTabBar(QWidget * parent = 0);
+
+#if QT_VERSION < 0x040300
+ ///
+ int tabAt(QPoint const & position) const;
+#endif
+
+protected:
+ ///
+ void mousePressEvent(QMouseEvent * event);
+ ///
+ void mouseMoveEvent(QMouseEvent * event);
+ ///
+ void dragEnterEvent(QDragEnterEvent * event);
+ ///
+ void dropEvent(QDropEvent * event);
+
+private:
+ ///
+ QPoint dragStartPos_;
+ ///
+ int dragCurrentIndex_;
+
+Q_SIGNALS:
+ ///
+ void tabMoveRequested(int fromIndex, int toIndex);