libyui-qt-graph  2.42.7
 All Classes Functions
YQGraphPlugin.cc
1 /*
2  * Copyright (c) [2009-2012] Novell, Inc.
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact Novell, Inc.
17  *
18  * To contact Novell about this file by physical or electronic mail, you may
19  * find current contact information at www.novell.com.
20  */
21 
22 /*
23  * File: YQGraphPlugin.cc
24  * Author: Arvin Schnell <aschnell@suse.de>
25  */
26 
27 
28 #include "YQGraphPlugin.h"
29 #define YUILogComponent "qt-ui"
30 #include "YUILog.h"
31 #include "YQGraph.h"
32 #include "YUIException.h"
33 
34 #define PLUGIN_BASE_NAME "qt_graph"
35 
36 
38  : YGraphPlugin( PLUGIN_BASE_NAME )
39 {
40  if ( success() )
41  {
42  yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME
43  << " plugin successfully from " << pluginLibFullPath()
44  << std::endl;
45  }
46  else
47  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
48 }
49 
50 
52 {
53  // NOP
54 }
55 
56 
57 YQGraph *
58 YQGraphPlugin::createGraph( YWidget * parent, const std::string & filename,
59  const std::string & layoutAlgorithm )
60 {
61  if ( error() )
62  return 0;
63 
64  YQGraph * graph = new YQGraph( parent, filename, layoutAlgorithm );
65 
66  YUI_CHECK_NEW( graph );
67 
68  return graph;
69 }
virtual ~YQGraphPlugin()
virtual YQGraph * createGraph(YWidget *parent, const std::string &filename, const std::string &layoutAlgorithm)