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

kdeui

kguiitem.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, 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 
00038 class KDEUI_EXPORT KGuiItem
00039 {
00040 public:
00041     KGuiItem();
00042 
00043     // ### This should probably be explicit in KDE 4; it's easy to get
00044     // subtle bugs otherwise - the icon name, tooltip and whatsthis text
00045     // get changed behind your back if you do 'setButtonFoo( "Bar" );'
00046     // It gives the wrong impression that you just change the text.
00047     KGuiItem( const QString &text, 
00048               const QString &iconName  = QString::null,
00049               const QString &toolTip   = QString::null, 
00050               const QString &whatsThis = QString::null );
00051 
00052     KGuiItem( const QString &text, const QIconSet &iconSet, 
00053               const QString &toolTip   = QString::null, 
00054               const QString &whatsThis = QString::null );
00055 
00056     KGuiItem( const KGuiItem &rhs );
00057     KGuiItem &operator=( const KGuiItem &rhs );
00058 
00059     ~KGuiItem();
00060 
00061     QString text() const;
00062     QString plainText() const;
00063 #ifndef KDE_NO_COMPAT
00064     QIconSet iconSet( KIcon::Group, int size = 0, KInstance* instance = KGlobal::instance()) const;
00065     QIconSet iconSet() const { return iconSet( KIcon::Small ); }
00066 #else
00067     QIconSet iconSet( KIcon::Group=KIcon::Small, int size = 0, KInstance* instance = KGlobal::instance()) const;
00068 #endif
00069 
00070     QString iconName() const;
00071     QString toolTip() const;
00072     QString whatsThis() const;
00073     bool isEnabled() const;
00077     bool hasIcon() const;
00078 #ifndef KDE_NO_COMPAT
00079     bool hasIconSet() const { return hasIcon(); }
00080 #endif
00081 
00082     void setText( const QString &text );
00083     void setIconSet( const QIconSet &iconset );
00084     void setIconName( const QString &iconName );
00085     void setToolTip( const QString &tooltip );
00086     void setWhatsThis( const QString &whatsThis );
00087     void setEnabled( bool enable );
00088 
00089 private:
00090     class KGuiItemPrivate;
00091     KGuiItemPrivate *d;
00092 };
00093 
00094 /* vim: et sw=4
00095  */
00096 
00097 #endif
00098 

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