1 /* -*- C++ -*- 2 SANE EPSON backend 3 Copyright (C) 2003 SEIKO EPSON Corporation 4 5 Date Author Reason 6 2003-03-13 S.Wong New 7 8 This file is part of the `iscan' program. 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 General Public License for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 24 As a special exception, the copyright holders give permission 25 to link the code of this program with the esmod library and 26 distribute linked combinations including the two. You must obey 27 the GNU General Public License in all respects for all of the 28 code used other then esmod. 29 */ 30 31 #ifndef ___PISA_SCAN_SELECTOR_H 32 #define ___PISA_SCAN_SELECTOR_H 33 34 #include <gtk/gtk.h> 35 #include <regex.h> 36 37 class scan_selector 38 { 39 public: 40 ~scan_selector(); 41 scan_selector( bool is_dialog = false ); 42 43 void show() const; 44 45 GtkWidget * widget() const; 46 47 void update(); 48 void cancel(); 49 void select(); 50 char * get_device( bool rewrite = false ); 51 52 private: 53 54 char * rewrite_name( const SANE_Device *device ); 55 void regerror( int code, regex_t *regex ); 56 57 bool m_local_only; 58 59 GtkWidget *m_dbox; 60 GtkWidget *m_hbox; 61 GtkWidget *m_opts; 62 GtkWidget *m_menu; 63 64 GSList *_items; 65 GSList *_dev_names; 66 GSList *_gui_names; 67 68 char *_current_dev; 69 char *_current_gui; 70 }; 71 72 #endif // ___PISA_SCAN_SELECTOR_H 73