]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiSymbols.h
index 33eff14fa0d60a2b516d87ae9d91ef33224bc1a5..1ddcc1413c9df10673c2263cb93604632ba72671 100644 (file)
@@ -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.
  */
 
 #include "DialogView.h"
 #include "ui_SymbolsUi.h"
-#include "Encoding.h"
 
-class QListWidgetItem;
-class Encoding;
+#include <map>
+#include <string>
+#include <vector>
 
 namespace lyx {
 namespace frontend {
@@ -33,32 +33,43 @@ public:
        //@{
        void updateView();
        void dispatchParams();
-       bool initialiseParams(std::string const & data);
-       void clearParams() {}
+       void enableView(bool enable);
        bool isBufferDependent() const { return true; }
+       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<QString, QListWidgetItem *> UsedBlocks;
+       typedef std::map<QString, int> UsedBlocks;
        ///
        UsedBlocks used_blocks;
+       /// list of all symbols
+       typedef std::vector<char_type> SymbolsList;
+       ///
+       SymbolsList symbols_;
+       /// custom model for symbol list view
+       class Model;
+       friend class Model;
+       Model * model_;
 };
 
 } // namespace frontend