summaryrefslogtreecommitdiffstats
path: root/kdict/actions.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kdict/actions.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdict/actions.h')
-rw-r--r--kdict/actions.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/kdict/actions.h b/kdict/actions.h
new file mode 100644
index 00000000..568a9f7c
--- /dev/null
+++ b/kdict/actions.h
@@ -0,0 +1,111 @@
+/* -------------------------------------------------------------
+
+ actions.h (part of The KDE Dictionary Client)
+
+ Copyright (C) 2000-2001 Christian Gebauer <gebauer@kde.org>
+
+ This file is distributed under the Artistic License.
+ See LICENSE for details.
+
+ -------------------------------------------------------------
+
+ DictComboAction, special KAction subclasses used
+ DictLabelAction, in the toolbar
+ DictButtonAction
+
+ ------------------------------------------------------------- */
+
+#ifndef _ACTIONS_H_
+#define _ACTIONS_H_
+
+#include <qguardedptr.h>
+#include <qptrlist.h>
+#include <kaction.h>
+#include <kglobalsettings.h>
+
+class KComboBox;
+class QLabel;
+class QPushButton;
+
+
+class DictComboAction : public KAction
+{
+ Q_OBJECT
+
+ public:
+ DictComboAction( const QString& text, QObject* parent,
+ const char* name, bool editable, bool autoSized );
+ ~DictComboAction();
+
+ virtual int plug( QWidget *w, int index = -1 );
+ virtual void unplug( QWidget *w );
+
+ QWidget* widget();
+ void setFocus();
+
+ QString currentText() const;
+ void selectAll();
+ void setEditText(const QString &s);
+ void setCurrentItem(int index);
+ void clearEdit();
+
+ void clear();
+ void setList(QStringList items);
+
+ KGlobalSettings::Completion completionMode();
+ void setCompletionMode(KGlobalSettings::Completion mode);
+
+ signals:
+ void activated(int);
+ void activated(const QString&);
+
+ private slots:
+ void slotComboActivated(int);
+ void slotComboActivated(const QString&);
+
+ private:
+ QGuardedPtr<KComboBox> m_combo;
+ bool m_editable, m_autoSized;
+ KGlobalSettings::Completion m_compMode;
+};
+
+
+class DictLabelAction : public KAction
+{
+ Q_OBJECT
+
+ public:
+ DictLabelAction( const QString &text, QObject *parent = 0, const char *name = 0 );
+ ~DictLabelAction();
+
+ virtual int plug( QWidget *widget, int index = -1 );
+ virtual void unplug( QWidget *widget );
+
+ void setBuddy(QWidget *buddy);
+
+ private:
+ QGuardedPtr<QLabel> m_label;
+
+};
+
+
+class DictButtonAction : public KAction
+{
+ Q_OBJECT
+
+ public:
+ DictButtonAction( const QString& text, QObject* receiver,
+ const char* slot, QObject* parent, const char* name );
+ ~DictButtonAction();
+
+ virtual int plug( QWidget *w, int index = -1 );
+ virtual void unplug( QWidget *w );
+
+ int widthHint();
+ void setWidth(int width);
+
+ private:
+ QGuardedPtr<QPushButton> m_button;
+};
+
+#endif