1 /***************************************************************************
2 *                                                                         *
3 *   This program is free software; you can redistribute it and/or modify  *
4 *   it under the terms of the GNU General Public License as published by  *
5 *   the Free Software Foundation; either version 3 of the License, or     *
6 *   (at your option) any later version.                                   *
7 *                                                                         *
8 ***************************************************************************/
9 
10 #pragma once
11 
12 #include <QObject>
13 #include <QList>
14 
15 #include "dcpp/Singleton.h"
16 
17 class ArenaWidget;
18 class ArenaWidgetFactory;
19 
20 class ArenaWidgetManager: public QObject, public dcpp::Singleton<ArenaWidgetManager>
21 {
22 Q_OBJECT
23 
24 friend class dcpp::Singleton<ArenaWidgetManager>;
25 friend class ArenaWidgetFactory;
26 
27 public Q_SLOTS:
28     void rem(ArenaWidget*);
29     void activate(ArenaWidget*);
30     void toggle(ArenaWidget*);
31 
32 Q_SIGNALS:
33     void added(ArenaWidget*);
34     void removed(ArenaWidget*);
35     void updated(ArenaWidget*);
36     void activated(ArenaWidget*);
37     void toggled(ArenaWidget*);
38 
39 private:
40     ArenaWidgetManager();
41     ArenaWidgetManager(const ArenaWidgetManager &m);
42     virtual ~ArenaWidgetManager();
43     ArenaWidgetManager &operator=(const ArenaWidgetManager &);
44 
45     void add(ArenaWidget*);
46 
47     QList<ArenaWidget*> widgets;
48 };
49