]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiSymbols.h
Merged compilation does not exist anymore.
[lyx.git] / src / frontends / qt / GuiSymbols.h
1 // -*- C++ -*-
2 /**
3  * \file GuiSymbols.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Spitzmüller
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUISYMBOLSDIALOG_H
13 #define GUISYMBOLSDIALOG_H
14
15 #include "support/docstring.h"
16
17 #include "DialogView.h"
18 #include "ui_SymbolsUi.h"
19
20 #include <map>
21 #include <vector>
22
23 namespace lyx {
24 namespace frontend {
25
26 class GuiSymbols : public DialogView, public Ui::SymbolsUi
27 {
28         Q_OBJECT
29
30 public:
31         GuiSymbols(GuiView & lv);
32
33         /// Dialog inherited methods
34         //@{
35         void updateView() override;
36         void dispatchParams() override;
37         void enableView(bool enable) override;
38         bool isBufferDependent() const override { return true; }
39         FuncCode getLfun() const override { return LFUN_SELF_INSERT; }
40         //@}
41
42 public Q_SLOTS:
43         void slotOK();
44         void on_buttonBox_clicked(QAbstractButton *);
45         void on_symbolsLW_activated(QModelIndex const & index);
46         void on_symbolsLW_clicked(QModelIndex const & index);
47         void on_categoryCO_activated(int);
48         void on_categoryFilterCB_toggled(bool);
49         void on_chosenLE_returnPressed();
50         void on_chosenLE_textChanged(QString const &);
51
52 private:
53         void scrollToItem(QString const & category);
54         /** update the widgets (symbol browser, category combo)
55          *  \p combo indicates if the combo box has to be refreshed
56          *  as well (which is rather expensive)
57         **/
58         void updateSymbolList(bool update_combo = true);
59         /// the encoding at cursor position
60         std::string encoding_;
61         /// which blocks do we actually include?
62         typedef std::map<QString, int> UsedBlocks;
63         ///
64         UsedBlocks used_blocks;
65         /// list of all symbols
66         typedef std::vector<char_type> SymbolsList;
67         ///
68         SymbolsList symbols_;
69         /// custom model for symbol list view
70         class Model;
71         friend class Model;
72         Model * model_;
73 };
74
75 } // namespace frontend
76 } // namespace lyx
77
78 #endif // GUISYMBOLSDIALOG_H