BibleTime
csearchanalysisscene.h
Go to the documentation of this file.
1/*********
2*
3* In the name of the Father, and of the Son, and of the Holy Spirit.
4*
5* This file is part of BibleTime's source code, https://bibletime.info/
6*
7* Copyright 1999-2025 by the BibleTime developers.
8* The BibleTime source code is licensed under the GNU General Public License
9* version 2.0.
10*
11**********/
12
13#pragma once
14
15#include <QGraphicsScene>
16
17#include <cstddef>
18#include <memory>
19#include <map>
20#include <QColor>
21#include "../../../backend/cswordmodulesearch.h"
22#include "csearchanalysisitem.h"
24
25
27class QTextStream;
28
29namespace Search {
30
32 Q_OBJECT
33 public:
34 CSearchAnalysisScene(QString searchedText,
35 CSwordModuleSearch::Results const & results,
36 QObject * parent);
37
38 /**
39 * This function returns a color for each module
40 * @return The color at position index in the list
41 */
42 static QColor getColor(int index);
43
44 /**
45 * resize the height of the scene
46 */
47 void resizeHeight(int height);
48
49 void saveAsHTML() const;
50
51 protected Q_SLOTS:
52 /**
53 * No descriptions
54 */
55 void slotResized();
56
57 private:
58
59 void saveAsHTML(QTextStream & out) const;
60
61 private:
62
63 QString const m_searchedText;
65 std::map<std::tuple<char, char>, CSearchAnalysisItem *> m_itemList;
66 std::size_t m_maxCount = 0;
67 std::unique_ptr<CSearchAnalysisLegendItem> m_legend;
68};
69
70}
std::unique_ptr< CSearchAnalysisLegendItem > m_legend
std::map< std::tuple< char, char >, CSearchAnalysisItem * > m_itemList
CSwordModuleSearch::Results m_results
static QColor getColor(int index)
std::vector< ModuleSearchResult > Results