Parent: [38604c] (diff)

Child: [ddb1bd] (diff)

Download this file

reslist.h    109 lines (90 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
#ifndef _RESLIST_H_INCLUDED_
#define _RESLIST_H_INCLUDED_
/* @(#$Id: reslist.h,v 1.8 2007-01-08 10:01:55 dockes Exp $ (C) 2005 J.F.Dockes */
#include <list>
#ifndef NO_NAMESPACES
using std::list;
#endif
#if (QT_VERSION < 0x040000)
#include <qtextbrowser.h>
class QPopupMenu;
#define RCLPOPUP QPopupMenu
#define QTEXTBROWSER QTextBrowser
#else
#include <q3textbrowser.h>
class Q3PopupMenu;
#define RCLPOPUP Q3PopupMenu
#define QTEXTBROWSER Q3TextBrowser
#endif
#include "rcldb.h"
#include "docseq.h"
#include "searchdata.h"
#include "refcntr.h"
class ResList : public QTEXTBROWSER
{
Q_OBJECT;
public:
ResList(QWidget* parent = 0, const char* name = 0);
virtual ~ResList();
// Return document for given docnum. We act as an intermediary to
// the docseq here. This has also the side-effect of making the
// entry current (visible and highlighted), and only work if the
// num is inside the current page or its immediate neighbours.
virtual bool getDoc(int docnum, Rcl::Doc &);
virtual void setDocSource(RefCntr<DocSequence> source,
RefCntr<Rcl::SearchData> qdata);
virtual RCLPOPUP *createPopupMenu(const QPoint& pos);
virtual QString getDescription(); // Printable actual query performed on db
virtual int getResCnt(); // Return total result list size
virtual RefCntr<Rcl::SearchData> getSearchData() {return m_searchData;}
public slots:
virtual void resetSearch();
virtual void clicked(int, int);
virtual void doubleClicked(int, int);
virtual void resPageUpOrBack(); // Page up pressed
virtual void resPageDownOrNext(); // Page down pressed
virtual void resultPageBack(); // Display previous page of results
virtual void resultPageNext(); // Display next (or first) page of results
virtual void menuPreview();
virtual void menuEdit();
virtual void menuCopyFN();
virtual void menuCopyURL();
virtual void menuExpand();
virtual void menuSeeParent();
virtual void previewExposed(int);
signals:
void nextPageAvailable(bool);
void prevPageAvailable(bool);
void docEditClicked(int);
void docPreviewClicked(int, int);
void previewRequested(Rcl::Doc);
void editRequested(Rcl::Doc);
void headerClicked();
void docExpand(int);
void wordSelect(QString);
void linkClicked(const QString&, int);
protected:
void keyPressEvent(QKeyEvent *e);
void contentsMouseReleaseEvent(QMouseEvent *e);
protected slots:
virtual void languageChange();
virtual void linkWasClicked(const QString &, int);
virtual void showQueryDetails();
private:
std::map<int,int> m_pageParaToReldocnums;
RefCntr<Rcl::SearchData> m_searchData;
RefCntr<DocSequence> m_docSource;
std::vector<Rcl::Doc> m_curDocs;
int m_winfirst;
int m_popDoc; // Docnum for the popup menu.
int m_curPvDoc;// Docnum for current preview
int m_lstClckMod; // Last click modifier.
list<int> m_selDocs;
virtual int docnumfromparnum(int);
virtual int parnumfromdocnum(int);
// Don't know why this is necessary but it is
void emitLinkClicked(const QString &s) {
emit linkClicked(s, m_lstClckMod);
};
};
#endif /* _RESLIST_H_INCLUDED_ */