fuse_viewer_gui.h

00001 
00002 /***************************************************************************
00003  *  fuse_viewer.h - Fuse (network camera) Viewer Gui
00004  *
00005  *  Created: Thu Dec 18 14:16:23 2008
00006  *  Copyright  2008-2009  Christof Rath <c.rath@student.tugraz.at>
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 __FIREVISION_TOOLS_LOC_VIEWER_LOC_VIEWER_GUI_H_
00024 #define __FIREVISION_TOOLS_LOC_VIEWER_LOC_VIEWER_GUI_H_
00025 
00026 #define FUSE_PLUGIN_NAME      "fvfountain"
00027 #define FOUNTAIN_PORT_PATH    "/firevision/fountain/tcp_port"
00028 
00029 #include <netcomm/dns-sd/avahi_thread.h>
00030 
00031 #include <map>
00032 
00033 #include <gtkmm.h>
00034 #include <libglademm/xml.h>
00035 
00036 namespace firevision {
00037   class NetworkCamera;
00038   class FuseImageListWidget;
00039   class ImageWidget;
00040 }
00041 namespace fawkes {
00042   class AvahiDispatcher;
00043 }
00044 
00045 class FuseViewerGtkWindow : public Gtk::Window
00046 {
00047 public:
00048   FuseViewerGtkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> ref_xml);
00049   virtual ~FuseViewerGtkWindow();
00050 
00051 private:
00052   void on_service_added(fawkes::NetworkService* service);
00053   void on_service_removed(fawkes::NetworkService* service);
00054 
00055   void on_fuse_image_selected();
00056   void on_auto_save_cbt_change();
00057   void on_save_type_change();
00058   void on_save_image_clicked();
00059 
00060   void close_image();
00061   void set_status(std::string img_id, std::string host = "", unsigned short port = 0);
00062 
00063 private:
00064   // widgets
00065   Gtk::ScrolledWindow     *__image_list_scroll;
00066   Gtk::Viewport           *__image_viewport;
00067   Gtk::AspectFrame        *__save_box;
00068   Gtk::ComboBoxText       *__save_type;
00069   Gtk::FileChooserButton  *__save_filechooser;
00070   Gtk::CheckButton        *__auto_save;
00071   Gtk::Button             *__save_btn;
00072   Gtk::Statusbar          *__statusbar;
00073 
00074   fawkes::AvahiThread     *__avahi_thread;
00075   fawkes::AvahiDispatcher *__avahi_dispatcher;
00076 
00077   firevision::FuseImageListWidget     *__img_list_widget;
00078 
00079   firevision::ImageWidget             *__img_widget;
00080   firevision::NetworkCamera           *__cam;
00081 
00082 
00083   std::map<std::string, std::string> __host_service_map;
00084 
00085   std::string    __cur_service_name;
00086   unsigned int   __img_num;
00087 };
00088 
00089 #endif /* __FIREVISION_TOOLS_LOC_VIEWER_LOC_VIEWER_GUI_H_ */