• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

kpushbutton.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KPUSHBUTTON_H
00021 #define KPUSHBUTTON_H
00022 
00023 #include <tqpoint.h>
00024 #include <tqpushbutton.h>
00025 #include <kguiitem.h>
00026 #include <kstdguiitem.h> 
00027 
00028 class TQDragObject;
00037 class TDEUI_EXPORT KPushButton : public TQPushButton
00038 {
00039     Q_OBJECT
00040     TQ_PROPERTY(int stdItem READ guiItm WRITE setGuiItm )
00041     TQ_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
00042 
00043 public:
00044 
00048     KPushButton( TQWidget *parent, const char *name=0 );
00049 
00053     KPushButton( const TQString &text, TQWidget *parent, const char *name=0);
00054 
00058     KPushButton( const TQIconSet &icon, const TQString &text,
00059              TQWidget *parent, const char *name=0 );
00060 
00065     KPushButton( const KGuiItem &item, TQWidget *parent, const char *name = 0 );
00066 
00070     ~KPushButton();
00071 
00075     void setDragEnabled( bool enable );
00076 
00080     bool isDragEnabled() const { return m_dragEnabled; }
00081 
00085     void setGuiItem( const KGuiItem& item );
00086 
00091     void setGuiItem( KStdGuiItem::StdItem item );
00092 
00097     KStdGuiItem::StdItem guiItem() const;
00098 
00099     // Hack for Qt designer
00100     void setGuiItm(int itm ) { setGuiItem( (KStdGuiItem::StdItem)itm );}
00101     int guiItm() const { return (int)guiItem(); }
00102 
00107     void setIconSet( const TQIconSet &iconSet );
00108 
00112     void setText( const TQString &text );
00113 
00114 protected:
00120     virtual TQDragObject * dragObject();
00121 
00125     virtual void mousePressEvent( TQMouseEvent * );
00129     virtual void mouseMoveEvent( TQMouseEvent * );
00130 
00134     virtual void startDrag();
00135 
00136 private:
00137     bool m_dragEnabled;
00138     TQPoint startPos;
00139 
00140 private slots:
00141     void slotSettingsChanged( int category );
00142 
00143 private:
00148     void init( const KGuiItem &item );
00149 
00150     void readSettings();
00151     static bool s_useIcons;
00152 
00153 protected:
00154     virtual void virtual_hook( int id, void* data );
00155 private:
00156     class KPushButtonPrivate;
00157     KPushButtonPrivate *d;
00158 
00159 };
00160 
00161 #endif // KPUSHBUTTON_H

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.7.1
This website is maintained by Timothy Pearson.