~sil2100/unity-2d/precise-security

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/indicatorsmanager.h

  • Committer: Aurelien Gateau
  • Date: 2010-11-10 08:57:29 UTC
  • mto: This revision was merged to the branch mainline in revision 284.
  • Revision ID: aurelien.gateau@canonical.com-20101110085729-fl1ye7impkqhm0w6
Added a section about const correct-ness

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * This file is part of unity-2d
3
 
 *
4
 
 * Copyright 2011 Canonical Ltd.
5
 
 *
6
 
 * Authors:
7
 
 * - Aurélien Gâteau <aurelien.gateau@canonical.com>
8
 
 *
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.
12
 
 *
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.
17
 
 *
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/>.
20
 
 */
21
 
#ifndef INDICATORSMANAGER_H
22
 
#define INDICATORSMANAGER_H
23
 
 
24
 
// Local
25
 
#include "unity2dpanel.h"
26
 
 
27
 
// Qt
28
 
#include <QMap>
29
 
#include <QObject>
30
 
#include <QPoint>
31
 
 
32
 
// libunity-core
33
 
#include <UnityCore/DBusIndicators.h>
34
 
 
35
 
class QTimer;
36
 
 
37
 
class IndicatorEntryWidget;
38
 
 
39
 
/**
40
 
 * Instantiates DBusIndicators and implement common behavior
41
 
 */
42
 
class IndicatorsManager : public QObject, public sigc::trackable
43
 
{
44
 
    Q_OBJECT
45
 
public:
46
 
    IndicatorsManager(Unity2dPanel* panel, QObject* parent = 0);
47
 
    ~IndicatorsManager();
48
 
 
49
 
    unity::indicator::DBusIndicators::Ptr indicators() const;
50
 
 
51
 
    void addIndicatorEntryWidget(IndicatorEntryWidget* widget);
52
 
    bool removeIndicatorEntryWidget(IndicatorEntryWidget* widget);
53
 
 
54
 
    typedef QList<IndicatorEntryWidget*> IndicatorEntryWidgetList;
55
 
    IndicatorEntryWidgetList getEntryWidgets() const;
56
 
 
57
 
protected:
58
 
    bool eventFilter(QObject*, QEvent*);
59
 
 
60
 
private Q_SLOTS:
61
 
    void syncGeometries();
62
 
    void checkMousePosition();
63
 
 
64
 
private:
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;
71
 
 
72
 
    IndicatorEntryWidgetList m_widgetList;
73
 
 
74
 
    void onSynced();
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);
78
 
};
79
 
 
80
 
#endif /* INDICATORSMANAGER_H */