X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSymbols.h;h=1ddcc1413c9df10673c2263cb93604632ba72671;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=d18eba6074106f176e2a7bacd29dd3656c21b665;hpb=e17289843019c6f726d3853ea5239d6f1f4472e0;p=lyx.git diff --git a/src/frontends/qt4/GuiSymbols.h b/src/frontends/qt4/GuiSymbols.h index d18eba6074..1ddcc1413c 100644 --- a/src/frontends/qt4/GuiSymbols.h +++ b/src/frontends/qt4/GuiSymbols.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Jürgen Spitzmüller + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ @@ -16,8 +16,8 @@ #include "ui_SymbolsUi.h" #include - -class QListWidgetItem; +#include +#include namespace lyx { namespace frontend { @@ -35,31 +35,41 @@ public: void dispatchParams(); void enableView(bool enable); bool isBufferDependent() const { return true; } - virtual kb_action getLfun() const { return LFUN_SELF_INSERT; } + FuncCode getLfun() const { return LFUN_SELF_INSERT; } //@} public Q_SLOTS: void on_applyPB_clicked(); void on_okPB_clicked(); void on_closePB_clicked(); - void on_symbolsLW_itemActivated(QListWidgetItem *); - void on_symbolsLW_itemClicked(QListWidgetItem * item); + void on_symbolsLW_activated(QModelIndex const & index); + void on_symbolsLW_clicked(QModelIndex const & index); void on_categoryCO_activated(QString const & text); void on_categoryFilterCB_toggled(bool); void on_chosenLE_returnPressed(); void on_chosenLE_textChanged(QString const &); private: - /// update the widgets (symbol browser, category combo) - void updateSymbolList(); - /// get the unicode block associated with \p c - QString const getBlock(char_type c) const; + void scrollToItem(QString const & category); + /** update the widgets (symbol browser, category combo) + * \p combo indicates if the combo box has to be refreshed + * as well (which is rather expensive) + **/ + void updateSymbolList(bool update_combo = true); /// the encoding at cursor position std::string encoding_; /// which blocks do we actually include? - typedef std::map UsedBlocks; + typedef std::map UsedBlocks; /// UsedBlocks used_blocks; + /// list of all symbols + typedef std::vector SymbolsList; + /// + SymbolsList symbols_; + /// custom model for symbol list view + class Model; + friend class Model; + Model * model_; }; } // namespace frontend