summaryrefslogtreecommitdiffstats
path: root/kdict/matchview.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/matchview.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/matchview.h')
-rw-r--r--kdict/matchview.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/kdict/matchview.h b/kdict/matchview.h
new file mode 100644
index 00000000..f619820e
--- /dev/null
+++ b/kdict/matchview.h
@@ -0,0 +1,105 @@
+/* -------------------------------------------------------------
+
+ matchview.h (part of The KDE Dictionary Client)
+
+ Copyright (C) 2000-2001 Christian Gebauer <[email protected]>
+
+ This file is distributed under the Artistic License.
+ See LICENSE for details.
+
+ -------------------------------------------------------------
+
+ MatchView This widget contains the list of matching definitions
+
+ ------------------------------------------------------------- */
+
+
+#ifndef _MATCHVIEW_H_
+#define _MATCHVIEW_H_
+
+#include <qlistview.h>
+class KPopupMenu;
+
+
+//********* MatchViewItem ********************************************
+
+class MatchViewItem : public QListViewItem
+{
+
+public:
+
+ MatchViewItem(QListView *view,const QString &text);
+ MatchViewItem(QListView *view,QListViewItem *after,const QString &text);
+ MatchViewItem(QListViewItem *item,const QString &text,const QString &commandStr);
+ MatchViewItem(QListViewItem *item,QListViewItem *after,const QString &text,const QString &commandStr);
+ ~MatchViewItem();
+
+ void setOpen(bool o);
+ void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment);
+
+ QString command;
+ QStringList subEntrys;
+};
+
+
+//********* MatchView ******************************************
+
+
+class MatchView : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ MatchView(QWidget *parent=0,const char *name=0);
+ ~MatchView();
+
+ void updateStrategyCombo();
+ bool selectStrategy(const QString &strategy) const;
+ void match(const QString &query);
+
+signals:
+
+ void defineRequested(const QString &query);
+ void matchRequested(const QString &query);
+ void clipboardRequested();
+ void windowClosed();
+
+protected:
+
+ void closeEvent ( QCloseEvent * e );
+
+private slots:
+
+ void strategySelected(int num);
+ void enableGetButton();
+ void mouseButtonPressed(int, QListViewItem *, const QPoint &, int);
+ void returnPressed(QListViewItem *i);
+ void getOneItem(QListViewItem *i);
+ void getSelected();
+ void getAll();
+ void doGet(QStringList &defines);
+ void newList(const QStringList &matches);
+ void buildPopupMenu(QListViewItem *, const QPoint &, int);
+ void popupGetCurrent();
+ void popupDefineCurrent();
+ void popupMatchCurrent();
+ void popupDefineClip();
+ void popupMatchClip();
+ void expandList();
+ void collapseList();
+
+private:
+
+ QComboBox *w_strat;
+ QListView *w_list;
+ QPushButton *w_get,*w_getAll;
+
+ bool getOn, getAllOn;
+
+ KPopupMenu *rightBtnMenu;
+ MatchViewItem *popupCurrent;
+ QString popupClip; // needed for rightbtn-popup menu
+};
+
+#endif