2
* This file is part of unity-2d
4
* Copyright 2011 Canonical Ltd.
7
* - Aurélien Gâteau <aurelien.gateau@canonical.com>
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; version 3.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#ifndef INDICATORSMANAGER_H
22
#define INDICATORSMANAGER_H
25
#include "unity2dpanel.h"
33
#include <UnityCore/DBusIndicators.h>
37
class IndicatorEntryWidget;
40
* Instantiates DBusIndicators and implement common behavior
42
class IndicatorsManager : public QObject, public sigc::trackable
46
IndicatorsManager(Unity2dPanel* panel, QObject* parent = 0);
49
unity::indicator::DBusIndicators::Ptr indicators() const;
51
void addIndicatorEntryWidget(IndicatorEntryWidget* widget);
52
bool removeIndicatorEntryWidget(IndicatorEntryWidget* widget);
54
typedef QList<IndicatorEntryWidget*> IndicatorEntryWidgetList;
55
IndicatorEntryWidgetList getEntryWidgets() const;
58
bool eventFilter(QObject*, QEvent*);
61
void syncGeometries();
62
void checkMousePosition();
65
Q_DISABLE_COPY(IndicatorsManager)
66
Unity2dPanel* m_panel;
67
unity::indicator::DBusIndicators::Ptr m_indicators;
68
QTimer* m_geometrySyncTimer;
69
QTimer* m_mouseTrackerTimer;
70
QPoint m_lastMousePosition;
72
IndicatorEntryWidgetList m_widgetList;
75
void onEntryShowMenu(const std::string&, int x, int y, int timestamp, int button);
76
void onEntryActivateRequest(const std::string& entryId);
77
void onEntryActivated(const std::string& entryId);
80
#endif /* INDICATORSMANAGER_H */