lyx_mirror/src/frontends/qt4/GuiSymbols.h

76 lines
1.8 KiB
C
Raw Normal View History

// -*- C++ -*-
/**
* \file GuiSymbols.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
*
* Full author contact details are available in file CREDITS.
*/
#ifndef GUISYMBOLSDIALOG_H
#define GUISYMBOLSDIALOG_H
#include "DialogView.h"
#include "ui_SymbolsUi.h"
#include <map>
#include <set>
class QListWidgetItem;
namespace lyx {
namespace frontend {
class GuiSymbols : public DialogView, public Ui::SymbolsUi
{
Q_OBJECT
public:
GuiSymbols(GuiView & lv);
/// Dialog inherited methods
//@{
void updateView();
void dispatchParams();
void enableView(bool enable);
bool isBufferDependent() const { return true; }
virtual 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_categoryCO_activated(QString const & text);
void on_categoryFilterCB_toggled(bool);
void on_chosenLE_returnPressed();
void on_chosenLE_textChanged(QString const &);
private:
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;
///
UsedBlocks used_blocks;
/// list of all symbols
typedef std::set<char_type> SymbolsList;
///
SymbolsList symbols_;
};
} // namespace frontend
} // namespace lyx
#endif // GUISYMBOLSDIALOG_H