1 /* -------------------------------------------------------------
3 actions.h (part of The KDE Dictionary Client)
5 Copyright (C) 2000-2001 Christian Gebauer <gebauer@kde.org>
7 This file is distributed under the Artistic License.
8 See LICENSE for details.
10 -------------------------------------------------------------
12 DictComboAction, special KAction subclasses used
13 DictLabelAction, in the toolbar
16 ------------------------------------------------------------- */
21 #include <qguardedptr.h>
24 #include <kglobalsettings.h>
31 class DictComboAction
: public KAction
36 DictComboAction( const QString
& text
, QObject
* parent
,
37 const char* name
, bool editable
, bool autoSized
);
40 virtual int plug( QWidget
*w
, int index
= -1 );
41 virtual void unplug( QWidget
*w
);
46 QString
currentText() const;
48 void setEditText(const QString
&s
);
49 void setCurrentItem(int index
);
53 void setList(QStringList items
);
55 KGlobalSettings::Completion
completionMode();
56 void setCompletionMode(KGlobalSettings::Completion mode
);
60 void activated(const QString
&);
63 void slotComboActivated(int);
64 void slotComboActivated(const QString
&);
67 QGuardedPtr
<KComboBox
> m_combo
;
68 bool m_editable
, m_autoSized
;
69 KGlobalSettings::Completion m_compMode
;
73 class DictLabelAction
: public KAction
78 DictLabelAction( const QString
&text
, QObject
*parent
= 0, const char *name
= 0 );
81 virtual int plug( QWidget
*widget
, int index
= -1 );
82 virtual void unplug( QWidget
*widget
);
84 void setBuddy(QWidget
*buddy
);
87 QGuardedPtr
<QLabel
> m_label
;
92 class DictButtonAction
: public KAction
97 DictButtonAction( const QString
& text
, QObject
* receiver
,
98 const char* slot
, QObject
* parent
, const char* name
);
101 virtual int plug( QWidget
*w
, int index
= -1 );
102 virtual void unplug( QWidget
*w
);
105 void setWidth(int width
);
108 QGuardedPtr
<QPushButton
> m_button
;