retriever_config_plugin.h

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 #include <libglademm/xml.h>
00030 
00031 #include <string>
00032 
00033 class RetrieverConfigDialog : public Gtk::Dialog
00034 {
00035  public:
00036   RetrieverConfigDialog( BaseObjectType* cobject,
00037                          const Glib::RefPtr< Gnome::Glade::Xml >& ref_xml );
00038   virtual ~RetrieverConfigDialog();
00039 
00040   void add_camera( std::string camera_name,
00041                    std::string camera_string,
00042                    bool record_images = false,
00043                    std::string save_path = "" );
00044 
00045   std::map< std::string, std::string > get_cameras() const;
00046 
00047  private:
00048   class CameraRecord : public Gtk::TreeModelColumnRecord
00049   {
00050   public:
00051     CameraRecord()
00052     {
00053       add( name );
00054       add( type );
00055       add( id );
00056       add( params );
00057       add( record_images );
00058       add( save_path );
00059     }
00060     
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   };
00068 
00069   // signal handler
00070   void on_add_clicked();
00071   void on_delete_clicked();
00072 
00073   CameraRecord m_camera_record;
00074   Glib::RefPtr< Gtk::ListStore > m_camera_list;
00075   Gtk::TreeView* m_trv_cameras;
00076 
00077   Gtk::Button* m_btn_add_camera;
00078   Gtk::Button* m_btn_delete_camera;
00079 };
00080 
00081 class RetrieverConfigPlugin : public ConfigEditorPlugin
00082 {
00083  public:
00084   RetrieverConfigPlugin( std::string glade_path );
00085   virtual ~RetrieverConfigPlugin();
00086 
00087  protected:
00088   virtual void pre_run();
00089   virtual void post_run( int response );
00090 
00091   virtual Gtk::Dialog* load_dialog();
00092 
00093 };
00094 
00095 #endif /* __TOOLS_CONFIG_EDITOR_RETRIEVER_CONFIG_PLUGIN_H_ */

Generated on Tue Feb 22 13:32:32 2011 for Fawkes API by  doxygen 1.4.7