]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompleter.h
Whitespace.
[lyx.git] / src / frontends / qt4 / GuiCompleter.h
index f0890a184dfcd446e33315342325118ffadb57bf..f5986359de8ef82673455ec0e753d5645a260b7f 100644 (file)
@@ -15,7 +15,6 @@
 #include "frontends/WorkArea.h"
 
 #include "DocIterator.h"
-#include "FuncRequest.h"
 #include "qt_helpers.h"
 #include "support/docstring.h"
 
@@ -31,6 +30,8 @@ class Buffer;
 namespace frontend {
 
 class GuiWorkArea;
+class CompleterItemDelegate;
+class GuiCompletionModel;
 
 class GuiCompleter : private QCompleter
 {
@@ -50,6 +51,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 +69,8 @@ public:
        QString currentCompletion() const;
        ///
        docstring longestUniqueCompletion() const;
+       ///
+       bool uniqueCompletionAvailable() const;
        
 public Q_SLOTS:
        /// Show the popup.
@@ -73,11 +78,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 +105,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);
@@ -109,6 +131,19 @@ private:
        QString last_selection_;
        /// lock to stop updates of the inline completion
        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 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