Polkit-Qt-1  0.95.0
polkitqt1-gui-actionbutton.h
1 /*
2  * This file is part of the Polkit-qt project
3  * Copyright (C) 2009 Daniel Nicoletti <dantti85-pk@yahoo.com.br>
4  * Copyright (C) 2009 Dario Freddi <drf@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef POLKITQT1_GUI_ACTIONBUTTON_H
23 #define POLKITQT1_GUI_ACTIONBUTTON_H
24 
25 #include "polkitqt1-export.h"
26 #include "polkitqt1-gui-action.h"
27 
28 class QAbstractButton;
29 
30 namespace PolkitQt1
31 {
32 
33 namespace Gui
34 {
35 
36 class ActionButtonPrivate;
53 class POLKITQT1_EXPORT ActionButton : public Action
54 {
55  Q_OBJECT
56  Q_DECLARE_PRIVATE(ActionButton)
57  Q_DISABLE_COPY(ActionButton)
58 
59 public:
73  explicit ActionButton(QAbstractButton *button, const QString &actionId = QString(), QObject *parent = 0);
74  virtual ~ActionButton();
75 
90  void setButton(QAbstractButton *button);
91 
97  QAbstractButton *button() const;
98 
99 public Q_SLOTS:
114  bool activate();
115 
116 Q_SIGNALS:
129  void clicked(QAbstractButton *button, bool checked = false);
130 
131 protected:
132  ActionButton(ActionButtonPrivate &dd, const QString &actionId, QObject *parent = 0);
133 
134  ActionButtonPrivate * const d_ptr;
135 
136 private:
137  Q_PRIVATE_SLOT(d_func(), void updateButton())
138  Q_PRIVATE_SLOT(d_func(), void streamClicked(bool))
139 };
140 
141 }
142 
143 }
144 
145 #endif
Class used to manage actions.
Definition: polkitqt1-gui-action.h:53
Class used to hold and update a QAbstractButton.
Definition: polkitqt1-gui-actionbutton.h:53
Contains Macros for exporting symbols.
Namespace wrapping Polkit-Qt classes.
Definition: listeneradapter.cpp:26