1 /* -------------------------------------------------------------
3 matchview.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 MatchView This widget contains the list of matching definitions
14 ------------------------------------------------------------- */
20 #include <qlistview.h>
24 //********* MatchViewItem ********************************************
26 class MatchViewItem
: public QListViewItem
31 MatchViewItem(QListView
*view
,const QString
&text
);
32 MatchViewItem(QListView
*view
,QListViewItem
*after
,const QString
&text
);
33 MatchViewItem(QListViewItem
*item
,const QString
&text
,const QString
&commandStr
);
34 MatchViewItem(QListViewItem
*item
,QListViewItem
*after
,const QString
&text
,const QString
&commandStr
);
38 void paintCell(QPainter
*p
, const QColorGroup
&cg
, int column
, int width
, int alignment
);
41 QStringList subEntrys
;
45 //********* MatchView ******************************************
48 class MatchView
: public QWidget
54 MatchView(QWidget
*parent
=0,const char *name
=0);
57 void updateStrategyCombo();
58 bool selectStrategy(const QString
&strategy
) const;
59 void match(const QString
&query
);
63 void defineRequested(const QString
&query
);
64 void matchRequested(const QString
&query
);
65 void clipboardRequested();
70 void closeEvent ( QCloseEvent
* e
);
74 void strategySelected(int num
);
75 void enableGetButton();
76 void mouseButtonPressed(int, QListViewItem
*, const QPoint
&, int);
77 void returnPressed(QListViewItem
*i
);
78 void getOneItem(QListViewItem
*i
);
81 void doGet(QStringList
&defines
);
82 void newList(const QStringList
&matches
);
83 void buildPopupMenu(QListViewItem
*, const QPoint
&, int);
84 void popupGetCurrent();
85 void popupDefineCurrent();
86 void popupMatchCurrent();
87 void popupDefineClip();
88 void popupMatchClip();
96 QPushButton
*w_get
,*w_getAll
;
100 KPopupMenu
*rightBtnMenu
;
101 MatchViewItem
*popupCurrent
;
102 QString popupClip
; // needed for rightbtn-popup menu