2
* iconaction.h - the QAction subclass that uses Icons and supports animation
3
* Copyright (C) 2003-2004 Michail Pishchagin
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
class IconAction : public QAction
37
IconAction(QObject *parent, const char *name = 0);
38
IconAction(const QString &text, const QString &icon, const QString &menuText, QKeySequence accel, QObject *parent, const char *name = 0, bool toggle = FALSE);
39
IconAction(const QString &text, const QString &menuText, QKeySequence accel, QObject *parent, const char *name = 0, bool toggle = FALSE);
42
virtual bool addTo(QWidget *);
44
const Icon *icon() const;
45
void setIcon(const Icon *);
46
void setIcon(const QString &);
47
const QString &iconName() const;
49
QPopupMenu *popup() const;
50
void setPopup( QPopupMenu * );
52
void setIconSet( const QIconSet & );
53
void setVisible( bool );
55
virtual IconAction *copy() const;
56
virtual IconAction &operator=( const IconAction & );
59
void setEnabled(bool);
61
void setText(const QString &);
64
virtual void addingToolButton(IconToolButton *) { }
65
virtual void addingMenuItem(QPopupMenu *, int id) { Q_UNUSED(id); }
66
QPtrList<IconToolButton> buttonList();
68
QString toolTipFromMenuText() const;
71
void objectDestroyed();
72
void iconUpdated(const QPixmap &);
73
void toolButtonToggled(bool);
82
class IconActionGroup : public IconAction
86
IconActionGroup(QObject *parent, const char *name = 0, bool exclusive = false);
89
void setExclusive( bool );
90
bool isExclusive() const;
92
void add( QAction * );
95
bool addTo( QWidget * );
97
void setUsesDropDown( bool );
98
bool usesDropDown() const;
100
void insertChild( QObject * );
101
void removeChild( QObject * );
103
void addingToolButton(IconToolButton *);
105
IconAction *copy() const;
111
friend class Private;