• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

ktoolbarbutton.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
00003               (C) 1997, 1998 Sven Radej (radej@kde.org)
00004               (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
00005               (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
00006               (C) 2000 Kurt Granroth (granroth@kde.org)
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License version 2 as published by the Free Software Foundation.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef _KTOOLBARBUTTON_H
00024 #define _KTOOLBARBUTTON_H
00025 
00026 #include <qpixmap.h>
00027 #include <qtoolbutton.h>
00028 #include <qintdict.h>
00029 #include <qstring.h>
00030 #include <kglobal.h>
00031 
00032 class KToolBar;
00033 class KToolBarButtonPrivate;
00034 class KInstance;
00035 class QEvent;
00036 class QPopupMenu;
00037 class QPainter;
00038 
00044 class KDEUI_EXPORT KToolBarButton : public QToolButton
00045 {
00046   Q_OBJECT
00047 
00048 public:
00061   KToolBarButton(const QString& icon, int id, QWidget *parent,
00062                  const char *name=0L, const QString &txt=QString::null,
00063                  KInstance *_instance = KGlobal::instance());
00064 
00076   KToolBarButton(const QPixmap& pixmap, int id, QWidget *parent,
00077                  const char *name=0L, const QString &txt=QString::null);
00078 
00085   KToolBarButton(QWidget *parent=0L, const char *name=0L);
00086 
00090   ~KToolBarButton();
00091 
00092 #ifndef KDE_NO_COMPAT
00093 
00102   // this one is from QButton, so #ifdef-ing it out doesn't break BC
00103   virtual void setPixmap(const QPixmap &pixmap) KDE_DEPRECATED;
00104 
00112   void setDefaultPixmap(const QPixmap& pixmap) KDE_DEPRECATED;
00113 
00121   void setDisabledPixmap(const QPixmap& pixmap) KDE_DEPRECATED;
00122 #endif
00123 
00130   virtual void setText(const QString &text);
00131 
00138   virtual void setIcon(const QString &icon);
00139 
00141   virtual void setIcon( const QPixmap &pixmap )
00142   { QToolButton::setIcon( pixmap ); }
00143 
00150   virtual void setIconSet( const QIconSet &iconset );
00151 
00152 #ifndef KDE_NO_COMPAT
00153 
00164   KDE_DEPRECATED void setIcon(const QString &icon, bool generate ) { Q_UNUSED(generate); setIcon( icon ); }
00165 
00173   void setDefaultIcon(const QString& icon) KDE_DEPRECATED;
00174 
00182   void setDisabledIcon(const QString& icon) KDE_DEPRECATED;
00183 #endif
00184 
00190   void on(bool flag = true);
00191 
00195   void toggle();
00196 
00204   void setToggle(bool toggle = true);
00205 
00209   QPopupMenu *popup();
00210 
00215   int id() const;
00216 
00225   void setPopup (QPopupMenu *p, bool unused = false);
00226 
00237   void setDelayedPopup(QPopupMenu *p, bool unused = false);
00238 
00244   void setRadio(bool f = true);
00245 
00253   void setNoStyle(bool no_style = true);
00254 
00255 signals:
00259   void clicked(int);
00266   void buttonClicked(int, Qt::ButtonState state);
00267   void doubleClicked(int);
00268   void pressed(int);
00269   void released(int);
00270   void toggled(int);
00271   void highlighted(int, bool);
00272 
00273 public slots:
00279    void modeChange();
00280    virtual void setTextLabel(const QString&, bool tipToo);
00281 
00282 protected:
00283   bool event(QEvent *e);
00284   void paletteChange(const QPalette &);
00285   void leaveEvent(QEvent *e);
00286   void enterEvent(QEvent *e);
00287   void drawButton(QPainter *p);
00288   bool eventFilter (QObject *o, QEvent *e);
00290   void mousePressEvent( QMouseEvent * );
00292   void mouseReleaseEvent( QMouseEvent * );
00293   void showMenu();
00294   QSize sizeHint() const;
00295   QSize minimumSizeHint() const;
00296   QSize minimumSize() const;
00297 
00299   bool isRaised() const;
00301   bool isActive() const;
00303   int iconTextMode() const;
00304 
00305 protected slots:
00306   void slotClicked();
00307   void slotPressed();
00308   void slotReleased();
00309   void slotToggled();
00310   void slotDelayTimeout();
00311 
00312 protected:
00313   virtual void virtual_hook( int id, void* data );
00314 private:
00315   KToolBarButtonPrivate *d;
00316 };
00317 
00323 class KDEUI_EXPORT KToolBarButtonList : public QIntDict<KToolBarButton>
00324 {
00325 public:
00326    KToolBarButtonList();
00327    ~KToolBarButtonList() {}
00328 };
00329 
00330 #endif

kdeui

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal