1 /* 2 * 3 * Copyright (C) 2005-2018 by C.H. Huang 4 * plushuang.tw@gmail.com 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 * --- 21 * 22 * In addition, as a special exception, the copyright holders give 23 * permission to link the code of portions of this program with the 24 * OpenSSL library under certain conditions as described in each 25 * individual source file, and distribute linked combinations 26 * including the two. 27 * You must obey the GNU Lesser General Public License in all respects 28 * for all of the code used other than OpenSSL. If you modify 29 * file(s) with this exception, you may extend this exception to your 30 * version of the file(s), but you are not obligated to do so. If you 31 * do not wish to do so, delete this exception statement from your 32 * version. If you delete this exception statement from all source 33 * files in the program, then also delete it here. 34 * 35 */ 36 37 38 #ifndef UGTK_SETTING_FORM_H 39 #define UGTK_SETTING_FORM_H 40 41 #include <gtk/gtk.h> 42 #include <UgtkSetting.h> 43 44 #ifdef __cplusplus 45 extern "C" { 46 #endif 47 48 49 // ---------------------------------------------------------------------------- 50 // UgtkClipboardForm 51 struct UgtkClipboardForm 52 { 53 GtkWidget* self; 54 55 GtkWidget* pattern; // GtkTextView 56 GtkTextBuffer* buffer; 57 GtkToggleButton* monitor; 58 GtkToggleButton* quiet; 59 // add download to Nth category 60 GtkWidget* nth_label; 61 GtkSpinButton* nth_spin; 62 63 // Monitor media website address 64 GtkToggleButton* website; 65 }; 66 67 void ugtk_clipboard_form_init (struct UgtkClipboardForm* cbform); 68 void ugtk_clipboard_form_set (struct UgtkClipboardForm* cbform, UgtkSetting* setting); 69 void ugtk_clipboard_form_get (struct UgtkClipboardForm* cbform, UgtkSetting* setting); 70 71 // ---------------------------------------------------------------------------- 72 // UgtkUserInterfaceForm 73 struct UgtkUserInterfaceForm 74 { 75 GtkWidget* self; 76 77 GtkToggleButton* confirm_exit; 78 GtkToggleButton* confirm_delete; 79 GtkToggleButton* show_trayicon; 80 GtkToggleButton* start_in_tray; 81 GtkToggleButton* close_to_tray; 82 GtkToggleButton* start_in_offline_mode; 83 GtkToggleButton* start_notification; 84 GtkToggleButton* sound_notification; 85 GtkToggleButton* apply_recent; 86 GtkToggleButton* skip_existing; 87 GtkToggleButton* large_icon; 88 #ifdef HAVE_APP_INDICATOR 89 GtkToggleButton* app_indicator; 90 #endif 91 }; 92 93 void ugtk_user_interface_form_init (struct UgtkUserInterfaceForm* uiform); 94 void ugtk_user_interface_form_set (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting); 95 void ugtk_user_interface_form_get (struct UgtkUserInterfaceForm* uiform, UgtkSetting* setting); 96 97 // ---------------------------------------------------------------------------- 98 // UgtkBandwidthForm 99 100 struct UgtkBandwidthForm 101 { 102 GtkWidget* self; 103 104 GtkSpinButton* upload; 105 GtkSpinButton* download; 106 }; 107 108 void ugtk_bandwidth_form_init (struct UgtkBandwidthForm* bwform); 109 void ugtk_bandwidth_form_set (struct UgtkBandwidthForm* bwform, UgtkSetting* setting); 110 void ugtk_bandwidth_form_get (struct UgtkBandwidthForm* bwform, UgtkSetting* setting); 111 112 // ---------------------------------------------------------------------------- 113 // UgtkCompletionForm 114 struct UgtkCompletionForm 115 { 116 GtkWidget* self; 117 118 GtkEntry* command; 119 GtkEntry* on_error; 120 }; 121 122 void ugtk_completion_form_init (struct UgtkCompletionForm* csform); 123 void ugtk_completion_form_set (struct UgtkCompletionForm* csform, UgtkSetting* setting); 124 void ugtk_completion_form_get (struct UgtkCompletionForm* csform, UgtkSetting* setting); 125 126 // ---------------------------------------------------------------------------- 127 // UgtkAutoSaveForm 128 struct UgtkAutoSaveForm 129 { 130 GtkWidget* self; 131 132 // auto save and interval 133 GtkToggleButton* enable; 134 GtkWidget* interval_label; 135 GtkSpinButton* interval_spin; 136 GtkWidget* minutes_label; // minutes 137 }; 138 139 void ugtk_auto_save_form_init (struct UgtkAutoSaveForm* asform); 140 void ugtk_auto_save_form_set (struct UgtkAutoSaveForm* asform, UgtkSetting* setting); 141 void ugtk_auto_save_form_get (struct UgtkAutoSaveForm* asform, UgtkSetting* setting); 142 143 // ---------------------------------------------------------------------------- 144 // UgtkCommandlineForm 145 struct UgtkCommandlineForm 146 { 147 GtkWidget* self; 148 149 // --quiet 150 GtkToggleButton* quiet; 151 // --category-index 152 GtkWidget* index_label; 153 GtkSpinButton* index_spin; 154 }; 155 156 void ugtk_commandline_form_init (struct UgtkCommandlineForm* clform); 157 void ugtk_commandline_form_set (struct UgtkCommandlineForm* clform, UgtkSetting* setting); 158 void ugtk_commandline_form_get (struct UgtkCommandlineForm* clform, UgtkSetting* setting); 159 160 // ---------------------------------------------------------------------------- 161 // UgtkPluginForm 162 struct UgtkPluginForm 163 { 164 GtkWidget* self; 165 166 GtkComboBoxText* order; 167 168 // Aria2 options 169 GtkWidget* aria2_opts; 170 GtkToggleButton* launch; 171 GtkToggleButton* shutdown; 172 GtkEntry* uri; 173 GtkEntry* token; 174 GtkWidget* local; // GtkFrame 175 GtkEntry* path; 176 GtkWidget* args; // GtkTextView 177 GtkTextBuffer* args_buffer; 178 // Speed Limits for Aria2 179 GtkSpinButton* upload; // KiB/s 180 GtkSpinButton* download; // KiB/s 181 }; 182 183 void ugtk_plugin_form_init (struct UgtkPluginForm* psform); 184 void ugtk_plugin_form_set (struct UgtkPluginForm* psform, UgtkSetting* setting); 185 void ugtk_plugin_form_get (struct UgtkPluginForm* psform, UgtkSetting* setting); 186 187 // ---------------------------------------------------------------------------- 188 // UgtkMediaWebsiteForm 189 struct UgtkMediaWebsiteForm 190 { 191 GtkWidget* self; 192 193 GtkComboBoxText* match_mode; 194 GtkComboBoxText* quality; 195 GtkComboBoxText* type; 196 }; 197 198 void ugtk_media_website_form_init (struct UgtkMediaWebsiteForm* mwform); 199 void ugtk_media_website_form_set (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting); 200 void ugtk_media_website_form_get (struct UgtkMediaWebsiteForm* mwform, UgtkSetting* setting); 201 202 203 #ifdef __cplusplus 204 } 205 #endif 206 207 #endif // End of UGTK_SETTING_FORM_H 208