forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dictionarybar.hh
52 lines (36 loc) · 1.19 KB
/
dictionarybar.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __DICTIONARYBAR_HH_INCLUDED__
#define __DICTIONARYBAR_HH_INCLUDED__
#include <QToolBar>
#include <QSize>
#include <QList>
#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 & );
signals:
/// Signalled when the user decided to edit group the bar currently
/// shows.
void editGroupRequested();
private:
Config::MutedDictionaries & mutedDictionaries;
Config::Events & configEvents;
/// All the actions we have added to the toolbar
QList< QAction * > dictActions;
protected:
void contextMenuEvent( QContextMenuEvent * event );
private slots:
void mutedDictionariesChanged();
void actionWasTriggered( QAction * );
};
#endif