Changeset View
Changeset View
Standalone View
Standalone View
app/resultsview.h
Show All 18 Lines | |||||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * | ||
20 | * USA * | 20 | * USA * | ||
21 | *****************************************************************************/ | 21 | *****************************************************************************/ | ||
22 | 22 | | |||
23 | #ifndef RESULTSVIEW_H | 23 | #ifndef RESULTSVIEW_H | ||
24 | #define RESULTSVIEW_H | 24 | #define RESULTSVIEW_H | ||
25 | 25 | | |||
26 | #include <QAction> | 26 | #include <QAction> | ||
27 | #include <KHTMLPart> | 27 | #include <QTextBrowser> | ||
28 | 28 | | |||
29 | #include "entry.h" | 29 | #include "entry.h" | ||
30 | 30 | | |||
31 | class KActionCollection; | 31 | class KActionCollection; | ||
32 | class KActionMenu; | 32 | class KActionMenu; | ||
33 | 33 | | |||
34 | class ResultsView : public KHTMLPart | 34 | class ResultsView : public QTextBrowser | ||
35 | { | 35 | { | ||
36 | Q_OBJECT | 36 | Q_OBJECT | ||
37 | 37 | | |||
38 | public: | 38 | public: | ||
39 | explicit ResultsView( QWidget *parent = nullptr, const char *name = nullptr ); | 39 | explicit ResultsView( QWidget *parent = nullptr, const char *name = nullptr ); | ||
40 | 40 | | |||
41 | void addResult( Entry *result, bool common = false ); | 41 | void addResult( Entry *result, bool common = false ); | ||
42 | void addKanjiResult( Entry*, bool common = false ); | 42 | void addKanjiResult( Entry*, bool common = false ); | ||
43 | void setLaterScrollValue( int scrollValue ); | 43 | void setLaterScrollValue( int scrollValue ); | ||
44 | 44 | | |||
45 | public slots: | 45 | public slots: | ||
46 | void append( const QString &text ); | 46 | void append( const QString &text ); | ||
47 | void clear(); | 47 | void clear(); | ||
48 | void flush(); | 48 | void flush(); | ||
49 | void print( const QString &title ); | 49 | void print( const QString &title ); | ||
50 | void setBasicMode( bool yes ); | 50 | void setBasicMode( bool yes ); | ||
51 | void setContents( const QString &text ); | 51 | void setContents( const QString &text ); | ||
52 | 52 | | |||
53 | signals: | 53 | signals: | ||
54 | void entrySpecifiedForExport( int index ); | 54 | void entrySpecifiedForExport( int index ); | ||
55 | void urlClicked( const QString& ); | 55 | void urlClicked( const QString& ); | ||
56 | 56 | | |||
57 | protected: | 57 | protected: | ||
58 | QString deLinkify( const DOM::Node &); | | |||
59 | QString generateCSS(); | 58 | QString generateCSS(); | ||
60 | bool urlSelected( const QString &url | | |||
61 | , int button | | |||
62 | , int state | | |||
63 | , const QString &_target | | |||
64 | , const KParts::OpenUrlArguments& args = KParts::OpenUrlArguments() | | |||
65 | , const KParts::BrowserArguments& browserArgs = KParts::BrowserArguments() ) override; | | |||
66 | 59 | | |||
67 | private slots: | 60 | private slots: | ||
68 | void doScroll(); | 61 | void doScroll(); | ||
69 | 62 | | |||
70 | private: | 63 | private: | ||
71 | QAction *_addToExportListAction = nullptr; | 64 | QAction *_addToExportListAction = nullptr; | ||
72 | bool _basicMode; | 65 | bool _basicMode; | ||
73 | KActionCollection *_popupActions = nullptr; | 66 | KActionCollection *_popupActions = nullptr; | ||
74 | KActionMenu *_popupMenu = nullptr; | 67 | KActionMenu *_popupMenu = nullptr; | ||
75 | QString _printText; | 68 | QString _printText; | ||
76 | int _scrollValue; | 69 | int _scrollValue; | ||
77 | }; | 70 | }; | ||
78 | 71 | | |||
79 | #endif | 72 | #endif |