• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • actions
kdualaction.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  *
3  * Copyright (c) 2010 Aurélien Gâteau <agateau@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301 USA
19  */
20 #ifndef KDUALACTION_H
21 #define KDUALACTION_H
22 
23 #include <kdeui_export.h>
24 #include <kaction.h>
25 
26 class KDualActionPrivate;
27 
58 class KDEUI_EXPORT KDualAction : public KAction
59 {
60  Q_OBJECT
61 public:
66  explicit KDualAction(QObject *parent);
67 
71  KDualAction(const QString &inactiveText, const QString &activeText, QObject *parent);
72 
73  ~KDualAction();
74 
78  void setActiveGuiItem(const KGuiItem &);
79 
83  KGuiItem activeGuiItem() const;
84 
88  void setInactiveGuiItem(const KGuiItem &);
89 
93  KGuiItem inactiveGuiItem() const;
94 
98  void setActiveIcon(const QIcon &);
99 
103  QIcon activeIcon() const;
104 
108  void setInactiveIcon(const QIcon &);
109 
113  QIcon inactiveIcon() const;
114 
118  void setActiveText(const QString &);
119 
123  QString activeText() const;
124 
128  void setInactiveText(const QString &);
129 
133  QString inactiveText() const;
134 
138  void setActiveToolTip(const QString &);
139 
143  QString activeToolTip() const;
144 
148  void setInactiveToolTip(const QString &);
149 
153  QString inactiveToolTip() const;
154 
158  void setIconForStates(const QIcon &icon);
159 
164  bool isActive() const;
165 
170  void setAutoToggle(bool);
171 
176  bool autoToggle() const;
177 
178 public Q_SLOTS:
183  void setActive(bool state);
184 
185 Q_SIGNALS:
190  void activeChanged(bool);
191 
196  void activeChangedByUser(bool);
197 
198 private:
199  Q_PRIVATE_SLOT(d, void slotTriggered())
200  KDualActionPrivate *const d;
201  friend class KDualActionPrivate;
202 };
203 
204 #endif /* KDUALACTION_H */
QObject
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:36
QString
kaction.h
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:216
kdeui_export.h
KDualAction
An action which can alternate between two texts/icons when triggered.
Definition: kdualaction.h:58
QIcon
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal