#include "frontends/WorkArea.h"
#include "DocIterator.h"
-#include "FuncRequest.h"
#include "qt_helpers.h"
#include "support/docstring.h"
namespace frontend {
class GuiWorkArea;
-class RtlItemDelegate;
+class CompleterItemDelegate;
+class GuiCompletionModel;
class GuiCompleter : private QCompleter
{
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.
QString currentCompletion() const;
///
docstring longestUniqueCompletion() const;
+ ///
+ bool uniqueCompletionAvailable() const;
public Q_SLOTS:
/// Show the popup.
/// 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:
///
/// in addition to know whether the completion is to be kept visible.
bool inlineVisible_;
///
- RtlItemDelegate * rtlItemDelegate_;
+ 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