Switch to unified view

a/src/qtgui/restable.h b/src/qtgui/restable.h
...
...
17
#ifndef _RESTABLE_H_INCLUDED_
17
#ifndef _RESTABLE_H_INCLUDED_
18
#define _RESTABLE_H_INCLUDED_
18
#define _RESTABLE_H_INCLUDED_
19
19
20
#include <Qt>
20
#include <Qt>
21
21
22
#include <string>
23
#include <map>
24
#include <vector>
25
22
#include "ui_restable.h"
26
#include "ui_restable.h"
23
#include "refcntr.h"
27
#include "refcntr.h"
24
#include "docseq.h"
28
#include "docseq.h"
25
#include "plaintorich.h"
29
#include "plaintorich.h"
26
30
27
class ResTable;
31
class ResTable;
28
32
29
typedef string (FieldGetter)(const string& fldname, const Rcl::Doc& doc);
33
typedef std::string (FieldGetter)(const std::string& fldname, const Rcl::Doc& doc);
30
34
31
class RecollModel : public QAbstractTableModel {
35
class RecollModel : public QAbstractTableModel {
32
36
33
    Q_OBJECT
37
    Q_OBJECT
34
38
...
...
47
    // Specific methods
51
    // Specific methods
48
    virtual void readDocSource();
52
    virtual void readDocSource();
49
    virtual void setDocSource(RefCntr<DocSequence> nsource);
53
    virtual void setDocSource(RefCntr<DocSequence> nsource);
50
    virtual RefCntr<DocSequence> getDocSource() {return m_source;}
54
    virtual RefCntr<DocSequence> getDocSource() {return m_source;}
51
    virtual void deleteColumn(int);
55
    virtual void deleteColumn(int);
52
    virtual const vector<string>& getFields() {return m_fields;}
56
    virtual const std::vector<std::string>& getFields() {return m_fields;}
53
    virtual const map<string, QString>& getAllFields() 
57
    virtual const std::map<std::string, QString>& getAllFields() 
54
    { 
58
    { 
55
    return o_displayableFields;
59
    return o_displayableFields;
56
    }
60
    }
57
    virtual void addColumn(int, const string&);
61
    virtual void addColumn(int, const std::string&);
58
    // Some column name are aliases/translator for base document field 
62
    // Some column name are aliases/translator for base document field 
59
    // (ie: date, datetime->mtime). Help deal with this:
63
    // (ie: date, datetime->mtime). Help deal with this:
60
    virtual string baseField(const string&);
64
    virtual std::string baseField(const std::string&);
61
65
62
    // Ignore sort() call because 
66
    // Ignore sort() call because 
63
    virtual void setIgnoreSort(bool onoff) {m_ignoreSort = onoff;}
67
    virtual void setIgnoreSort(bool onoff) {m_ignoreSort = onoff;}
64
68
65
    friend class ResTable;
69
    friend class ResTable;
...
...
67
signals:
71
signals:
68
    void sortDataChanged(DocSeqSortSpec);
72
    void sortDataChanged(DocSeqSortSpec);
69
73
70
private:
74
private:
71
    mutable RefCntr<DocSequence> m_source;
75
    mutable RefCntr<DocSequence> m_source;
72
    vector<string> m_fields;
76
    std::vector<std::string> m_fields;
73
    vector<FieldGetter*> m_getters;
77
    std::vector<FieldGetter*> m_getters;
74
    static map<string, QString> o_displayableFields;
78
    static std::map<std::string, QString> o_displayableFields;
75
    bool m_ignoreSort;
79
    bool m_ignoreSort;
76
    FieldGetter* chooseGetter(const string&);
80
    FieldGetter* chooseGetter(const std::string&);
77
    HiliteData m_hdata;
81
    HighlightData m_hdata;
78
};
82
};
79
83
80
class ResTable;
84
class ResTable;
81
85
82
// Modified textBrowser for the detail area
86
// Modified textBrowser for the detail area