1/* 2 * gui.h 3 * 4 * $Id: gui.h,v 1.9 2006/12/21 11:23:43 source Exp $ 5 * 6 * The iODBC driver manager. 7 * 8 * Copyright (C) 1996-2006 by OpenLink Software <iodbc@openlinksw.com> 9 * All Rights Reserved. 10 * 11 * This software is released under the terms of either of the following 12 * licenses: 13 * 14 * - GNU Library General Public License (see LICENSE.LGPL) 15 * - The BSD License (see LICENSE.BSD). 16 * 17 * Note that the only valid version of the LGPL license as far as this 18 * project is concerned is the original GNU Library General Public License 19 * Version 2, dated June 1991. 20 * 21 * While not mandated by the BSD license, any patches you make to the 22 * iODBC source code may be contributed back into the iODBC project 23 * at your discretion. Contributions will benefit the Open Source and 24 * Data Access community as a whole. Submissions may be made at: 25 * 26 * http://www.iodbc.org 27 * 28 * 29 * GNU Library Generic Public License Version 2 30 * ============================================ 31 * This library is free software; you can redistribute it and/or 32 * modify it under the terms of the GNU Library General Public 33 * License as published by the Free Software Foundation; only 34 * Version 2 of the License dated June 1991. 35 * 36 * This library is distributed in the hope that it will be useful, 37 * but WITHOUT ANY WARRANTY; without even the implied warranty of 38 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 39 * Library General Public License for more details. 40 * 41 * You should have received a copy of the GNU Library General Public 42 * License along with this library; if not, write to the Free 43 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 44 * 45 * 46 * The BSD License 47 * =============== 48 * Redistribution and use in source and binary forms, with or without 49 * modification, are permitted provided that the following conditions 50 * are met: 51 * 52 * 1. Redistributions of source code must retain the above copyright 53 * notice, this list of conditions and the following disclaimer. 54 * 2. Redistributions in binary form must reproduce the above copyright 55 * notice, this list of conditions and the following disclaimer in 56 * the documentation and/or other materials provided with the 57 * distribution. 58 * 3. Neither the name of OpenLink Software Inc. nor the names of its 59 * contributors may be used to endorse or promote products derived 60 * from this software without specific prior written permission. 61 * 62 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 63 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 64 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 65 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR 66 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 67 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 68 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 69 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 70 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 71 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 72 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 73 */ 74 75#include <iodbc.h> 76#include <odbcinst.h> 77#include <gtk/gtk.h> 78#include <unicode.h> 79 80#ifndef _GTKGUI_H 81#define _GTKGUI_H 82 83extern char* szDSNColumnNames[]; 84extern char* szTabNames[]; 85extern char* szDSNButtons[]; 86extern char* szDriverColumnNames[]; 87 88 89typedef struct TFILEDSN 90{ 91 GtkWidget *name_entry, *mainwnd; 92 char *name; 93} TFILEDSN; 94 95typedef struct TDSNCHOOSER 96{ 97 GtkWidget *mainwnd, *udsnlist, *sdsnlist; 98 GtkWidget *uadd, *uremove, *utest, *uconfigure; 99 GtkWidget *sadd, *sremove, *stest, *sconfigure; 100 GtkWidget *fadd, *fremove, *ftest, *fconfigure, *fsetdir; 101 GtkWidget *dir_list, *file_list, *file_entry, *dir_combo; 102 wchar_t *dsn; 103 wchar_t *fdsn; 104 char curr_dir[1024]; 105 int type_dsn; 106} TDSNCHOOSER; 107 108typedef struct TDRIVERCHOOSER 109{ 110 GtkWidget *driverlist, *mainwnd, *b_add, *b_remove, *b_configure, *b_finish; 111 wchar_t *driver; 112} TDRIVERCHOOSER; 113 114typedef struct TFDRIVERCHOOSER 115{ 116 GtkWidget *driverlist, *mainwnd; 117 GtkWidget *dsn_entry, *b_back, *b_continue; 118 GtkWidget *mess_entry, *tab_panel, *browse_sel; 119 char *curr_dir; 120 char *attrs; 121 char *dsn; 122 BOOL verify_conn; 123 wchar_t *driver; 124 BOOL ok; 125} TFDRIVERCHOOSER; 126 127typedef struct TCONNECTIONPOOLING 128{ 129 GtkWidget *driverlist, *mainwnd, *enperfmon_rb, *disperfmon_rb, 130 *retwait_entry, *timeout_entry, *probe_entry; 131 BOOL changed; 132 char timeout[64]; 133 char probe[512]; 134} TCONNECTIONPOOLING; 135 136typedef struct TTRANSLATORCHOOSER 137{ 138 GtkWidget *translatorlist, *mainwnd, *b_finish; 139 wchar_t *translator; 140} TTRANSLATORCHOOSER; 141 142typedef struct TCOMPONENT 143{ 144 GtkWidget *componentlist; 145} TCOMPONENT; 146 147typedef struct TTRACING 148{ 149 GtkWidget *logfile_entry, *tracelib_entry, *b_start_stop; 150 GtkWidget *donttrace_rb, *allthetime_rb, *onetime_rb; 151 GtkWidget *filesel; 152 BOOL changed; 153} TTRACING; 154 155typedef struct TCONFIRM 156{ 157 GtkWidget *mainwnd; 158 BOOL yes_no; 159} TCONFIRM; 160 161typedef struct TDRIVERSETUP 162{ 163 GtkWidget *name_entry, *driver_entry, *setup_entry, *key_list, *bupdate; 164 GtkWidget *key_entry, *value_entry; 165 GtkWidget *mainwnd, *filesel; 166 LPSTR connstr; 167} TDRIVERSETUP; 168 169 170typedef struct TGENSETUP 171{ 172 GtkWidget *dsn_entry, *key_list, *bupdate; 173 GtkWidget *key_entry, *value_entry; 174 GtkWidget *mainwnd; 175 GtkWidget *verify_conn_cb; 176 LPSTR connstr; 177 BOOL verify_conn; 178} TGENSETUP; 179 180 181 182void adddsns_to_list(GtkWidget* widget, BOOL systemDSN); 183void userdsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 184void userdsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 185void userdsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 186void userdsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 187void systemdsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 188void systemdsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 189void systemdsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 190void systemdsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 191void filedsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 192void filedsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 193void filedsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 194void filedsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 195void filedsn_setdir_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t); 196void userdsn_list_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 197void userdsn_list_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 198void systemdsn_list_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 199void systemdsn_list_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 200void filedsn_filelist_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 201void filedsn_filelist_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 202void filedsn_dirlist_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t); 203void filedsn_lookin_clicked(GtkWidget* widget, void **array); 204void adddrivers_to_list(GtkWidget* widget, GtkWidget* dlg); 205void addtranslators_to_list(GtkWidget* widget, GtkWidget* dlg); 206void adddirectories_to_list(HWND hwnd, GtkWidget* widget, LPCSTR path); 207void addfiles_to_list(HWND hwnd, GtkWidget* widget, LPCSTR path); 208void addlistofdir_to_optionmenu(GtkWidget* widget, LPCSTR path, TDSNCHOOSER *choose_t); 209LPSTR create_keyval (HWND wnd, LPCSTR attrs, BOOL *verify_conn); 210LPSTR create_fgensetup (HWND hwnd, LPCSTR dsn, LPCSTR attrs, BOOL add, BOOL *verify_conn); 211 212#endif 213