]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiSymbols.h
55c99c74a23a45477db75915a7782f976d7881b2
[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
20 class QListWidgetItem;
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiSymbols : public DialogView, public Ui::SymbolsUi
26 {
27         Q_OBJECT
28
29 public:
30         GuiSymbols(GuiView & lv);
31
32         /// Dialog inherited methods
33         //@{
34         void updateView();
35         void dispatchParams();
36         void enableView(bool enable);
37         bool isBufferDependent() const { return true; }
38         virtual kb_action getLfun() const { return LFUN_SELF_INSERT; }
39         //@}
40
41 public Q_SLOTS:
42         void on_applyPB_clicked();
43         void on_okPB_clicked();
44         void on_closePB_clicked();
45         void on_symbolsLW_itemActivated(QListWidgetItem *);
46         void on_symbolsLW_itemClicked(QListWidgetItem * item);
47         void on_categoryCO_activated(QString const & text);
48         void on_categoryFilterCB_toggled(bool);
49         void on_chosenLE_returnPressed();
50         void on_chosenLE_textChanged(QString const &);
51
52 private:
53         /** update the widgets (symbol browser, category combo)
54          *  \p combo indicates if the combo box has to be refreshed
55          *  as well (which is rather expensive)
56         **/
57         void updateSymbolList(bool update_combo = true);
58         /// get the unicode block associated with \p c
59         QString const getBlock(char_type c) const;
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 };
67
68 } // namespace frontend
69 } // namespace lyx
70
71 #endif // GUISYMBOLSDIALOG_H