2008-02-07 13:18:07 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GuiSymbols.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Jürgen Spitzmüller
|
2008-02-07 13:18:07 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUISYMBOLSDIALOG_H
|
|
|
|
#define GUISYMBOLSDIALOG_H
|
|
|
|
|
|
|
|
#include "DialogView.h"
|
|
|
|
#include "ui_SymbolsUi.h"
|
|
|
|
|
2008-02-07 16:24:37 +00:00
|
|
|
#include <map>
|
2008-04-20 16:32:40 +00:00
|
|
|
#include <string>
|
2008-03-21 20:47:29 +00:00
|
|
|
#include <vector>
|
2008-02-07 16:24:37 +00:00
|
|
|
|
2008-02-07 13:18:07 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class GuiSymbols : public DialogView, public Ui::SymbolsUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GuiSymbols(GuiView & lv);
|
|
|
|
|
|
|
|
/// Dialog inherited methods
|
|
|
|
//@{
|
|
|
|
void updateView();
|
|
|
|
void dispatchParams();
|
2008-02-07 14:44:17 +00:00
|
|
|
void enableView(bool enable);
|
2008-02-07 13:18:07 +00:00
|
|
|
bool isBufferDependent() const { return true; }
|
2008-04-20 16:32:40 +00:00
|
|
|
FuncCode getLfun() const { return LFUN_SELF_INSERT; }
|
2008-02-07 13:18:07 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void on_applyPB_clicked();
|
|
|
|
void on_okPB_clicked();
|
|
|
|
void on_closePB_clicked();
|
2008-03-21 18:32:06 +00:00
|
|
|
void on_symbolsLW_activated(QModelIndex const & index);
|
|
|
|
void on_symbolsLW_clicked(QModelIndex const & index);
|
2008-02-07 13:18:07 +00:00
|
|
|
void on_categoryCO_activated(QString const & text);
|
2008-02-07 17:42:00 +00:00
|
|
|
void on_categoryFilterCB_toggled(bool);
|
2008-02-07 13:18:07 +00:00
|
|
|
void on_chosenLE_returnPressed();
|
|
|
|
void on_chosenLE_textChanged(QString const &);
|
|
|
|
|
|
|
|
private:
|
2008-03-21 16:45:01 +00:00
|
|
|
void scrollToItem(QString const & category);
|
2008-02-08 11:02:23 +00:00
|
|
|
/** 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);
|
2008-02-07 13:18:07 +00:00
|
|
|
/// the encoding at cursor position
|
|
|
|
std::string encoding_;
|
|
|
|
/// which blocks do we actually include?
|
2008-03-21 16:53:15 +00:00
|
|
|
typedef std::map<QString, int> UsedBlocks;
|
2008-02-07 13:18:07 +00:00
|
|
|
///
|
|
|
|
UsedBlocks used_blocks;
|
2008-02-08 16:43:02 +00:00
|
|
|
/// list of all symbols
|
2008-03-21 20:47:29 +00:00
|
|
|
typedef std::vector<char_type> SymbolsList;
|
2008-02-08 16:43:02 +00:00
|
|
|
///
|
|
|
|
SymbolsList symbols_;
|
2008-03-21 18:32:06 +00:00
|
|
|
/// custom model for symbol list view
|
|
|
|
class Model;
|
|
|
|
friend class Model;
|
|
|
|
Model * model_;
|
2008-02-07 13:18:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // GUISYMBOLSDIALOG_H
|