2009-09-21 17:50:03 +00:00
|
|
|
#ifndef __DICTIONARYBAR_HH_INCLUDED__
|
|
|
|
#define __DICTIONARYBAR_HH_INCLUDED__
|
|
|
|
|
|
|
|
#include <QToolBar>
|
|
|
|
#include <QSize>
|
2009-09-23 18:44:38 +00:00
|
|
|
#include <QList>
|
2009-09-21 17:50:03 +00:00
|
|
|
#include "dictionary.hh"
|
|
|
|
#include "config.hh"
|
|
|
|
|
|
|
|
/// A bar containing dictionary icons of the currently chosen group.
|
|
|
|
/// Individual dictionaries can be toggled on and off.
|
|
|
|
class DictionaryBar: public QToolBar
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/// Constructs an empty dictionary bar
|
|
|
|
DictionaryBar( QWidget * parent,
|
|
|
|
Config::MutedDictionaries & mutedDictionaries,
|
|
|
|
Config::Events & );
|
|
|
|
|
|
|
|
/// Sets dictionaries to be displayed in the bar. Their statuses (enabled/
|
|
|
|
/// disabled) are taken from the configuration data.
|
|
|
|
void setDictionaries( std::vector< sptr< Dictionary::Class > > const & );
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Config::MutedDictionaries & mutedDictionaries;
|
|
|
|
Config::Events & configEvents;
|
|
|
|
|
2009-09-23 18:44:38 +00:00
|
|
|
/// All the actions we have added to the toolbar
|
|
|
|
QList< QAction * > dictActions;
|
|
|
|
|
2009-09-21 17:50:03 +00:00
|
|
|
private slots:
|
|
|
|
|
2009-09-23 18:44:38 +00:00
|
|
|
void mutedDictionariesChanged();
|
2009-09-21 17:50:03 +00:00
|
|
|
|
|
|
|
void actionWasTriggered( QAction * );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|