not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / applets / systemtray / ui / applet.h
blobb1f5b4f233ec4fbeeb787049924c0f16e24e5af8
1 /***************************************************************************
2 * applet.h *
3 * *
4 * Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
20 ***************************************************************************/
22 #ifndef APPLET_H
23 #define APPLET_H
25 #include <plasma/popupapplet.h>
27 namespace SystemTray
30 class Job;
31 class Manager;
32 class Notification;
34 class Applet : public Plasma::PopupApplet
36 Q_OBJECT
38 public:
39 explicit Applet(QObject *parent, const QVariantList &arguments = QVariantList());
40 ~Applet();
42 void init();
43 void constraintsEvent(Plasma::Constraints constraints);
44 void setGeometry(const QRectF &rect);
45 Manager *manager()const;
47 protected:
48 void paintInterface(QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect);
49 void createConfigurationInterface(KConfigDialog *parent);
50 void initExtenderItem(Plasma::ExtenderItem *extenderItem);
52 void mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); }
53 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); }
54 void hoverEnterEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); }
55 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); }
57 void popupEvent(bool show);
59 private slots:
60 void configAccepted();
61 void propogateSizeHintChange(Qt::SizeHint which);
62 void checkSizes();
63 void addNotification(SystemTray::Notification *notification);
64 void addJob(SystemTray::Job *job);
65 void hidePopupIfEmpty();
67 private:
68 class Private;
69 Private* const d;
75 #endif