BibleTime
cmoduleresultview.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-2021 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 <QTreeWidget>
16 
17 #include <QHash>
18 #include <QObject>
19 #include <QSize>
20 #include <QString>
21 #include <QStringList>
22 #include "../../backend/cswordmodulesearch.h"
23 #include "btsearchresultarea.h"
24 
25 
26 class CSwordModuleInfo;
27 class QAction;
28 class QContextMenuEvent;
29 class QMenu;
30 class QWidget;
31 
32 namespace Search {
33 
34 class StrongsResultList;
35 
37  Q_OBJECT
38  public:
39  CModuleResultView(QWidget* parent);
40  ~CModuleResultView() override;
41 
42  /**
43  Setups the tree using the given list of modules.
44  */
45  void setupTree(const CSwordModuleSearch::Results &results,
46  const QString &searchedText);
47 
48  /**
49  * Returns the currently active module.
50  */
52 
53  QSize sizeHint() const override {
54  return m_size;
55  }
56 
57  protected:
58  /**
59  * Initializes this widget.
60  */
61  void initView();
62  /**
63  * Initializes the connections of this widget
64  */
65  void initConnections();
66 
67  protected Q_SLOTS:
68  /**
69  * Is executed when an item was selected in the list.
70  */
71  void executed(QTreeWidgetItem*, QTreeWidgetItem*);
72  /**
73  * This event handler (reimplemented from QWidget) opens the popup menu at the given position.
74  */
75  void contextMenuEvent( QContextMenuEvent * event ) override;
76 
77  Q_SIGNALS:
80  void moduleChanged();
81  void strongsSelected(CSwordModuleInfo*, const QStringList&);
82 
83  private:
84  struct {
86  struct {
89  }
91 
93  struct {
94  QAction* result;
95  }
97 
99  struct {
100  QAction* result;
102  }
104 
106 
108 
112  QSize m_size;
113 };
114 
115 
116 } //end of namespace Search
CSwordModuleInfo * activeModule()
CModuleResultView(QWidget *parent)
struct Search::CModuleResultView::@9::@10 save
QSize sizeHint() const override
void strongsSelected(CSwordModuleInfo *, const QStringList &)
void setupTree(const CSwordModuleSearch::Results &results, const QString &searchedText)
struct Search::CModuleResultView::@9 m_actions
struct Search::CModuleResultView::@9::@11 print
QHash< CSwordModuleInfo const *, CSwordModuleSearch::ModuleResultList > m_results
struct Search::CModuleResultView::@9::@12 copy
void contextMenuEvent(QContextMenuEvent *event) override
QHash< CSwordModuleInfo const *, QList< StrongsResult > > m_strongsResults
void executed(QTreeWidgetItem *, QTreeWidgetItem *)
void moduleSelected(CSwordModuleInfo const *, CSwordModuleSearch::ModuleResultList const &)
std::vector< std::shared_ptr< sword::SWKey const > > ModuleResultList
std::vector< ModuleSearchResult > Results