1 /* 2 * dlgUsb.h - USB selection dialog 3 * 4 * Copyright (c) 2012-2015 David Galvez. ARAnyM development team (see AUTHORS). 5 * 6 * This file is part of the ARAnyM project which builds a new and powerful 7 * TOS/FreeMiNT compatible virtual machine running on almost any hardware. 8 * 9 * ARAnyM is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2 of the License, or 12 * (at your option) any later version. 13 * 14 * ARAnyM is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with ARAnyM; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 */ 23 24 #ifndef DLGUSB_H 25 #define DLGUSB_H 26 27 #define ENTRY_COUNT 9 /* (usb_description_8 - usb_description_0 + 1) */ 28 #define MAX_PRODUCT_LENGTH 32 29 30 31 #include "dialog.h" 32 #ifdef USBHOST_SUPPORT 33 #include "../natfeat/usbhost.h" 34 35 class DlgAlert; 36 #endif 37 38 class DlgUsb: public Dialog 39 { 40 private: 41 enum { 42 STATE_MAIN, 43 STATE_ALERT, 44 }; 45 int state; 46 int ypos; 47 bool refreshentries; 48 49 DlgAlert *dlgAlert; 50 51 void confirm(void); 52 void reset_buttons_and_state(void); 53 void clean_product_strings(void); 54 int check_if_devices_connected(void); 55 void enable_buttons(void); 56 void disable_buttons(void); 57 void refreshEntries(void); 58 59 public: 60 DlgUsb(SGOBJ *dlg); 61 ~DlgUsb(); 62 63 int processDialog(void); 64 }; 65 66 Dialog *DlgUsbOpen(void); 67 68 #endif /* DLGUSB_H */ 69