1
/***************************************************************************
4
* Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> *
5
* Copyright (C) 2010 Marco Martin <notmart@gmail.com> *
7
* This program is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program; if not, write to the *
19
* Free Software Foundation, Inc., *
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
21
***************************************************************************/
26
#include <plasma/popupapplet.h>
28
#include "ui_autohide.h"
29
#include "ui_visibleitems.h"
31
#include "../core/task.h"
40
class QStandardItemModel;
48
class Applet : public Plasma::PopupApplet
51
Q_PROPERTY(bool firstRun READ isFirstRun)
54
explicit Applet(QObject *parent, const QVariantList &arguments = QVariantList());
58
QGraphicsWidget *graphicsWidget();
59
void constraintsEvent(Plasma::Constraints constraints);
60
Manager *manager() const;
61
QSet<Task::Category> shownCategories() const;
63
bool isPopupShowing() const;
66
void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
67
void createConfigurationInterface(KConfigDialog *parent);
69
void popupEvent(bool show);
71
void mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); }
72
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); }
73
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); }
74
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); }
77
void configAccepted();
78
void unlockContainment();
79
void propogateSizeHintChange(Qt::SizeHint which);
82
void checkDefaultApplets();
85
static SystemTray::Manager *s_manager;
86
static int s_managerUsage;
89
TaskArea *m_hiddenTaskArea;
90
QWeakPointer<QWidget> m_autoHideInterface;
91
QWeakPointer<QWidget> m_visibleItemsInterface;
92
QSet<Task::Category> m_shownCategories;
93
QDateTime m_lastActivity;
95
Plasma::FrameSvg *m_background;
96
Plasma::FrameSvg *m_separator;
99
Ui::AutoHideConfig m_autoHideUi;
100
Ui::VisibleItemsConfig m_visibleItemsUi;
102
QWeakPointer<QStandardItemModel> m_visibleItemsSourceModel;