]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.h
Amend f441590c
[lyx.git] / src / frontends / qt4 / GuiViewSource.h
index 1722ac94fcea5bcf3b8346872a221221b0ea4095..e089305be58fabb1985616ff6485b293ecd398f1 100644 (file)
 
 #include "ui_ViewSourceUi.h"
 
+#include "Buffer.h"
 #include "DockView.h"
-#include "GuiView.h"
-#include "qt_helpers.h"
+#include "TexRow.h"
 
 #include <QDockWidget>
 #include <QString>
+#include <QTimer>
 
 class QTextDocument;
 
@@ -39,20 +40,39 @@ public:
        ViewSourceWidget();
        ///
        void setBufferView(BufferView const * bv);
+       /// returns true if the string has changed
+       bool setText(QString const & qstr = QString());
+       ///
+       void saveSession(QString const & session_key) const;
+       ///
+       void restoreSession(QString const & session_key);
+
+protected:
+       ///
+       void resizeEvent (QResizeEvent * event);
 
 public Q_SLOTS:
-       /// update content
+       /// schedule an update after delay
        void updateView();
+       /// schedule an update now
+       void updateViewNow();
        ///
-       void setViewFormat();
-       ///
+       void setViewFormat(int const index);
+       //
        void updateDefaultFormat();
        ///
        void contentsChanged();
        ///
-       void dockLocationChanged(Qt::DockWidgetArea area);
+       void gotoCursor();
+
+private Q_SLOTS:
+       /// update content
+       void realUpdateView();
 
 private:
+       /// Get the source code of selected paragraphs, or the whole document.
+       void getContent(BufferView const * view, Buffer::OutputWhat output,
+                          docstring & str, std::string const & format, bool master);
        ///
        BufferView const * bv_;
        ///
@@ -60,9 +80,12 @@ private:
        /// LaTeX syntax highlighter
        LaTeXHighlighter * highlighter_;
        ///
-       bool force_getcontent_;
-       ///
        QString view_format_;
+       ///
+       QTimer * update_timer_;
+       /// TexRow information from the last source view. If TexRow is unavailable
+       /// for the last format then texrow_ is null.
+       std::auto_ptr<TexRow> texrow_;
 };