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 ------------------------------------------------------------- */
22 #include <q3ptrlist.h>
26 #include <kglobalsettings.h>
33 class DictComboAction
: public KAction
38 DictComboAction( const QString
& text
, QObject
* parent
,
39 const char* name
, bool editable
, bool autoSized
);
42 virtual int plug( QWidget
*w
, int index
= -1 );
43 virtual void unplug( QWidget
*w
);
48 QString
currentText() const;
50 void setEditText(const QString
&s
);
51 void setCurrentItem(int index
);
55 void setList(QStringList items
);
57 KGlobalSettings::Completion
completionMode();
58 void setCompletionMode(KGlobalSettings::Completion mode
);
62 void activated(const QString
&);
65 void slotComboActivated(int);
66 void slotComboActivated(const QString
&);
69 QPointer
<KComboBox
> m_combo
;
70 bool m_editable
, m_autoSized
;
71 KGlobalSettings::Completion m_compMode
;
75 class DictLabelAction
: public KAction
80 DictLabelAction( const QString
&text
, QObject
*parent
= 0, const char *name
= 0 );
83 virtual int plug( QWidget
*widget
, int index
= -1 );
84 virtual void unplug( QWidget
*widget
);
86 void setBuddy(QWidget
*buddy
);
89 QPointer
<QLabel
> m_label
;
94 class DictButtonAction
: public KAction
99 DictButtonAction( const QString
& text
, QObject
* receiver
,
100 const char* slot
, QObject
* parent
, const char* name
);
103 virtual int plug( QWidget
*w
, int index
= -1 );
104 virtual void unplug( QWidget
*w
);
107 void setWidth(int width
);
110 QPointer
<QPushButton
> m_button
;