Switch to unified view

a/src/qtgui/preview_w.h b/src/qtgui/preview_w.h
...
...
28
class QTabWidget;
28
class QTabWidget;
29
class QLabel;
29
class QLabel;
30
class QLineEdit;
30
class QLineEdit;
31
class QPushButton;
31
class QPushButton;
32
class QCheckBox;
32
class QCheckBox;
33
class QTextEditFixed;
33
class PreviewTextEdit;
34
class Preview;
34
35
35
#if (QT_VERSION < 0x040000)
36
#if (QT_VERSION < 0x040000)
36
#include <qtextedit.h>
37
#include <qtextedit.h>
37
#include <private/qrichtext_p.h>
38
#include <private/qrichtext_p.h>
38
#define QTEXTEDIT QTextEdit
39
#define QTEXTEDIT QTextEdit
40
class QPopupMenu;
41
#define RCLPOPUP QPopupMenu
39
#else
42
#else
40
#include <q3textedit.h>
43
#include <q3textedit.h>
41
#include <q3richtext_p.h>
44
#include <q3richtext_p.h>
45
class Q3PopupMenu;
46
#define RCLPOPUP Q3PopupMenu
42
#define QTEXTEDIT Q3TextEdit
47
#define QTEXTEDIT Q3TextEdit
43
#endif
48
#endif
44
49
45
class QTextEditFixed : public QTEXTEDIT {
50
class PreviewTextEdit : public QTEXTEDIT {
46
    Q_OBJECT
51
    Q_OBJECT
47
public:
52
public:
48
    QTextEditFixed( QWidget* parent=0, const char* name=0 ) 
53
    PreviewTextEdit(QWidget* parent, const char* name, Preview *pv) 
49
    : QTEXTEDIT(parent, name)
54
    : QTEXTEDIT(parent, name), m_preview(pv)
50
    {}
55
    {}
51
    void moveToAnchor(const QString& name);
56
    void moveToAnchor(const QString& name);
57
public slots:
58
    virtual void menuToggleFields();
59
private:
60
    virtual RCLPOPUP *createPopupMenu(const QPoint& pos);
61
    Preview *m_preview;
62
    QString  m_savedText;
52
};
63
};
53
64
54
65
55
// We keep a list of data associated to each tab
66
// We keep a list of data associated to each tab
56
class TabData {
67
class TabData {
57
 public:
68
 public:
58
    string fn; // filename for this tab
69
    string fn; // filename for this tab
59
    string ipath; // Internal doc path inside file
70
    string ipath; // Internal doc path inside file
60
    QWidget *w; // widget for setCurrent
71
    QWidget *w; // widget for setCurrent
61
    int docnum;  // Index of doc in db search results.
72
    int docnum;  // Index of doc in db search results.
62
73
    // doc out of internfile (previous fields come from the index) with
74
    // main text erased (for space).
75
    Rcl::Doc fdoc; 
63
    TabData(QWidget *wi) 
76
    TabData(QWidget *wi) 
64
    : w(wi), docnum(-1) 
77
    : w(wi), docnum(-1) 
65
    {}
78
    {}
66
};
79
};
67
80
...
...
114
    virtual void closeEvent(QCloseEvent *e );
127
    virtual void closeEvent(QCloseEvent *e );
115
    virtual bool eventFilter(QObject *target, QEvent *event );
128
    virtual bool eventFilter(QObject *target, QEvent *event );
116
    virtual bool makeDocCurrent(const string &fn, size_t sz, 
129
    virtual bool makeDocCurrent(const string &fn, size_t sz, 
117
                const Rcl::Doc& idoc, int docnum, 
130
                const Rcl::Doc& idoc, int docnum, 
118
                bool sametab = false);
131
                bool sametab = false);
119
132
    friend class PreviewTextEdit;
120
public slots:
133
public slots:
121
    virtual void searchTextLine_textChanged(const QString& text);
134
    virtual void searchTextLine_textChanged(const QString& text);
122
    virtual void doSearch(const QString& str, bool next, bool reverse,
135
    virtual void doSearch(const QString& str, bool next, bool reverse,
123
              bool wo = false);
136
              bool wo = false);
124
    virtual void nextPressed();
137
    virtual void nextPressed();
...
...
162
    QCheckBox* matchCheck;
175
    QCheckBox* matchCheck;
163
176
164
    void init();
177
    void init();
165
    virtual void setCurTabProps(const string& fn, const Rcl::Doc& doc, 
178
    virtual void setCurTabProps(const string& fn, const Rcl::Doc& doc, 
166
                int docnum);
179
                int docnum);
167
    virtual QTextEditFixed *getCurrentEditor();
180
    virtual PreviewTextEdit *getCurrentEditor();
168
    virtual QTextEditFixed *addEditorTab();
181
    virtual PreviewTextEdit *addEditorTab();
169
    virtual bool loadFileInCurrentTab(string fn, size_t sz, 
182
    virtual bool loadFileInCurrentTab(string fn, size_t sz, 
170
                      const Rcl::Doc& idoc, int dnm);
183
                      const Rcl::Doc& idoc, int dnm);
171
    TabData *tabDataForCurrent(); // Return auxiliary data pointer for cur tab
184
    // Return auxiliary data pointer for cur tab
185
    TabData *tabDataForCurrent(); 
172
};
186
};
173
187
174
#endif /* _PREVIEW_W_H_INCLUDED_ */
188
#endif /* _PREVIEW_W_H_INCLUDED_ */