Fawkes API  Fawkes Development Version
plugin_tree_view.h
1 
2 /***************************************************************************
3  * plugin_tree_view.h - Displays a list of Fawkes plugins and allows to
4  * start/stop them
5  *
6  * Created: Fri Sep 26 21:06:37 2008
7  * Copyright 2008 Daniel Beck
8  * 2008 Tim Niemueller [www.niemueller.de]
9  *
10  ****************************************************************************/
11 
12 /* This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL file in the doc directory.
23  */
24 
25 #ifndef _GUI_UTILS_PLUGIN_TREE_VIEW_H_
26 #define _GUI_UTILS_PLUGIN_TREE_VIEW_H_
27 
28 #include <core/utils/lock_queue.h>
29 #include <gui_utils/connection_dispatcher.h>
30 #include <netcomm/fawkes/client_handler.h>
31 
32 #include <gtkmm.h>
33 #ifdef HAVE_GCONFMM
34 # include <gconfmm.h>
35 #endif
36 
37 namespace fawkes {
38 
39 class FawkesNetworkClient;
40 class FawkesNetworkMessage;
41 
42 class PluginTreeView : public Gtk::TreeView
43 {
44 public:
46  PluginTreeView(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> builder);
47  virtual ~PluginTreeView();
48 
50  void set_gconf_prefix(Glib::ustring gconf_prefix);
51 
52 private:
53  class PluginRecord : public Gtk::TreeModelColumnRecord
54  {
55  public:
56  PluginRecord()
57  {
58  add(index);
59  add(name);
60  add(description);
61  add(loaded);
62  }
63 
64  Gtk::TreeModelColumn<int> index; /**< an index */
65  Gtk::TreeModelColumn<Glib::ustring> name; /**< the name of the plugin */
66  Gtk::TreeModelColumn<Glib::ustring> description; /**< description of the plugin */
67  Gtk::TreeModelColumn<bool> loaded; /**< the loaded status of the plugin */
68  };
69 
70  void ctor();
71  void on_status_toggled(const Glib::ustring &path);
72  void on_connected();
73  void on_disconnected();
74  void on_message_received(fawkes::FawkesNetworkMessage *msg);
75  void on_id_clicked();
76  void on_status_clicked();
77  void on_name_clicked();
78  void on_config_changed();
79 
80  void append_plugin_column();
81 
82 private:
83  Glib::RefPtr<Gtk::ListStore> m_plugin_list;
84 #ifdef HAVE_GCONFMM
85  Glib::RefPtr<Gnome::Conf::Client> gconf_;
86 #endif
87  PluginRecord m_plugin_record;
88 
89  sigc::connection gconf_connection_;
90  Glib::ustring gconf_prefix_;
91 
92  fawkes::ConnectionDispatcher m_dispatcher;
93 };
94 
95 } // end namespace fawkes
96 
97 #endif /* GUI_UTILS_PLUGIN_TREE_VIEW_H__ */
fawkes::PluginTreeView::PluginTreeView
PluginTreeView()
Constructor.
Definition: plugin_tree_view.cpp:61
fawkes::PluginTreeView::set_network_client
void set_network_client(fawkes::FawkesNetworkClient *client)
Set the network client.
Definition: plugin_tree_view.cpp:128
fawkes::PluginTreeView::set_gconf_prefix
void set_gconf_prefix(Glib::ustring gconf_prefix)
Set Gconf prefix.
Definition: plugin_tree_view.cpp:137
fawkes::PluginTreeView::~PluginTreeView
virtual ~PluginTreeView()
Destructor.
Definition: plugin_tree_view.cpp:106
fawkes::ConnectionDispatcher
Definition: connection_dispatcher.h:44
fawkes
fawkes::FawkesNetworkMessage
Definition: message.h:82
fawkes::FawkesNetworkClient
Definition: client.h:57