]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiViewSource.h
Consider class-provided citation engines
[lyx.git] / src / frontends / qt4 / GuiViewSource.h
index e4718d71b2ece5536360df6d4e1744093362bf84..48f2903b74dce98bddabcbf04b56799eeb8c1c43 100644 (file)
@@ -43,57 +43,49 @@ class ViewSourceWidget : public QWidget, public Ui::ViewSourceUi
        Q_OBJECT
 
 public:
-       ViewSourceWidget();
-       ///
-       void setBufferView(BufferView const * bv);
+       ViewSourceWidget(QWidget * parent);
        /// returns true if the string has changed
        bool setText(QString const & qstr = QString());
        ///
-       void saveSession(QString const & session_key) const;
+       void saveSession(QSettings & settings, QString const & session_key) const;
        ///
        void restoreSession(QString const & session_key);
+       ///
+       int updateDelay() const;
 
 protected:
        ///
        void resizeEvent (QResizeEvent * event);
 
 public Q_SLOTS:
-       /// schedule an update after delay
-       void updateView();
-       /// schedule an update now
-       void updateViewNow();
+       ///
+       void updateView(BufferView const * bv);
        ///
        void setViewFormat(int const index);
        //
-       void updateDefaultFormat();
+       void updateDefaultFormat(BufferView const & bv);
        ///
        void contentsChanged();
        ///
-       void gotoCursor();
+       void goToCursor() const;
        /// Name of the current format. Empty if none.
-       docstring currentFormatName() const;
+       docstring currentFormatName(BufferView const * bv) const;
 
 Q_SIGNALS:
-       void formatChanged() const;
-
-private Q_SLOTS:
-       /// update content
-       void realUpdateView();
+       void needUpdate() const;
 
 private:
        /// Get the source code of selected paragraphs, or the whole document.
-       void getContent(BufferView const * view, Buffer::OutputWhat output,
+       void getContent(BufferView const & view, Buffer::OutputWhat output,
                           docstring & str, std::string const & format, bool master);
-       ///
-       BufferView const * bv_;
+       /// Grab double clicks on the viewport
+       bool eventFilter(QObject * obj, QEvent * event);
        ///
        QTextDocument * document_;
        /// LaTeX syntax highlighter
        LaTeXHighlighter * highlighter_;
        ///
        std::string view_format_;
-       ///
-       QTimer * update_timer_;
        /// TexRow information from the last source view. If TexRow is unavailable
        /// for the last format then texrow_ is null.
        unique_ptr<TexRow> texrow_;
@@ -110,8 +102,6 @@ public:
                Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
                Qt::WindowFlags flags = 0);
 
-       ~GuiViewSource();
-
        /// Controller inherited method.
        ///@{
        bool initialiseParams(std::string const & source);
@@ -122,18 +112,31 @@ public:
        bool canApplyToReadOnly() const { return true; }
        void updateView();
        void enableView(bool enable);
-       void saveSession() const;
+       void saveSession(QSettings & settings) const;
        void restoreSession();
        bool wantInitialFocus() const { return false; }
        ///@}
 
+public Q_SLOTS:
+       ///
+       void onBufferViewChanged();//override
+
 private Q_SLOTS:
        /// The title displayed by the dialog reflects source type.
        void updateTitle();
+       /// schedule an update after delay
+       void scheduleUpdate();
+       /// schedule an update now
+       void scheduleUpdateNow();
+
+       /// update content
+       void realUpdateView();
 
 private:
        /// The encapsulated widget.
        ViewSourceWidget * widget_;
+       ///
+       QTimer * update_timer_;
 };
 
 } // namespace frontend