]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiCompleter.cpp
* completion cursor
[lyx.git] / src / frontends / qt4 / GuiCompleter.cpp
1 /**
2  * \file GuiCompleter.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Stefan Schimanski
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "GuiWorkArea.h"
14
15 #include "Buffer.h"
16 #include "BufferView.h"
17 #include "Cursor.h"
18 #include "Dimension.h"
19 #include "FuncRequest.h"
20 #include "GuiView.h"
21 #include "LyXFunc.h"
22 #include "LyXRC.h"
23 #include "Paragraph.h"
24 #include "version.h"
25
26 #include "support/debug.h"
27
28 #include <QApplication>
29 #include <QAbstractListModel>
30 #include <QHeaderView>
31 #include <QPainter>
32 #include <QPixmapCache>
33 #include <QScrollBar>
34 #include <QItemDelegate>
35 #include <QTreeView>
36 #include <QTimer>
37
38 using namespace std;
39 using namespace lyx::support;
40
41 namespace lyx {
42 namespace frontend {
43
44 class RtlItemDelegate : public QItemDelegate {
45 public:
46         explicit RtlItemDelegate(QObject * parent = 0)
47                 : QItemDelegate(parent) {}
48
49 protected:
50         virtual void drawDisplay(QPainter * painter,
51                 QStyleOptionViewItem const & option,
52                 QRect const & rect, QString const & text) const
53         {
54                 // FIXME: do this more elegantly
55                 docstring stltext = qstring_to_ucs4(text);
56                 reverse(stltext.begin(), stltext.end());
57                 QItemDelegate::drawDisplay(painter, option, rect, toqstr(stltext));
58         }
59 };
60
61
62 class PixmapItemDelegate : public QItemDelegate {
63 public:
64         explicit PixmapItemDelegate(QObject *parent = 0)
65         : QItemDelegate(parent) {}
66
67 protected:
68         void paint(QPainter *painter, const QStyleOptionViewItem &option,
69                    const QModelIndex &index) const
70         {
71                 QStyleOptionViewItem opt = setOptions(index, option);
72                 QVariant value = index.data(Qt::DisplayRole);
73                 QPixmap pixmap = qvariant_cast<QPixmap>(value);
74                 
75                 // draw
76                 painter->save();
77                 drawBackground(painter, opt, index);
78                 if (!pixmap.isNull()) {
79                         const QSize size = pixmap.size();
80                         painter->drawPixmap(option.rect.left() + (16 - size.width()) / 2,
81                                 option.rect.top() + (option.rect.height() - size.height()) / 2,
82                                 pixmap);
83                 }
84                 drawFocus(painter, opt, option.rect);
85                 painter->restore();
86         }
87 };
88
89
90 class GuiCompletionModel : public QAbstractListModel {
91 public:
92         ///
93         GuiCompletionModel(QObject * parent,
94                 Inset::CompletionList const * l)
95                 : QAbstractListModel(parent), list_(l) {}
96         ///
97         ~GuiCompletionModel()
98                 { delete list_; }
99         ///
100         bool sorted() const
101         {
102                 if (list_)
103                         return list_->sorted();
104                 else
105                         return false;
106         }
107         ///
108         int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const
109         {
110                 return 2;
111         }
112         ///
113         int rowCount(const QModelIndex & /*parent*/ = QModelIndex()) const
114         {
115                 if (list_ == 0)
116                         return 0;
117                 else
118                         return list_->size();
119         }
120
121         ///
122         QVariant data(const QModelIndex & index, int role) const
123         {
124                 if (list_ == 0)
125                         return QVariant();
126
127                 if (index.row() < 0 || index.row() >= rowCount())
128                         return QVariant();
129
130                 if (role != Qt::DisplayRole && role != Qt::EditRole)
131                     return QVariant();
132                     
133                 if (index.column() == 0) {
134                         docstring const word = list_->data(index.row());
135                         return toqstr(word);
136                 } else if (index.column() == 1) {
137                         // get icon from cache
138                         QPixmap scaled;
139                         QString const name = ":" + toqstr(list_->icon(index.row()));
140                         if (!QPixmapCache::find("completion" + name, scaled)) {
141                                 // load icon from disk
142                                 QPixmap p = QPixmap(name);
143                                 if (!p.isNull()) {
144                                         // scale it to 16x16 or smaller
145                                         scaled = p.scaled(min(16, p.width()), min(16, p.height()), 
146                                                 Qt::KeepAspectRatio, Qt::SmoothTransformation);
147                                 }
148
149                                 QPixmapCache::insert("completion" + name, scaled);
150                         }
151                         return scaled;
152                 }
153                 return QVariant();
154         }
155
156 private:
157         ///
158         Inset::CompletionList const * list_;
159 };
160
161
162 GuiCompleter::GuiCompleter(GuiWorkArea * gui, QObject * parent)
163         : QCompleter(parent), gui_(gui), updateLock_(0),
164           inlineVisible_(false)
165 {
166         // Setup the completion popup
167         setModel(new GuiCompletionModel(this, 0));
168         setCompletionMode(QCompleter::PopupCompletion);
169         setWidget(gui_);
170         
171         // create the popup
172         QTreeView *listView = new QTreeView;
173         listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
174         listView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
175         listView->setSelectionBehavior(QAbstractItemView::SelectRows);
176         listView->setSelectionMode(QAbstractItemView::SingleSelection);
177         listView->header()->hide();
178         listView->setIndentation(0);
179         listView->setUniformRowHeights(true);
180         setPopup(listView);
181         popup()->setItemDelegateForColumn(1, new PixmapItemDelegate(this));
182         rtlItemDelegate_ = new RtlItemDelegate(this);
183         
184         // create timeout timers
185         popup_timer_.setSingleShot(true);
186         inline_timer_.setSingleShot(true);
187         connect(this, SIGNAL(highlighted(const QString &)),
188                 this, SLOT(popupHighlighted(const QString &)));
189         connect(this, SIGNAL(activated(const QString &)),
190                 this, SLOT(popupActivated(const QString &)));
191         connect(&popup_timer_, SIGNAL(timeout()),
192                 this, SLOT(showPopup()));
193         connect(&inline_timer_, SIGNAL(timeout()),
194                 this, SLOT(showInline()));
195 }
196
197
198 GuiCompleter::~GuiCompleter()
199 {
200         popup()->hide();
201 }
202
203
204 bool GuiCompleter::eventFilter(QObject * watched, QEvent * e)
205 {
206         // hijack back the tab key from the popup
207         // (which stole it from the workspace before)
208         if (e->type() == QEvent::KeyPress && popupVisible()) {
209                 QKeyEvent *ke = static_cast<QKeyEvent *>(e);
210                 switch (ke->key()) {
211                 case Qt::Key_Tab:
212                         tab();
213                         ke->accept();
214                         return true;
215                 default: break;
216                 }
217         }
218         
219         return QCompleter::eventFilter(watched, e);
220 }
221
222
223 bool GuiCompleter::popupPossible(Cursor const & cur) const
224 {
225         return QApplication::activeWindow()
226                 && gui_->hasFocus()
227                 && cur.inset().completionSupported(cur);
228 }
229
230
231 bool GuiCompleter::inlinePossible(Cursor const & cur) const
232 {
233         return cur.inset().inlineCompletionSupported(cur);
234 }
235
236
237 bool GuiCompleter::completionAvailable() const
238 {
239         return popup()->model()->rowCount() > 0;
240 }
241
242
243 bool GuiCompleter::popupVisible() const
244 {
245         return popup()->isVisible();
246 }
247
248
249 bool GuiCompleter::inlineVisible() const
250 {
251         // In fact using BufferView::inlineCompletionPos.empty() should be
252         // here. But unfortunately this information is not good enough
253         // because destructive operations like backspace might invalidate
254         // inlineCompletionPos. But then the completion should stay visible
255         // (i.e. reshown on the next update). Hence be keep this information
256         // in the inlineVisible_ variable.
257         return inlineVisible_;
258 }
259
260
261 void GuiCompleter::updateVisibility(Cursor & cur, bool start, bool keep, bool cursorInView)
262 {
263         // parameters which affect the completion
264         bool moved = cur != old_cursor_;
265         if (moved)
266                 old_cursor_ = cur;
267
268         bool possiblePopupState = popupPossible(cur) && cursorInView;
269         bool possibleInlineState = inlinePossible(cur) && cursorInView;
270
271         // we moved or popup state is not ok for popup?
272         if ((moved && !keep) || !possiblePopupState)
273                 hidePopup(cur);
274
275         // we moved or inline state is not ok for inline completion?
276         if ((moved && !keep) || !possibleInlineState)
277                 hideInline(cur);
278
279         // we inserted something and are in a possible popup state?
280         if (!popupVisible() && possiblePopupState && start
281                 && cur.inset().automaticPopupCompletion())
282                 popup_timer_.start(int(lyxrc.completion_popup_delay * 1000));
283
284         // we inserted something and are in a possible inline completion state?
285         if (!inlineVisible() && possibleInlineState && start
286                 && cur.inset().automaticInlineCompletion())
287                 inline_timer_.start(int(lyxrc.completion_inline_delay * 1000));
288
289         // update prefix if popup is visible or if it will be visible soon
290         if (popupVisible() || inlineVisible()
291             || popup_timer_.isActive() || inline_timer_.isActive())
292                 updatePrefix(cur);
293 }
294
295
296 void GuiCompleter::updateVisibility(bool start, bool keep)
297 {
298         Cursor cur = gui_->bufferView().cursor();
299         cur.updateFlags(Update::None);
300         
301         updateVisibility(cur, start, keep);
302         
303         if (cur.disp_.update())
304                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
305 }
306
307
308 void GuiCompleter::updatePrefix(Cursor & cur)
309 {
310         // get new prefix. Do nothing if unchanged
311         QString newPrefix = toqstr(cur.inset().completionPrefix(cur));
312         if (newPrefix == completionPrefix())
313                 return;
314         
315         // value which should be kept selected
316         QString old = currentCompletion();
317         if (old.length() == 0)
318                 old = last_selection_;
319         
320         // update completer to new prefix
321         setCompletionPrefix(newPrefix);
322
323         // update popup because its size might have changed
324         if (popupVisible())
325                 updatePopup(cur);
326
327         // restore old selection
328         setCurrentCompletion(old);
329         
330         // if popup is not empty, the new selection will
331         // be our last valid one
332         QString const & s = currentCompletion();
333         if (s.length() > 0)
334                 last_selection_ = s;
335         else
336                 last_selection_ = old;
337         
338         // update inline completion because the default
339         // completion string might have changed
340         if (inlineVisible())
341                 updateInline(cur, s);
342 }
343
344
345 void GuiCompleter::updateInline(Cursor & cur, QString const & completion)
346 {
347         if (!cur.inset().inlineCompletionSupported(cur))
348                 return;
349         
350         // compute postfix
351         docstring prefix = cur.inset().completionPrefix(cur);
352         docstring postfix = from_utf8(fromqstr(completion.mid(prefix.length())));
353         
354         // shorten it if necessary
355         if (lyxrc.completion_inline_dots != -1
356             && postfix.size() > unsigned(lyxrc.completion_inline_dots))
357                 postfix = postfix.substr(0, lyxrc.completion_inline_dots - 1) + "...";
358
359         // set inline completion at cursor position
360         size_t uniqueTo = max(longestUniqueCompletion().size(), prefix.size());
361         gui_->bufferView().setInlineCompletion(cur, cur, postfix, uniqueTo - prefix.size());
362         inlineVisible_ = true;
363 }
364
365
366 void GuiCompleter::updatePopup(Cursor & cur)
367 {
368         if (!cur.inset().completionSupported(cur))
369                 return;
370         
371         if (completionCount() == 0)
372                 return;
373         
374         // get dimensions of completion prefix
375         Dimension dim;
376         int x;
377         int y;
378         cur.inset().completionPosAndDim(cur, x, y, dim);
379         
380         // and calculate the rect of the popup
381         QRect rect;
382         if (popup()->layoutDirection() == Qt::RightToLeft)
383                 rect = QRect(x + dim.width() - 200, y - dim.ascent() - 3, 200, dim.height() + 6);
384         else
385                 rect = QRect(x, y - dim.ascent() - 3, 200, dim.height() + 6);
386         
387         // show/update popup
388         QTreeView * p = static_cast<QTreeView *>(popup());
389         p->setColumnWidth(0, popup()->width() - 22 - p->verticalScrollBar()->width());
390
391         complete(rect);
392 }
393
394
395 void GuiCompleter::updateModel(Cursor & cur, bool popupUpdate, bool inlineUpdate)
396 {
397         // value which should be kept selected
398         QString old = currentCompletion();
399         if (old.length() == 0)
400                 old = last_selection_;
401
402         // set whether rtl
403         bool rtl = false;
404         if (cur.inTexted()) {
405                 Paragraph const & par = cur.paragraph();
406                 Font const font =
407                 par.getFontSettings(cur.bv().buffer().params(), cur.pos());
408                 rtl = font.isVisibleRightToLeft();
409         }
410         popup()->setLayoutDirection(rtl ? Qt::RightToLeft : Qt::LeftToRight);
411
412         // turn the direction of the strings in the popup.
413         // Qt does not do that itself.
414         popup()->setItemDelegateForColumn(0, rtl ? rtlItemDelegate_ : 0);
415
416         // set new model
417         Inset::CompletionList const * list = cur.inset().createCompletionList(cur);
418         setModel(new GuiCompletionModel(this, list));
419         if (list->sorted())
420                 setModelSorting(QCompleter::CaseSensitivelySortedModel);
421         else
422                 setModelSorting(QCompleter::UnsortedModel);
423
424         // set prefix
425         QString newPrefix = toqstr(cur.inset().completionPrefix(cur));
426         if (newPrefix != completionPrefix())
427                 setCompletionPrefix(newPrefix);
428
429         // show popup
430         if (popupUpdate)
431                 updatePopup(cur);
432
433         // restore old selection
434         setCurrentCompletion(old);
435         
436         // if popup is not empty, the new selection will
437         // be our last valid one
438         QString const & s = currentCompletion();
439         if (s.length() > 0)
440                 last_selection_ = s;
441         else
442                 last_selection_ = old;
443
444         // show inline completion
445         if (inlineUpdate)
446                 updateInline(cur, currentCompletion());
447 }
448
449
450 void GuiCompleter::showPopup(Cursor & cur)
451 {
452         if (!popupPossible(cur))
453                 return;
454         
455         updateModel(cur, true, inlineVisible());
456 }
457
458
459 void GuiCompleter::hidePopup(Cursor & cur)
460 {
461         popup()->hide();
462         if (popup_timer_.isActive())
463                 popup_timer_.stop();
464         
465         if (!inlineVisible())
466                 setModel(new GuiCompletionModel(this, 0));
467 }
468
469
470 void GuiCompleter::showInline(Cursor & cur)
471 {
472         if (!inlinePossible(cur))
473                 return;
474         
475         updateModel(cur, popupVisible(), true);
476 }
477
478
479 void GuiCompleter::hideInline(Cursor & cur)
480 {
481         gui_->bufferView().setInlineCompletion(cur, DocIterator(), docstring());
482         inlineVisible_ = false;
483         
484         if (!popupVisible())
485                 setModel(new GuiCompletionModel(this, 0));
486 }
487
488
489 void GuiCompleter::showPopup()
490 {
491         Cursor cur = gui_->bufferView().cursor();
492         cur.updateFlags(Update::None);
493         
494         showPopup(cur);
495
496         // redraw if needed
497         if (cur.disp_.update())
498                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
499 }
500
501
502 void GuiCompleter::showInline()
503 {
504         Cursor cur = gui_->bufferView().cursor();
505         cur.updateFlags(Update::None);
506         
507         showInline(cur);
508
509         // redraw if needed
510         if (cur.disp_.update())
511                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
512 }
513
514
515 void GuiCompleter::hidePopup()
516 {
517         Cursor cur = gui_->bufferView().cursor();
518         cur.updateFlags(Update::None);
519         
520         hidePopup(cur);
521         
522         // redraw if needed
523         if (cur.disp_.update())
524                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
525 }
526
527
528 void GuiCompleter::hideInline()
529 {
530         Cursor cur = gui_->bufferView().cursor();
531         cur.updateFlags(Update::None);
532         
533         hideInline(cur);
534         
535         // redraw if needed
536         if (cur.disp_.update())
537                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
538 }
539
540
541 void GuiCompleter::activate()
542 {
543         if (!popupVisible() && !inlineVisible())
544                 return;
545
546         popupActivated(currentCompletion());
547 }
548
549
550 void GuiCompleter::tab()
551 {
552         BufferView * bv = &gui_->bufferView();
553         Cursor cur = bv->cursor();
554         cur.updateFlags(Update::None);
555         
556         // check that inline completion is active
557         if (!inlineVisible()) {
558                 // try to activate the inline completion
559                 if (cur.inset().inlineCompletionSupported(cur)) {
560                         showInline();
561                         
562                         // show popup without delay because the completion was not unique
563                         if (lyxrc.completion_popup_after_complete
564                             && !popupVisible()
565                             && popup()->model()->rowCount() > 1)
566                                 popup_timer_.start(0);
567
568                         return;
569                 }
570                 // or try popup
571                 if (!popupVisible() && cur.inset().completionSupported(cur)) {
572                         showPopup();
573                         return;
574                 }
575                 
576                 return;
577         }
578         
579         // If completion is active, at least complete by one character
580         docstring prefix = cur.inset().completionPrefix(cur);
581         docstring completion = from_utf8(fromqstr(currentCompletion()));
582         if (completion.size() <= prefix.size()) {
583                 // finalize completion
584                 cur.inset().insertCompletion(cur, docstring(), true);
585                 
586                 // hide popup and inline completion
587                 hidePopup(cur);
588                 hideInline(cur);
589                 updateVisibility(false, false);
590                 return;
591         }
592         docstring nextchar = completion.substr(prefix.size(), 1);
593         if (!cur.inset().insertCompletion(cur, nextchar, false))
594                 return;
595         updatePrefix(cur);
596
597         // try to complete as far as it is unique
598         docstring longestCompletion = longestUniqueCompletion();
599         prefix = cur.inset().completionPrefix(cur);
600         docstring postfix = longestCompletion.substr(min(longestCompletion.size(), prefix.size()));
601         cur.inset().insertCompletion(cur, postfix, false);
602         old_cursor_ = bv->cursor();
603         updatePrefix(cur);
604
605         // show popup without delay because the completion was not unique
606         if (lyxrc.completion_popup_after_complete
607             && !popupVisible()
608             && popup()->model()->rowCount() > 1)
609                 popup_timer_.start(0);
610
611         // redraw if needed
612         if (cur.disp_.update())
613                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
614 }
615
616
617 QString GuiCompleter::currentCompletion() const
618 {
619         if (!popup()->selectionModel()->hasSelection())
620                 return QString();
621
622         // Not sure if this is bug in Qt: currentIndex() always 
623         // return the first element in the list.
624         QModelIndex idx = popup()->currentIndex();
625         return popup()->model()->data(idx, Qt::EditRole).toString();
626 }
627
628
629 void GuiCompleter::setCurrentCompletion(QString const & s)
630 {       
631         QAbstractItemModel const & model = *popup()->model();
632         size_t n = model.rowCount();
633         if (n == 0)
634                 return;
635
636         // select the first if s is empty
637         if (s.length() == 0) {
638                 updateLock_++;
639                 popup()->setCurrentIndex(model.index(0, 0));
640                 updateLock_--;
641                 return;
642         }
643
644         // find old selection in model
645         size_t i;
646         if (modelSorting() == QCompleter::UnsortedModel) {
647                 // In unsorted models, iterate through list until the s is found
648                 for (i = 0; i < n; ++i) {
649                         QString const & is
650                         = model.data(model.index(i, 0), Qt::EditRole).toString();
651                         if (is == s)
652                                 break;
653                 }
654         } else {
655                 // In sorted models, do binary search for s.
656                 int l = 0;
657                 int r = n - 1;
658                 while (r >= l && l < int(n)) {
659                         size_t mid = (r + l) / 2;
660                         QString const & mids
661                         = model.data(model.index(mid, 0),
662                                      Qt::EditRole).toString();
663
664                         // left or right?
665                         // FIXME: is this really the same order that the docstring
666                         // from the CompletionList has?
667                         int c = s.compare(mids, Qt::CaseSensitive);
668                         if (c == 0) {
669                                 l = mid;
670                                 break;
671                         } else if (l == r) {
672                                 l = n;
673                                 break;
674                         } else if (c > 0)
675                                 // middle is not far enough
676                                 l = mid + 1;
677                         else
678                                 // middle is too far
679                                 r = mid - 1;
680                 }
681
682                 // loop was left without finding anything
683                 if (r < l)
684                         i = n;
685                 else
686                         i = l;
687                 BOOST_ASSERT(0 <= i && i <= n);
688         }
689
690         // select the first if none was found
691         if (i == n)
692                 i = 0;
693
694         updateLock_++;
695         popup()->setCurrentIndex(model.index(i, 0));
696         updateLock_--;
697 }
698
699
700 size_t commonPrefix(QString const & s1, QString const & s2)
701 {
702         // find common prefix
703         size_t j;
704         size_t n1 = s1.length();
705         size_t n2 = s2.length();
706         for (j = 0; j < n1 && j < n2; ++j) {
707                 if (s1.at(j) != s2.at(j))
708                         break;
709         }
710         return j;
711 }
712
713
714 docstring GuiCompleter::longestUniqueCompletion() const
715 {
716         QAbstractItemModel const & model = *popup()->model();
717         QString s = currentCompletion();
718         size_t n = model.rowCount();
719
720         if (modelSorting() == QCompleter::UnsortedModel) {
721                 // For unsorted model we cannot do more than iteration.
722                 // Iterate through the completions and cut off where s differs
723                 for (size_t i = 0; i < n && s.length() > 0; ++i) {
724                         QString const & is
725                         = model.data(model.index(i, 0), Qt::EditRole).toString();
726
727                         s = s.left(commonPrefix(is, s));
728                 }
729         } else {
730                 // For sorted models we can do binary search multiple times,
731                 // each time to find the first string which has s not as prefix.
732                 size_t i = 0;
733                 while (i < n && s.length() > 0) {
734                         // find first string that does not have s as prefix
735                         // via binary search in [i,n-1]
736                         size_t r = n - 1;
737                         do {
738                                 // get common prefix with the middle string
739                                 size_t mid = (r + i) / 2;
740                                 QString const & mids
741                                 = model.data(model.index(mid, 0), 
742                                         Qt::EditRole).toString();
743                                 size_t oldLen = s.length();
744                                 size_t len = commonPrefix(mids, s);
745                                 s = s.left(len);
746
747                                 // left or right?
748                                 if (oldLen == len) {
749                                         // middle is not far enough
750                                         i = mid + 1;
751                                 } else {
752                                         // middle is maybe too far
753                                         r = mid;
754                                 }
755                         } while (r - i > 0 && i < n);
756                 }
757         }
758
759         return from_utf8(fromqstr(s));
760 }
761
762
763 void GuiCompleter::popupActivated(const QString & completion)
764 {
765         Cursor cur = gui_->bufferView().cursor();
766         cur.updateFlags(Update::None);
767         
768         docstring prefix = cur.inset().completionPrefix(cur);
769         docstring postfix = from_utf8(fromqstr(completion.mid(prefix.length())));
770         cur.inset().insertCompletion(cur, postfix, true);
771         hidePopup(cur);
772         hideInline(cur);
773         
774         if (cur.disp_.update())
775                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
776 }
777
778
779 void GuiCompleter::popupHighlighted(const QString & completion)
780 {
781         if (updateLock_ > 0)
782                 return;
783
784         Cursor cur = gui_->bufferView().cursor();
785         cur.updateFlags(Update::None);
786         
787         if (inlineVisible())
788                 updateInline(cur, completion);
789         
790         if (cur.disp_.update())
791                 gui_->bufferView().processUpdateFlags(cur.disp_.update());
792 }
793
794 } // namespace frontend
795 } // namespace lyx
796
797 #include "GuiCompleter_moc.cpp"