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

« back to all changes in this revision

Viewing changes to plasma/generic/applets/lock_logout/lockout.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) 2007 by Alexis Ménard <darktears31@gmail.com>           *
 
3
 *   Copyright (C) 2009 by Frederik Gladhorn <gladhorn@kde.org>            *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
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 General Public License     *
 
16
 *   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 LOCKOUT_H
 
22
#define LOCKOUT_H
 
23
 
 
24
#include <Plasma/Applet>
 
25
 
 
26
namespace Plasma
 
27
{
 
28
    class IconWidget;
 
29
}
 
30
 
 
31
#ifndef Q_OS_WIN
 
32
#include "ui_lockoutConfig.h"
 
33
#endif
 
34
 
 
35
class QGraphicsLinearLayout;
 
36
 
 
37
class LockOut : public Plasma::Applet
 
38
{
 
39
    Q_OBJECT
 
40
 
 
41
    public:
 
42
        LockOut(QObject *parent, const QVariantList &args);
 
43
        ~LockOut();
 
44
        void init();
 
45
        virtual void constraintsEvent(Plasma::Constraints constraints);
 
46
 
 
47
    public slots:
 
48
        void configChanged();
 
49
        void clickLogout();
 
50
        void clickSwitchUser();
 
51
        void clickLock();
 
52
        void clickSleep();
 
53
        void clickHibernate();
 
54
        void buttonChanged();
 
55
 
 
56
    protected Q_SLOTS:
 
57
        void configAccepted();
 
58
 
 
59
    protected:
 
60
        void createConfigurationInterface(KConfigDialog *parent);
 
61
        void countButtons();
 
62
        void setCheckable();
 
63
 
 
64
    private:
 
65
#ifndef Q_OS_WIN
 
66
        Ui::lockoutConfig ui;
 
67
#endif
 
68
        bool m_showLockButton;
 
69
        bool m_showSwitchUserButton;
 
70
        bool m_showLogoutButton;
 
71
        bool m_showSleepButton;
 
72
        bool m_showHibernateButton;
 
73
 
 
74
        Plasma::IconWidget *m_iconLock;
 
75
        Plasma::IconWidget *m_iconSwitchUser;
 
76
        Plasma::IconWidget *m_iconLogout;
 
77
        Plasma::IconWidget *m_iconSleep;
 
78
        Plasma::IconWidget *m_iconHibernate;
 
79
        QGraphicsLinearLayout *m_layout;
 
80
        void checkLayout();
 
81
        void showButtons();
 
82
 
 
83
        int m_visibleButtons;
 
84
        bool m_changed;
 
85
 
 
86
    signals:
 
87
        void configUiChanged();
 
88
};
 
89
 
 
90
K_EXPORT_PLASMA_APPLET(lockout, LockOut)
 
91
 
 
92
#endif