~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

Viewing changes to src/frontend/searchdialog/analysis/csearchanalysisscene.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden
  • Date: 2009-11-18 17:30:00 UTC
  • mfrom: (1.3.4 upstream) (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091118173000-endkhjz5qai88tvr
Tags: 2.4-1
* New upstream version 2.4
* debian/control: 
  - Replace incorrect bibletime-data Depends on lib4qt-gui
    with bibletime Depends on libqtgui4 (>= 4.4.0). (Closes: #556209).
  - Add Build-depends: on zlib1g-dev and libcurl4-gnutls-dev 
    (Closes: #556805).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#ifndef SEARCHCSEARCHANALYSISSCENE_H
11
11
#define SEARCHCSEARCHANALYSISSCENE_H
12
12
 
13
 
#include "csearchanalysisitem.h"
14
 
 
15
 
class CSwordModuleInfo;
16
 
 
17
 
 
18
13
#include <QGraphicsScene>
 
14
 
19
15
#include <QColor>
 
16
#include <QHash>
20
17
#include <QMap>
21
 
#include <QHash>
 
18
#include "frontend/searchdialog/analysis/csearchanalysisitem.h"
 
19
 
 
20
 
 
21
class CSwordModuleInfo;
22
22
 
23
23
namespace Search {
24
24
 
25
25
class CSearchAnalysisLegendItem;
26
26
 
27
27
/**
28
 
        @author The BibleTime team <info@bibletime.info>
 
28
    @author The BibleTime team <info@bibletime.info>
29
29
*/
30
30
class CSearchAnalysisScene : public QGraphicsScene {
31
 
        Q_OBJECT
32
 
public:
33
 
    CSearchAnalysisScene(QObject* parent);
34
 
 
35
 
    virtual ~CSearchAnalysisScene() {}
36
 
 
37
 
        /**
38
 
        * Starts the analysis of the search result.
39
 
        * This should be called only once because
40
 
        * QCanvas handles the updates automatically.
41
 
        */
42
 
        void analyse(QList<CSwordModuleInfo*> modules);
43
 
        /**
44
 
        * This function returns a color for each module
45
 
        * @return The color at position index in the list
46
 
        */
47
 
        static QColor getColor(int index);
48
 
        /**
49
 
        * This function returns a pointer to the list of AnalysisItems
50
 
        */
51
 
        QHash<QString, CSearchAnalysisItem*>* getSearchAnalysisItemList();
52
 
        void reset();
53
 
        /**
54
 
         * resize the height of the scene
55
 
         */
56
 
        void resizeHeight(int height);
57
 
 
58
 
public slots:
59
 
        void saveAsHTML();
60
 
 
61
 
protected slots: // Protected slots
62
 
        /**
63
 
        * No descriptions
64
 
        */
65
 
        void slotResized();
66
 
 
67
 
protected:
68
 
        void setModules(QList<CSwordModuleInfo*> modules);
69
 
 
70
 
private:
71
 
        /**
72
 
        * Returns the count of the book in the module
73
 
        */
74
 
        unsigned int getCount( const QString book, CSwordModuleInfo* module );
75
 
 
76
 
        QList<CSwordModuleInfo*> m_moduleList;
77
 
        QHash<QString, CSearchAnalysisItem*> m_itemList;
78
 
        QMap<CSwordModuleInfo*,unsigned int> m_lastPosList;
79
 
        int m_maxCount;
80
 
        double m_scaleFactor;
81
 
        CSearchAnalysisLegendItem* m_legend;
82
 
 
83
 
 
 
31
        Q_OBJECT
 
32
    public:
 
33
        CSearchAnalysisScene(QObject* parent);
 
34
 
 
35
        virtual ~CSearchAnalysisScene() {}
 
36
 
 
37
        /**
 
38
        * Starts the analysis of the search result.
 
39
        * This should be called only once because
 
40
        * QCanvas handles the updates automatically.
 
41
        */
 
42
        void analyse(QList<CSwordModuleInfo*> modules);
 
43
        /**
 
44
        * This function returns a color for each module
 
45
        * @return The color at position index in the list
 
46
        */
 
47
        static QColor getColor(int index);
 
48
        /**
 
49
        * This function returns a pointer to the list of AnalysisItems
 
50
        */
 
51
        QHash<QString, CSearchAnalysisItem*>* getSearchAnalysisItemList();
 
52
        void reset();
 
53
        /**
 
54
         * resize the height of the scene
 
55
         */
 
56
        void resizeHeight(int height);
 
57
 
 
58
    public slots:
 
59
        void saveAsHTML();
 
60
 
 
61
    protected slots: // Protected slots
 
62
        /**
 
63
        * No descriptions
 
64
        */
 
65
        void slotResized();
 
66
 
 
67
    protected:
 
68
        void setModules(QList<CSwordModuleInfo*> modules);
 
69
 
 
70
    private:
 
71
        /**
 
72
        * Returns the count of the book in the module
 
73
        */
 
74
        unsigned int getCount( const QString book, CSwordModuleInfo* module );
 
75
 
 
76
        QList<CSwordModuleInfo*> m_moduleList;
 
77
        QHash<QString, CSearchAnalysisItem*> m_itemList;
 
78
        QMap<CSwordModuleInfo*, unsigned int> m_lastPosList;
 
79
        int m_maxCount;
 
80
        double m_scaleFactor;
 
81
        CSearchAnalysisLegendItem* m_legend;
84
82
};
85
83
 
86
84
}