X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCompleter.h;h=2a17c842e63d927789b1416ecfc2ff4bc90d3824;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=ba0133e1b115ff8f6f7b36633d8febf4a8bfa20d;hpb=ab8a1b0e70df53e85abae79eac3fc39b7d8a8151;p=lyx.git diff --git a/src/frontends/qt4/GuiCompleter.h b/src/frontends/qt4/GuiCompleter.h index ba0133e1b1..2a17c842e6 100644 --- a/src/frontends/qt4/GuiCompleter.h +++ b/src/frontends/qt4/GuiCompleter.h @@ -31,6 +31,8 @@ class Buffer; namespace frontend { class GuiWorkArea; +class CompleterItemDelegate; +class GuiCompletionModel; class GuiCompleter : private QCompleter { @@ -50,6 +52,8 @@ public: bool popupPossible(Cursor const & cur) const; /// bool inlinePossible(Cursor const & cur) const; + /// + bool completionAvailable() const; /// Activate the current completion, i.e. finalize it. void activate(); /// Do a completion as far as it is unique, but at least one character. @@ -66,6 +70,8 @@ public: QString currentCompletion() const; /// docstring longestUniqueCompletion() const; + /// + bool uniqueCompletionAvailable() const; public Q_SLOTS: /// Show the popup. @@ -73,11 +79,24 @@ public Q_SLOTS: /// Show the inline completion. void showInline(); + /// Hide the popup. + void hidePopup(); + /// Hide the inline completion. + void hideInline(); + private Q_SLOTS: /// void popupActivated(const QString & completion); /// void popupHighlighted(const QString & completion); + /// + void updateAvailability(); + /// the asynchronous part of updatePopup(cur) + void asyncUpdatePopup(); + /// the asynchronous part of hidePopup(cur) + void asyncHidePopup(); + /// the asynchronous part of hideInline(cur) + void asyncHideInline(); private: /// @@ -87,6 +106,10 @@ private: /// void showInline(Cursor & cur); /// + void hidePopup(Cursor & cur); + /// + void hideInline(Cursor & cur); + /// void updatePopup(Cursor & cur); /// void updateInline(Cursor & cur, QString const & completion); @@ -111,8 +134,17 @@ private: int updateLock_; /// the BufferView::inlineCursorPos might be reset by destructive /// operations like backspace. Hence, we have to keep this flag - /// in addition to know whether the popup is to be kept visible. + /// in addition to know whether the completion is to be kept visible. bool inlineVisible_; + /// + bool popupVisible_; + /// the model reset is asynchronous in hidePopup/Inline. So let's mark + /// a coming reset here by setting it to false. + bool modelActive_; + /// + CompleterItemDelegate * itemDelegate_; + /// + GuiCompletionModel * model_; }; // GuiCompleter } // namespace frontend