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 & );
|
|
|
|
|
2010-05-08 14:01:59 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
/// Signalled when the user decided to edit group the bar currently
|
|
|
|
/// shows.
|
|
|
|
void editGroupRequested();
|
2009-10-12 13:58:32 +00:00
|
|
|
|
2012-09-25 13:13:35 +00:00
|
|
|
/// Signal for show dictionary info command from context menu
|
|
|
|
void showDictionaryInfo( QString const & id );
|
|
|
|
|
|
|
|
/// Signal to close context menu
|
|
|
|
void closePopupMenu();
|
|
|
|
|
2009-09-21 17:50:03 +00:00
|
|
|
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-10-12 13:58:32 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
void contextMenuEvent( QContextMenuEvent * event );
|
|
|
|
|
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 * );
|
2012-09-19 12:44:36 +00:00
|
|
|
|
|
|
|
void dictsPaneClicked( QString const & );
|
2009-09-21 17:50:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|