• 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
kactioncategory.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2 
3  Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 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  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KACTIONCATEGORY_H
22 #define KACTIONCATEGORY_H
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QString>
26 #include <QtCore/QList>
27 
28 #include "kstandardaction.h"
29 #include "kactioncollection.h"
30 
31 
32 class KAction;
33 struct KActionCategoryPrivate;
34 
35 class QAction;
36 
37 
38 
95 class KDEUI_EXPORT KActionCategory : public QObject
96  {
97  Q_OBJECT
98 
99  Q_PROPERTY( QString text READ text WRITE setText )
100 
101 public:
102 
106  explicit KActionCategory(const QString &text, KActionCollection *parent=NULL);
107 
111  virtual ~KActionCategory();
112 
122  QAction * addAction(const QString &name, QAction *action);
123 
124  KAction * addAction(const QString &name, KAction *action);
125 
126  KAction * addAction(
127  KStandardAction::StandardAction actionType,
128  const QObject *receiver = NULL,
129  const char *member = NULL);
130 
131  KAction * addAction(
132  KStandardAction::StandardAction actionType,
133  const QString &name,
134  const QObject *receiver = NULL,
135  const char *member = NULL);
136 
137  KAction *addAction(
138  const QString &name,
139  const QObject *receiver = NULL,
140  const char *member = NULL);
141 
142  template<class ActionType>
143  ActionType *add(
144  const QString &name,
145  const QObject *receiver = NULL,
146  const char *member = NULL)
147  {
148  ActionType *action = collection()->add<ActionType>(name, receiver, member);
149  addAction(action);
150  return action;
151  }
152 
154 
158  const QList<QAction*> actions() const;
159 
163  KActionCollection * collection() const;
164 
168  QString text() const;
169 
173  void setText(const QString& text);
174 
175 private:
176 
180  void unlistAction(QAction *action);
181 
185  void addAction(QAction *action);
186 
188  friend class KActionCollectionPrivate;
189 
191  KActionCategoryPrivate *const d;
192 };
193 
194 
195 #endif /* #ifndef KACTIONCATEGORY_H */
KActionCategory
Categorize actions for KShortcutsEditor.
Definition: kactioncategory.h:95
KActionCollection
A container for a set of QAction objects.
Definition: kactioncollection.h:56
KStandardAction::StandardAction
StandardAction
The standard menubar and toolbar actions.
Definition: kstandardaction.h:125
kactioncollection.h
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
QObject::name
const char * name() const
QObject
QString
kstandardaction.h
QList< QAction * >
KActionCategory::add
ActionType * add(const QString &name, const QObject *receiver=NULL, const char *member=NULL)
Definition: kactioncategory.h:143
QAction
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:216
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:58 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