libyui-qt-graph
Loading...
Searching...
No Matches
YQGraph.h
1/*
2 * Copyright (C) 2009-2012 Novell, Inc
3 * This library is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU Lesser General Public License as
5 * published by the Free Software Foundation; either version 2.1 of the
6 * License, or (at your option) version 3.0 of the License. This library
7 * is distributed in the hope that it will be useful, but WITHOUT ANY
8 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 * License for more details. You should have received a copy of the GNU
11 * Lesser General Public License along with this library; if not, write
12 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 * Floor, Boston, MA 02110-1301 USA
14 */
15
16/*
17 * File: YQGraph.h
18 * Author: Arvin Schnell <aschnell@suse.de>
19 */
20
21
22#ifndef YQGraph_h
23#define YQGraph_h
24
25#include <yui/YGraph.h>
26
27#include "QY2Graph.h"
28
29
30class YQGraph : public QY2Graph, public YGraph
31{
32 Q_OBJECT
33
34public:
35
36 YQGraph(YWidget* parent, const std::string& filename, const std::string& layoutAlgorithm);
37
38 YQGraph(YWidget* parent, /* graph_t */ void* graph);
39
40 virtual ~YQGraph();
41
47 virtual int preferredWidth();
48
54 virtual int preferredHeight();
55
61 virtual void setSize(int newWidth, int newHeight);
62
63 void renderGraph(const std::string& filename, const std::string& layoutAlgorithm);
64
65 void renderGraph(/* graph_t */ void* graph);
66
67 std::string activatedNode() const { return lastActivatedNode; }
68
69private slots:
70
71 void backgroundContextMenu(QContextMenuEvent* event);
72 void nodeContextMenu(QContextMenuEvent* event, const QString& name);
73 void nodeDoubleClick(QMouseEvent* event, const QString& name);
74
75private:
76
77 void init();
78
79 std::string lastActivatedNode;
80
81};
82
83
84#endif // YQGraph_h
Definition QY2Graph.h:41
Definition YQGraph.h:31
virtual int preferredWidth()
Definition YQGraph.cc:89
virtual void setSize(int newWidth, int newHeight)
Definition YQGraph.cc:103
virtual int preferredHeight()
Definition YQGraph.cc:96