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

« back to all changes in this revision

Viewing changes to plasma/desktop/shell/activitymanager/activitycontrols.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
 *   Copyright (C) 2010 Ivan Cukic <ivan.cukic(at)kde.org>
 
3
 *
 
4
 *   This program is free software; you can redistribute it and/or modify
 
5
 *   it under the terms of the GNU General Public License version 2,
 
6
 *   or (at your option) any later version, as published by the Free
 
7
 *   Software Foundation
 
8
 *
 
9
 *   This program is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details
 
13
 *
 
14
 *   You should have received a copy of the GNU General Public
 
15
 *   License along with this program; if not, write to the
 
16
 *   Free Software Foundation, Inc.,
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
18
 */
 
19
 
 
20
#ifndef ACTIVITY_CONTROLS_H_
 
21
#define ACTIVITY_CONTROLS_H_
 
22
 
 
23
#include <QGraphicsWidget>
 
24
#include <QGraphicsLinearLayout>
 
25
#include <Plasma/Label>
 
26
#include <Plasma/PushButton>
 
27
#include <Plasma/LineEdit>
 
28
 
 
29
#include "activityicon.h"
 
30
#include "activity.h"
 
31
 
 
32
class ActivityControls : public QGraphicsWidget {
 
33
    Q_OBJECT
 
34
public:
 
35
    ActivityControls(ActivityIcon * parent);
 
36
 
 
37
    virtual bool hidesContents() const;
 
38
 
 
39
Q_SIGNALS:
 
40
    void closed();
 
41
 
 
42
};
 
43
 
 
44
class ActivityRemovalConfirmation: public ActivityControls {
 
45
    Q_OBJECT
 
46
public:
 
47
    ActivityRemovalConfirmation(ActivityIcon * parent);
 
48
 
 
49
Q_SIGNALS:
 
50
    void removalConfirmed();
 
51
 
 
52
private:
 
53
    QGraphicsLinearLayout * m_layout;
 
54
 
 
55
    Plasma::Label         * m_labelRemoveActivity;
 
56
    Plasma::PushButton    * m_buttonConfirmRemoval;
 
57
    Plasma::PushButton    * m_buttonCancel;
 
58
};
 
59
 
 
60
class ActivityConfiguration: public ActivityControls {
 
61
    Q_OBJECT
 
62
public:
 
63
    ActivityConfiguration(ActivityIcon * parent, Activity * activity);
 
64
    ~ActivityConfiguration();
 
65
 
 
66
    bool hidesContents() const;
 
67
 
 
68
private Q_SLOTS:
 
69
    void applyChanges();
 
70
    void chooseIcon();
 
71
 
 
72
protected:
 
73
    void hideEvent(QHideEvent * event);
 
74
    void showEvent(QShowEvent * event);
 
75
 
 
76
private:
 
77
    QGraphicsLinearLayout * m_layoutButtons;
 
78
 
 
79
    Plasma::Label         * m_labelConfiguration;
 
80
    Plasma::PushButton    * m_buttonConfirmChanges;
 
81
    Plasma::PushButton    * m_buttonCancel;
 
82
 
 
83
    QGraphicsLinearLayout * m_layoutMain;
 
84
 
 
85
    QGraphicsWidget       * m_main;
 
86
    Plasma::LineEdit      * m_activityName;
 
87
    Plasma::PushButton    * m_activityIcon;
 
88
 
 
89
    Activity              * m_activity;
 
90
    QString                 m_iconName;
 
91
};
 
92
 
 
93
#endif // ACTIVITY_CONTROLS_H_