3 * \file qt4/GuiSelection.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUISELECTION_H
15 #define GUISELECTION_H
17 #include "frontends/Selection.h"
25 * The Qt4 version of the Selection.
27 class GuiSelection : public QObject, public Selection
32 virtual ~GuiSelection() {}
34 /** Selection overloaded methods
37 void haveSelection(bool own);
38 docstring const get() const;
39 void put(docstring const & str);
44 void on_dataChanged();
47 // Cache which is to speed up selection-status read
48 // (4 calls when openi Edit menu).
49 bool text_selection_empty_;
50 // Direct call clipboard()->text(QClipboard::Selection) inside onDataChanged causes
51 // selection to be obtained. Now imagine the some LyX instance A, when making selection -
52 // each change triggers onDataChange in all others instances for each mouse
53 // or keyboard move. This in turn causes many calls of requestSelection in A
54 // which interferes with the selecting itself. As a result middle button pasting
55 // for more instances don't work and debugging is a hell. So we just schedule
56 // obtaining of selection on the time empty() is actually called.
58 bool const selection_supported_;
61 } // namespace frontend
64 #endif // GUISELECTION_H