KDEUI
kactionmenu.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org> 00003 (C) 1999 Simon Hausmann <hausmann@kde.org> 00004 (C) 2000 Nicolas Hadacek <haadcek@kde.org> 00005 (C) 2000 Kurt Granroth <granroth@kde.org> 00006 (C) 2000 Michael Koch <koch@kde.org> 00007 (C) 2001 Holger Freyther <freyther@kde.org> 00008 (C) 2002 Ellis Whitehead <ellis@kde.org> 00009 (C) 2003 Andras Mantia <amantia@kde.org> 00010 (C) 2005-2006 Hamish Rodda <rodda@kde.org> 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Library General Public 00014 License version 2 as published by the Free Software Foundation. 00015 00016 This library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 Library General Public License for more details. 00020 00021 You should have received a copy of the GNU Library General Public License 00022 along with this library; see the file COPYING.LIB. If not, write to 00023 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00024 Boston, MA 02110-1301, USA. 00025 */ 00026 00027 #ifndef KACTIONMENU_H 00028 #define KACTIONMENU_H 00029 00030 #include <kaction.h> 00031 00032 class KMenu; 00033 00047 class KDEUI_EXPORT KActionMenu : public KAction 00048 { 00049 Q_OBJECT 00050 Q_PROPERTY( bool delayed READ delayed WRITE setDelayed ) 00051 Q_PROPERTY( bool stickyMenu READ stickyMenu WRITE setStickyMenu ) 00052 00053 public: 00054 explicit KActionMenu(QObject *parent); 00055 KActionMenu(const QString& text, QObject *parent); 00056 KActionMenu(const KIcon& icon, const QString& text, QObject *parent); 00057 virtual ~KActionMenu(); 00058 00062 #ifndef KDE_NO_DEPRECATED 00063 KDE_DEPRECATED void remove( KAction* ); 00064 #endif 00065 00066 void addAction(QAction* action); 00067 QAction* addSeparator(); 00068 void insertAction(QAction* before, QAction* action); 00069 QAction* insertSeparator(QAction* before); 00070 void removeAction(QAction* action); 00071 00077 #ifndef KDE_NO_DEPRECATED 00078 inline KDE_DEPRECATED KMenu* popupMenu() { return menu(); } 00079 #endif 00080 00085 KMenu* menu(); 00086 00087 /* 00088 * Overload of QAction::setMenu to make sure a KMenu is passed 00089 **/ 00090 void setMenu( KMenu *menu ); 00091 00096 bool delayed() const; 00097 00111 void setDelayed(bool delayed); 00112 00117 bool stickyMenu() const; 00118 00127 void setStickyMenu(bool sticky); 00128 00129 virtual QWidget* createWidget(QWidget* parent); 00130 00131 private: 00132 class KActionMenuPrivate* const d; 00133 }; 00134 00135 #endif
KDE 4.6 API Reference