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 
00032 class KGuiItem
00033 {
00034 public:
00035     KGuiItem();
00036 
00037     KGuiItem( const QString &text, 
00038               const QString &iconName  = QString::null,
00039               const QString &toolTip   = QString::null, 
00040               const QString &whatsThis = QString::null );
00041 
00042     KGuiItem( const QString &text, const QIconSet &iconSet, 
00043               const QString &toolTip   = QString::null, 
00044               const QString &whatsThis = QString::null );
00045 
00046     KGuiItem( const KGuiItem &rhs );
00047     KGuiItem &operator=( const KGuiItem &rhs );
00048 
00049     ~KGuiItem();
00050 
00051     QString text() const;
00052     QString plainText() const;
00053     QIconSet iconSet( KIcon::Group, int size = 0, KInstance* instance = KGlobal::instance()) const;
00054 #ifndef KDE_NO_COMPAT
00055     QIconSet iconSet() const { return iconSet( KIcon::Small ); }
00056 #endif
00057 
00058     QString iconName() const;
00059     QString toolTip() const;
00060     QString whatsThis() const;
00061     bool isEnabled() const;
00062     bool hasIcon() const;
00063 #ifndef KDE_NO_COMPAT
00064     bool hasIconSet() const { return hasIcon(); }
00065 #endif
00066 
00067     void setText( const QString &text );
00068     void setIconSet( const QIconSet &iconset );
00069     void setIconName( const QString &iconName );
00070     void setToolTip( const QString &tooltip );
00071     void setWhatsThis( const QString &whatsThis );
00072     void setEnabled( bool enable );
00073 
00074 private:
00075     class KGuiItemPrivate;
00076     KGuiItemPrivate *d;
00077 };
00078 
00079 /* vim: et sw=4
00080  */
00081 
00082 #endif
00083 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:20:59 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001