Add general Xtraz notification support.
[kdenetwork.git] / kdict / actions.h
blob227f9fd547bed2acaef3064b34b88c2581c8a5d7
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
14 DictButtonAction
16 ------------------------------------------------------------- */
18 #ifndef _ACTIONS_H_
19 #define _ACTIONS_H_
21 #include <qpointer.h>
22 #include <q3ptrlist.h>
23 //Added by qt3to4:
24 #include <QLabel>
25 #include <kaction.h>
26 #include <kglobalsettings.h>
28 class KComboBox;
29 class QLabel;
30 class QPushButton;
33 class DictComboAction : public KAction
35 Q_OBJECT
37 public:
38 DictComboAction( const QString& text, QObject* parent,
39 const char* name, bool editable, bool autoSized );
40 ~DictComboAction();
42 virtual int plug( QWidget *w, int index = -1 );
43 virtual void unplug( QWidget *w );
45 QWidget* widget();
46 void setFocus();
48 QString currentText() const;
49 void selectAll();
50 void setEditText(const QString &s);
51 void setCurrentItem(int index);
52 void clearEdit();
54 void clear();
55 void setList(QStringList items);
57 KGlobalSettings::Completion completionMode();
58 void setCompletionMode(KGlobalSettings::Completion mode);
60 signals:
61 void activated(int);
62 void activated(const QString&);
64 private slots:
65 void slotComboActivated(int);
66 void slotComboActivated(const QString&);
68 private:
69 QPointer<KComboBox> m_combo;
70 bool m_editable, m_autoSized;
71 KGlobalSettings::Completion m_compMode;
75 class DictLabelAction : public KAction
77 Q_OBJECT
79 public:
80 DictLabelAction( const QString &text, QObject *parent = 0, const char *name = 0 );
81 ~DictLabelAction();
83 virtual int plug( QWidget *widget, int index = -1 );
84 virtual void unplug( QWidget *widget );
86 void setBuddy(QWidget *buddy);
88 private:
89 QPointer<QLabel> m_label;
94 class DictButtonAction : public KAction
96 Q_OBJECT
98 public:
99 DictButtonAction( const QString& text, QObject* receiver,
100 const char* slot, QObject* parent, const char* name );
101 ~DictButtonAction();
103 virtual int plug( QWidget *w, int index = -1 );
104 virtual void unplug( QWidget *w );
106 int widthHint();
107 void setWidth(int width);
109 private:
110 QPointer<QPushButton> m_button;
113 #endif