Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
retriever_config_plugin.h
1 
2 /***************************************************************************
3  * retriever_config_plugin.h - Config plugin for the retriever plugin
4  *
5  * Created: Sun Mar 29 13:56:53 2009
6  * Copyright 2009 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_
24 #define __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_
25 
26 #include "config_editor_plugin.h"
27 
28 #include <gtkmm.h>
29 
30 #include <string>
31 
32 class RetrieverConfigDialog : public Gtk::Dialog
33 {
34  public:
35  RetrieverConfigDialog(BaseObjectType* cobject,
36  const Glib::RefPtr<Gtk::Builder> &builder);
37  virtual ~RetrieverConfigDialog();
38 
39  void add_camera( std::string camera_name,
40  std::string camera_string,
41  bool record_images = false,
42  std::string save_path = "" );
43 
44  std::map< std::string, std::string > get_cameras() const;
45 
46  private:
47  class CameraRecord : public Gtk::TreeModelColumnRecord
48  {
49  public:
50  CameraRecord()
51  {
52  add( name );
53  add( type );
54  add( id );
55  add( params );
56  add( record_images );
57  add( save_path );
58  }
59 
60  /// @cond INTERNALS
61  Gtk::TreeModelColumn< Glib::ustring > name;
62  Gtk::TreeModelColumn< Glib::ustring > type;
63  Gtk::TreeModelColumn< Glib::ustring > id;
64  Gtk::TreeModelColumn< Glib::ustring > params;
65  Gtk::TreeModelColumn< bool > record_images;
66  Gtk::TreeModelColumn< Glib::ustring > save_path;
67  /// @endcond
68  };
69 
70  // signal handler
71  void on_add_clicked();
72  void on_delete_clicked();
73 
74  CameraRecord m_camera_record;
75  Glib::RefPtr< Gtk::ListStore > m_camera_list;
76  Gtk::TreeView* m_trv_cameras;
77 
78  Gtk::Button* m_btn_add_camera;
79  Gtk::Button* m_btn_delete_camera;
80 };
81 
83 {
84  public:
85  RetrieverConfigPlugin( std::string ui_path );
86  virtual ~RetrieverConfigPlugin();
87 
88  protected:
89  virtual void pre_run();
90  virtual void post_run( int response );
91 
92  virtual Gtk::Dialog* load_dialog();
93 
94 };
95 
96 #endif /* __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_ */