Tulip  5.7.4
Large graphs analysis and drawing
ViewToolTipAndUrlManager.h
1 /*
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef VIEW_TOOLTIP_AND_URL_MANAGER_H
22 #define VIEW_TOOLTIP_AND_URL_MANAGER_H
23 
24 class QWidget;
25 
26 #include <QMenu>
27 
28 #include <tulip/View.h>
29 #include <tulip/DataSet.h>
30 
31 namespace tlp {
32 class StringProperty;
33 
34 class TLP_QT_SCOPE ViewToolTipAndUrlManager : public QObject {
35  Q_OBJECT
36 
37  View *_view;
38  QWidget *_widget;
39  std::string _url, _contextMenuUrl;
40 
41 public:
42  ViewToolTipAndUrlManager(tlp::View *view, QWidget *widget);
43 
44  // the functions below must be called by the associated view
45  // when overloading the View class corresponding methods
46  void setState(const tlp::DataSet &);
47  void state(tlp::DataSet &) const;
48  void fillContextMenu(QMenu *menu);
49  void fillContextMenu(QMenu *menu, node n);
50  void fillContextMenu(QMenu *menu, edge e);
51 
52 protected slots:
53  void manageToolTips();
54  void openUrl();
55  void viewGraphSet(tlp::Graph *);
56 
57 protected:
58  bool eventFilter(QObject *, QEvent *e) override;
59  StringProperty *getAttributeProperty(const std::string &attribute);
60 };
61 } // namespace tlp
62 
63 #endif /* VIEW_TOOLTIP_AND_URL_MANAGER_H */
64 
65 ///@endcond
A container that can store data from any type.
Definition: DataSet.h:195
View plugins provide a way to dynamically add to a Tulip plateform various ways to visualize a graph.
Definition: View.h:95