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 class NetworkCamera;
00037 class FuseImageListWidget;
00038 class ImageWidget;
00039
00040 namespace fawkes {
00041   class AvahiDispatcher;
00042 }
00043
00044 class FuseViewerGtkWindow : public Gtk::Window
00045 {
00046 public:
00047   FuseViewerGtkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> ref_xml);
00048   virtual ~FuseViewerGtkWindow();
00049
00050 private:
00051   void on_service_added(fawkes::NetworkService* service);
00052   void on_service_removed(fawkes::NetworkService* service);
00053
00054   void on_fuse_image_selected();
00055   void on_auto_save_cbt_change();
00056   void on_save_type_change();
00057   void on_save_image_clicked();
00058
00059   void close_image();
00060   void set_status(std::string img_id, std::string host = "", unsigned short port = 0);
00061
00062 private:
00063   // widgets
00064   Gtk::ScrolledWindow     *__image_list_scroll;
00065   Gtk::Viewport           *__image_viewport;
00066   Gtk::AspectFrame        *__save_box;
00067   Gtk::ComboBoxText       *__save_type;
00068   Gtk::FileChooserButton  *__save_filechooser;
00069   Gtk::CheckButton        *__auto_save;
00070   Gtk::Button             *__save_btn;
00071   Gtk::Statusbar          *__statusbar;
00072
00073   fawkes::AvahiThread     *__avahi_thread;
00074   fawkes::AvahiDispatcher *__avahi_dispatcher;
00075
00076   FuseImageListWidget     *__img_list_widget;
00077
00078   ImageWidget             *__img_widget;
00079   NetworkCamera           *__cam;
00080
00081
00082   std::map<std::string, std::string> __host_service_map;
00083
00084   std::string    __cur_service_name;
00085   unsigned int   __img_num;
00086 };
00087
00088 #endif /* __FIREVISION_TOOLS_LOC_VIEWER_LOC_VIEWER_GUI_H_ */