ktoolbarbutton.h
/* This file is part of the KDE libraries
Copyright (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
(C) 1997, 1998 Sven Radej (radej@kde.org)
(C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
(C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
(C) 2000 Kurt Granroth (granroth@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _KTOOLBARBUTTON_H
#define _KTOOLBARBUTTON_H
#include <qpixmap.h>
#include <qtoolbutton.h>
#include <qintdict.h>
#include <qstring.h>
#include <kglobal.h>
class KToolBar;
class KToolBarButtonPrivate;
class KInstance;
class QEvent;
class QPopupMenu;
class QPainter;
class KDEUI_EXPORT KToolBarButton : public QToolButton
{
Q_OBJECT
public:
KToolBarButton(const QString& icon, int id, QWidget *parent,
const char *name=0L, const QString &txt=QString::null,
KInstance *_instance = KGlobal::instance());
KToolBarButton(const QPixmap& pixmap, int id, QWidget *parent,
const char *name=0L, const QString &txt=QString::null);
KToolBarButton(QWidget *parent=0L, const char *name=0L);
~KToolBarButton();
#ifndef KDE_NO_COMPAT
// this one is from QButton, so #ifdef-ing it out doesn't break BC
virtual void setPixmap(const QPixmap &pixmap) KDE_DEPRECATED;
void setDefaultPixmap(const QPixmap& pixmap) KDE_DEPRECATED;
void setDisabledPixmap(const QPixmap& pixmap) KDE_DEPRECATED;
#endif
virtual void setText(const QString &text);
virtual void setIcon(const QString &icon);
virtual void setIcon( const QPixmap &pixmap )
{ QToolButton::setIcon( pixmap ); }
virtual void setIconSet( const QIconSet &iconset );
#ifndef KDE_NO_COMPAT
KDE_DEPRECATED void setIcon(const QString &icon, bool generate ) { Q_UNUSED(generate); setIcon( icon ); }
void setDefaultIcon(const QString& icon) KDE_DEPRECATED;
void setDisabledIcon(const QString& icon) KDE_DEPRECATED;
#endif
void on(bool flag = true);
void toggle();
void setToggle(bool toggle = true);
QPopupMenu *popup();
int id() const;
void setPopup (QPopupMenu *p, bool unused = false);
void setDelayedPopup(QPopupMenu *p, bool unused = false);
void setRadio(bool f = true);
void setNoStyle(bool no_style = true);
signals:
void clicked(int);
void buttonClicked(int, Qt::ButtonState state);
void doubleClicked(int);
void pressed(int);
void released(int);
void toggled(int);
void highlighted(int, bool);
public slots:
void modeChange();
virtual void setTextLabel(const QString&, bool tipToo);
protected:
bool event(QEvent *e);
void paletteChange(const QPalette &);
void leaveEvent(QEvent *e);
void enterEvent(QEvent *e);
void drawButton(QPainter *p);
bool eventFilter (QObject *o, QEvent *e);
void mousePressEvent( QMouseEvent * );
void mouseReleaseEvent( QMouseEvent * );
void showMenu();
QSize sizeHint() const;
QSize minimumSizeHint() const;
QSize minimumSize() const;
bool isRaised() const;
bool isActive() const;
int iconTextMode() const;
protected slots:
void slotClicked();
void slotPressed();
void slotReleased();
void slotToggled();
void slotDelayTimeout();
protected:
virtual void virtual_hook( int id, void* data );
private:
KToolBarButtonPrivate *d;
};
class KDEUI_EXPORT KToolBarButtonList : public QIntDict<KToolBarButton>
{
public:
KToolBarButtonList();
~KToolBarButtonList() {}
};
#endif
KToolBarButton
A toolbar button.
Definition: ktoolbarbutton.h:44
KToolBarButtonList
List of KToolBarButton objects.
Definition: ktoolbarbutton.h:323
KToolBarButton::setIcon
KDE_DEPRECATED void setIcon(const QString &icon, bool generate)
Definition: ktoolbarbutton.h:164
KInstance
KGlobal::instance
static KInstance * instance()
KToolBarButton::setIcon
virtual void setIcon(const QPixmap &pixmap)
Definition: ktoolbarbutton.h:141
KToolBar
Floatable toolbar with auto resize.
Definition: ktoolbar.h:103

KDE Home | KDE Accessibility Home | Description of Access Keys