Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * retriever_config_plugin.h - Config plugin for the retriever plugin 00004 * 00005 * Created: Sun Mar 29 13:56:53 2009 00006 * Copyright 2009 Daniel Beck 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_ 00024 #define __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_ 00025 00026 #include "config_editor_plugin.h" 00027 00028 #include <gtkmm.h> 00029 00030 #include <string> 00031 00032 class RetrieverConfigDialog : public Gtk::Dialog 00033 { 00034 public: 00035 RetrieverConfigDialog(BaseObjectType* cobject, 00036 const Glib::RefPtr<Gtk::Builder> &builder); 00037 virtual ~RetrieverConfigDialog(); 00038 00039 void add_camera( std::string camera_name, 00040 std::string camera_string, 00041 bool record_images = false, 00042 std::string save_path = "" ); 00043 00044 std::map< std::string, std::string > get_cameras() const; 00045 00046 private: 00047 class CameraRecord : public Gtk::TreeModelColumnRecord 00048 { 00049 public: 00050 CameraRecord() 00051 { 00052 add( name ); 00053 add( type ); 00054 add( id ); 00055 add( params ); 00056 add( record_images ); 00057 add( save_path ); 00058 } 00059 00060 /// @cond INTERNALS 00061 Gtk::TreeModelColumn< Glib::ustring > name; 00062 Gtk::TreeModelColumn< Glib::ustring > type; 00063 Gtk::TreeModelColumn< Glib::ustring > id; 00064 Gtk::TreeModelColumn< Glib::ustring > params; 00065 Gtk::TreeModelColumn< bool > record_images; 00066 Gtk::TreeModelColumn< Glib::ustring > save_path; 00067 /// @endcond 00068 }; 00069 00070 // signal handler 00071 void on_add_clicked(); 00072 void on_delete_clicked(); 00073 00074 CameraRecord m_camera_record; 00075 Glib::RefPtr< Gtk::ListStore > m_camera_list; 00076 Gtk::TreeView* m_trv_cameras; 00077 00078 Gtk::Button* m_btn_add_camera; 00079 Gtk::Button* m_btn_delete_camera; 00080 }; 00081 00082 class RetrieverConfigPlugin : public ConfigEditorPlugin 00083 { 00084 public: 00085 RetrieverConfigPlugin( std::string ui_path ); 00086 virtual ~RetrieverConfigPlugin(); 00087 00088 protected: 00089 virtual void pre_run(); 00090 virtual void post_run( int response ); 00091 00092 virtual Gtk::Dialog* load_dialog(); 00093 00094 }; 00095 00096 #endif /* __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_ */