]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiSymbols.h
85622a51499e1cfaeedc645be2940b017273e3a4
[lyx.git] / src / frontends / qt4 / 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 "DialogView.h"
16 #include "ui_SymbolsUi.h"
17
18 #include <map>
19 #include <set>
20
21 class QListWidgetItem;
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();
36         void dispatchParams();
37         void enableView(bool enable);
38         bool isBufferDependent() const { return true; }
39         virtual FuncCode getLfun() const { return LFUN_SELF_INSERT; }
40         //@}
41
42 public Q_SLOTS:
43         void on_applyPB_clicked();
44         void on_okPB_clicked();
45         void on_closePB_clicked();
46         void on_symbolsLW_itemActivated(QListWidgetItem *);
47         void on_symbolsLW_itemClicked(QListWidgetItem * item);
48         void on_categoryCO_activated(QString const & text);
49         void on_categoryFilterCB_toggled(bool);
50         void on_chosenLE_returnPressed();
51         void on_chosenLE_textChanged(QString const &);
52
53 private:
54         void scrollToItem(QString const & category);
55         /** update the widgets (symbol browser, category combo)
56          *  \p combo indicates if the combo box has to be refreshed
57          *  as well (which is rather expensive)
58         **/
59         void updateSymbolList(bool update_combo = true);
60         /// the encoding at cursor position
61         std::string encoding_;
62         /// which blocks do we actually include?
63         typedef std::map<QString, QListWidgetItem *> UsedBlocks;
64         ///
65         UsedBlocks used_blocks;
66         /// list of all symbols
67         typedef std::set<char_type> SymbolsList;
68         ///
69         SymbolsList symbols_;
70 };
71
72 } // namespace frontend
73 } // namespace lyx
74
75 #endif // GUISYMBOLSDIALOG_H