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

« back to all changes in this revision

Viewing changes to libs/plasmagenericshell/widgetsexplorer/applettooltip.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) 2009 by Ana Cecília Martins <anaceciliamb@gmail.com>
 
3
 *   Copyright (C) 2009 by Ivan Cukic <ivan.cukic+kde@gmail.com>
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU Library/Lesser General Public License
 
7
 *   version 2, or (at your option) any later version, as published by the
 
8
 *   Free Software Foundation
 
9
 *
 
10
 *   This program is distributed in the hope that it will be useful,
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *   GNU General Public License for more details
 
14
 *
 
15
 *   You should have received a copy of the GNU Library/Lesser General Public
 
16
 *   License along with this program; if not, write to the
 
17
 *   Free Software Foundation, Inc.,
 
18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
19
 */
 
20
 
 
21
#ifndef APPLETTOOLTIP_H
 
22
#define APPLETTOOLTIP_H
 
23
 
 
24
#include "plasmaappletitemmodel_p.h"
 
25
#include "appleticon.h"
 
26
 
 
27
#include <plasma/dialog.h>
 
28
#include <plasma/widgets/iconwidget.h>
 
29
#include <plasma/widgets/pushbutton.h>
 
30
#include <plasma/widgets/textbrowser.h>
 
31
#include <plasma/widgets/label.h>
 
32
 
 
33
class AppletToolTipWidget;
 
34
 
 
35
class AppletInfoWidget : public QGraphicsWidget {
 
36
 
 
37
    Q_OBJECT
 
38
 
 
39
    public:
 
40
        explicit AppletInfoWidget(QGraphicsWidget *parent = 0);
 
41
        ~AppletInfoWidget();
 
42
 
 
43
        void init();
 
44
        void setApplet(AppletIconWidget *applet);
 
45
        AppletIconWidget *applet() const;
 
46
 
 
47
    public Q_SLOTS:
 
48
        void updateInfo();
 
49
 
 
50
    protected Q_SLOTS:
 
51
        void uninstall();
 
52
 
 
53
    private:
 
54
        AppletIconWidget *m_applet;
 
55
        QGraphicsLinearLayout *m_mainVerticalLayout;
 
56
 
 
57
        Plasma::IconWidget *m_iconWidget;
 
58
        Plasma::Label *m_nameLabel;
 
59
        Plasma::Label *m_versionLabel;
 
60
//        Plasma::TextBrowser *m_aboutLabel;
 
61
        Plasma::Label *m_aboutLabel;
 
62
        Plasma::PushButton *m_uninstallButton;
 
63
};
 
64
 
 
65
class AppletToolTipWidget : public Plasma::Dialog {
 
66
 
 
67
    Q_OBJECT
 
68
 
 
69
    public:
 
70
        explicit AppletToolTipWidget(QWidget *parent = 0, AppletIconWidget *applet = 0);
 
71
        virtual ~AppletToolTipWidget();
 
72
 
 
73
        void setAppletIconWidget(AppletIconWidget *applet);
 
74
        AppletIconWidget *appletIconWidget() const;
 
75
        void updateContent();
 
76
        void setScene(QGraphicsScene *scene);
 
77
 
 
78
    Q_SIGNALS:
 
79
        void enter();
 
80
        void leave();
 
81
 
 
82
    protected:
 
83
        void enterEvent(QEvent *event);
 
84
        void leaveEvent(QEvent *event);
 
85
        void dragEnterEvent(QDragEnterEvent *event);
 
86
 
 
87
    private:
 
88
        AppletInfoWidget *m_widget;
 
89
};
 
90
 
 
91
#endif //APPLETTOOLTIP_H