]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.h
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiViewSource.h
index 340d1d63b0d9508c09d3c4cc1890b1fca7f43cc0..c60026945add83391ad0d2536031b4d18174ed1a 100644 (file)
 #include "ui_ViewSourceUi.h"
 
 #include "DockView.h"
-#include "GuiView.h"
-#include "qt_helpers.h"
-
-#include "support/debug.h"
 
 #include <QDockWidget>
 #include <QString>
-#include <QTextCharFormat>
 
 class QTextDocument;
 
@@ -39,21 +34,35 @@ class ViewSourceWidget : public QWidget, public Ui::ViewSourceUi
        Q_OBJECT
 
 public:
-       ViewSourceWidget(GuiViewSource &);
+       ViewSourceWidget();
+       ///
+       void setBufferView(BufferView const * bv);
+
+protected:
+       ///
+       void resizeEvent (QResizeEvent * event);
 
 public Q_SLOTS:
-       // update content
+       /// update content
        void updateView();
        ///
-       void update(bool full_source);
+       void setViewFormat();
+       ///
+       void updateDefaultFormat();
+       ///
+       void contentsChanged();
 
 private:
        ///
-       GuiViewSource & controller_;    
+       BufferView const * bv_;
        ///
        QTextDocument * document_;
        /// LaTeX syntax highlighter
        LaTeXHighlighter * highlighter_;
+       ///
+       bool force_getcontent_;
+       ///
+       QString view_format_;
 };
 
 
@@ -78,19 +87,15 @@ public:
        bool canApply() const { return true; }
        bool canApplyToReadOnly() const { return true; }
        void updateView();
+       void enableView(bool enable);
+       void saveSession() const;
+       void restoreSession();
+       bool wantInitialFocus() const { return false; }
        ///@}
 
        /// The title displayed by the dialog reflects source type.
        QString title() const;
 
-       /** get the source code of selected paragraphs, or the whole document
-               \param fullSource get full source code
-        */
-       QString getContent(bool fullSource);
-       /** get the cursor position in the source code
-        */
-       std::pair<int, int> getRows() const;
-
 private:
        /// The encapsulated widget.
        ViewSourceWidget * widget_;