libyui
 
Loading...
Searching...
No Matches
YGraph.h
1/*
2 Copyright (C) 2000-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/*-/
18
19 File: YGraph.h
20
21 Author: Arvin Schnell <aschnell@suse.de>
22
23/-*/
24
25#ifndef YGraph_h
26#define YGraph_h
27
28#include "YWidget.h"
29
30/*
31 * Do not include graphviz/types.h here since it conflicts with ncurses
32 * headers. People should finally start to use C++ and namespaces!
33 *
34 * The previous workaround of inserting the graph_t definition here does not
35 * work with graphviz >= 2.30.0 since it depends on the define WITH_CGRAPH.
36 *
37 * For that reason a lot of functions simply take a void* instead of graph_t*.
38 */
39
40class YGraphPrivate;
41
45class YGraph : public YWidget
46{
47protected:
48
57 YGraph( YWidget * parent, const std::string & filename, const std::string & layoutAlgorithm );
58
64 YGraph( YWidget * parent, /* graph_t */ void * graph );
65
66public:
67
71 virtual ~YGraph();
72
77 virtual const char * widgetClass() const { return "YGraph"; }
78
89 virtual bool setProperty( const std::string & propertyName,
90 const YPropertyValue & val );
91
98 virtual YPropertyValue getProperty( const std::string & propertyName );
99
106 virtual const YPropertySet & propertySet();
107
111 std::string filename() const;
112
119 virtual void setFilename( const std::string & filename );
120
124 std::string layoutAlgorithm() const;
125
131 virtual void setLayoutAlgorithm( const std::string & filename );
132
138 virtual void setGraph( /* graph_t */ void * graph );
139
144 virtual std::string activatedNode() const;
145
146protected:
147
152 virtual void renderGraph( const std::string & filename, const std::string & layoutAlgorithm ) = 0;
153
157 virtual void renderGraph( /* graph_t */ void * graph ) = 0;
158
159private:
160
162
163};
164
165
166#endif // YGraph_h
Definition ImplPtr.h:43
virtual void renderGraph(void *graph)=0
virtual void setFilename(const std::string &filename)
Definition YGraph.cc:78
YGraph(YWidget *parent, const std::string &filename, const std::string &layoutAlgorithm)
virtual void setGraph(void *graph)
Definition YGraph.cc:93
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YGraph.cc:137
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YGraph.cc:153
std::string filename() const
Definition YGraph.cc:71
virtual const YPropertySet & propertySet()
Definition YGraph.cc:115
virtual std::string activatedNode() const
Definition YGraph.cc:108
virtual ~YGraph()
Definition YGraph.cc:64
virtual void renderGraph(const std::string &filename, const std::string &layoutAlgorithm)=0
virtual void setLayoutAlgorithm(const std::string &filename)
Definition YGraph.cc:101
virtual const char * widgetClass() const
Definition YGraph.h:77
std::string layoutAlgorithm() const
Definition YGraph.cc:86
Definition YProperty.h:198
Definition YProperty.h:105
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YGraph.cc:35