kdeui Library API Documentation

kguiitem.h

00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2001 Holger Freyther (freyher@yahoo.com)
00003                   based on ideas from Martijn and Simon
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License version 2 as published by the Free Software Foundation.
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., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
00018 
00019     Many thanks to Simon tronical Hausmann
00020 */
00021 
00022 #ifndef __kguiitem_h__
00023 #define __kguiitem_h__
00024 
00025 #include <qstring.h>
00026 #include <qiconset.h>
00027 #include <qpixmap.h>
00028 #include <qvaluelist.h>
00029 #include <kicontheme.h>
00030 #include <kglobal.h>
00031 
00037 class KDEUI_EXPORT KGuiItem
00038 {
00039 public:
00040     KGuiItem();
00041 
00042     // ### This should probably be explicit in KDE 4; it's easy to get
00043     // subtle bugs otherwise - the icon name, tooltip and whatsthis text
00044     // get changed behind your back if you do 'setButtonFoo( "Bar" );'
00045     // It gives the wrong impression that you just change the text.
00046     KGuiItem( const QString &text, 
00047               const QString &iconName  = QString::null,
00048               const QString &toolTip   = QString::null, 
00049               const QString &whatsThis = QString::null );
00050 
00051     KGuiItem( const QString &text, const QIconSet &iconSet, 
00052               const QString &toolTip   = QString::null, 
00053               const QString &whatsThis = QString::null );
00054 
00055     KGuiItem( const KGuiItem &rhs );
00056     KGuiItem &operator=( const KGuiItem &rhs );
00057 
00058     ~KGuiItem();
00059 
00060     QString text() const;
00061     QString plainText() const;
00062     QIconSet iconSet( KIcon::Group, int size = 0, KInstance* instance = KGlobal::instance()) const;
00063 #ifndef KDE_NO_COMPAT
00064     QIconSet iconSet() const { return iconSet( KIcon::Small ); }
00065 #endif
00066 
00067     QString iconName() const;
00068     QString toolTip() const;
00069     QString whatsThis() const;
00070     bool isEnabled() const;
00071     bool hasIcon() const;
00072 #ifndef KDE_NO_COMPAT
00073     bool hasIconSet() const { return hasIcon(); }
00074 #endif
00075 
00076     void setText( const QString &text );
00077     void setIconSet( const QIconSet &iconset );
00078     void setIconName( const QString &iconName );
00079     void setToolTip( const QString &tooltip );
00080     void setWhatsThis( const QString &whatsThis );
00081     void setEnabled( bool enable );
00082 
00083 private:
00084     class KGuiItemPrivate;
00085     KGuiItemPrivate *d;
00086 };
00087 
00088 /* vim: et sw=4
00089  */
00090 
00091 #endif
00092 
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 4 07:12:11 2005 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003