1
/* This file is part of the KDE libraries
2
Copyright (C) 2001 Holger Freyther (freyher@yahoo.com)
3
based on ideas from Martijn and Simon
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
19
Many thanks to Simon tronical Hausmann
28
#include <kicontheme.h>
33
* @short An abstract class for GUI data such as ToolTip and Icon.
35
* @author Holger Freyther <freyher@yahoo.com>
38
class KDEUI_EXPORT KGuiItem
43
// ### This should probably be explicit in KDE 4; it's easy to get
44
// subtle bugs otherwise - the icon name, tooltip and whatsthis text
45
// get changed behind your back if you do 'setButtonFoo( "Bar" );'
46
// It gives the wrong impression that you just change the text.
47
KGuiItem( const QString &text,
48
const QString &iconName = QString(),
49
const QString &toolTip = QString(),
50
const QString &whatsThis = QString() );
52
KGuiItem( const QString &text, const QIcon &iconSet,
53
const QString &toolTip = QString(),
54
const QString &whatsThis = QString() );
56
KGuiItem( const KGuiItem &rhs );
57
KGuiItem &operator=( const KGuiItem &rhs );
62
QString plainText() const;
64
QIcon iconSet( K3Icon::Group, int size = 0, KInstance* instance = KGlobal::instance()) const;
65
QIcon iconSet() const;
67
QIcon iconSet( K3Icon::Group=K3Icon::Small, int size = 0, KInstance* instance = KGlobal::instance()) const;
70
QString iconName() const;
71
QString toolTip() const;
72
QString whatsThis() const;
73
bool isEnabled() const;
76
bool hasIconSet() const { return hasIcon(); }
79
void setText( const QString &text );
80
void setIcon( const QIcon &iconset );
81
void setIconName( const QString &iconName );
82
void setToolTip( const QString &tooltip );
83
void setWhatsThis( const QString &whatsThis );
84
void setEnabled( bool enable );
87
class KGuiItemPrivate;