~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/applets/systemtray/protocols/plasmoid/plasmoidtask.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   plasmoidtask.h                                                        *
 
3
 *                                                                         *
 
4
 *   Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com>              *
 
5
 *   Copyright (C) 2008 Sebastian Kügler <sebas@kde.org>                   *
 
6
 *   Copyright (C) 2009 Marco Martin <notmart@gmail.com>                   *
 
7
 *                                                                         *
 
8
 *   This program is free software; you can redistribute it and/or modify  *
 
9
 *   it under the terms of the GNU General Public License as published by  *
 
10
 *   the Free Software Foundation; either version 2 of the License, or     *
 
11
 *   (at your option) any later version.                                   *
 
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, write to the                         *
 
20
 *   Free Software Foundation, Inc.,                                       *
 
21
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
22
 ***************************************************************************/
 
23
 
 
24
#ifndef PLASMOIDTASK_H
 
25
#define PLASMOIDTASK_H
 
26
 
 
27
#include "../../core/task.h"
 
28
 
 
29
#include <plasma/plasma.h>
 
30
 
 
31
namespace SystemTray
 
32
{
 
33
 
 
34
 
 
35
class PlasmoidTask : public Task
 
36
{
 
37
    Q_OBJECT
 
38
 
 
39
public:
 
40
    PlasmoidTask(const QString &appletName, int id, QObject *parent, Plasma::Applet *host);
 
41
    virtual ~PlasmoidTask();
 
42
 
 
43
    bool isValid() const;
 
44
    virtual bool isEmbeddable() const;
 
45
    virtual QString name() const;
 
46
    virtual QString typeId() const;
 
47
    virtual QIcon icon() const;
 
48
    void forwardConstraintsEvent(Plasma::Constraints constraints);
 
49
    Plasma::Applet *host() const;
 
50
 
 
51
protected Q_SLOTS:
 
52
    void appletDestroyed(QObject *object);
 
53
    void newAppletStatus(Plasma::ItemStatus status);
 
54
 
 
55
Q_SIGNALS:
 
56
    void taskDeleted(Plasma::Applet *host, const QString &typeId);
 
57
 
 
58
protected:
 
59
    virtual QGraphicsWidget* createWidget(Plasma::Applet *applet);
 
60
 
 
61
private:
 
62
    void setupApplet(const QString &plugin, int id);
 
63
 
 
64
    QString m_name;
 
65
    QString m_typeId;
 
66
    QIcon m_icon;
 
67
    QWeakPointer<Plasma::Applet> m_applet;
 
68
    Plasma::Applet *m_host;
 
69
    bool m_takenByParent;
 
70
};
 
71
 
 
72
}
 
73
 
 
74
#endif