00001 /***************************************************************************** 00002 * 00003 * cdebconf - An implementation of the Debian Configuration Management 00004 * System 00005 * 00006 * $Id$ 00007 * 00008 * cdebconf is (c) 2000-2007 Randolph Chung and others under the following 00009 * license. 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 00015 * 1. Redistributions of source code must retain the above copyright 00016 * notice, this list of conditions and the following disclaimer. 00017 * 00018 * 2. Redistributions in binary form must reproduce the above copyright 00019 * notice, this list of conditions and the following disclaimer in the 00020 * documentation and/or other materials provided with the distribution. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 00023 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00025 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00026 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00027 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00028 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00029 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00031 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00032 * SUCH DAMAGE. 00033 * 00034 *****************************************************************************/ 00035 00041 #ifndef _CHOICE_MODEL_H_ 00042 #define _CHOICE_MODEL_H_ 00043 00044 #include <stdarg.h> 00045 #include <gtk/gtk.h> 00046 00047 #include "frontend.h" 00048 #include "question.h" 00049 00050 GtkTreeModel * fe_gtk_choice_model_create(struct frontend * obj, 00051 struct question * question); 00052 00062 typedef gboolean (* parent_predicate)(int index, const char * choice, 00063 const char * translated_choice); 00064 00065 GtkTreeModel * fe_gtk_choice_model_create_full( 00066 struct frontend * obj, struct question * question, 00067 parent_predicate is_parent); 00068 00069 GtkTreePath * fe_gtk_choice_model_find_value(GtkTreeModel * model, 00070 const char * searched_value); 00071 00072 GtkTreePath * fe_gtk_choice_model_get_first_selected(GtkTreeModel * model); 00073 00074 guint fe_gtk_choice_model_get_length(GtkTreeModel * model); 00075 00076 void fe_gtk_choice_model_set(GtkTreeModel * model, GtkTreeIter * iter, ...); 00077 00080 enum { 00081 /* index of the choice */ 00082 CHOICE_MODEL_INDEX, 00083 /* has the choice been selected */ 00084 CHOICE_MODEL_SELECTED, 00085 /* canonical value of the choice */ 00086 CHOICE_MODEL_VALUE, 00087 /* translated value of the choice */ 00088 CHOICE_MODEL_TRANSLATED_VALUE, 00089 /* total number of columns in the model */ 00090 CHOICE_MODEL_COLUMN_COUNT 00091 }; 00092 00093 #endif /* !_CHOICE_MODEL_H_ */ 00094 00095 /* vim et sw=4 si 00096 */
1.5.1