GnuCash 2.4.99
gnc-general-select.h
00001 /*
00002  * gnc-general-select.h -- General Selection Widget
00003  *
00004  * Copyright (C) 2001 Free Software Foundation
00005  * All rights reserved.
00006  *
00007  * Derek Atkins <warlord@MIT.EDU>
00008  *
00009  * GnuCash is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU Library General Public License as
00011  * published by the Free Software Foundation; either version 2 of
00012  * the License, or (at your option) any later version.
00013  *
00014  * Gnucash is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Library General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, contact:
00021  *
00022  * Free Software Foundation           Voice:  +1-617-542-5942
00023  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
00024  * Boston, MA  02110-1301,  USA       gnu@gnu.org
00025  *
00026  */
00027 /*
00028   @NOTATION@
00029  */
00030 
00031 #ifndef GNC_GENERAL_SELECT_H
00032 #define GNC_GENERAL_SELECT_H
00033 
00034 #define GNC_TYPE_GENERAL_SELECT          (gnc_general_select_get_type ())
00035 #define GNC_GENERAL_SELECT(obj)          G_TYPE_CHECK_INSTANCE_CAST (obj, gnc_general_select_get_type(), GNCGeneralSelect)
00036 #define GNC_GENERAL_SELECT_CLASS(klass)  G_TYPE_CHECK_CLASS_CAST (klass, gnc_general_select_get_type(), \ GNCGeneralSelectClass)
00037 #define GNC_IS_GENERAL_SELECT(obj)       G_TYPE_CHECK_INSTANCE_TYPE (obj, gnc_general_select_get_type ())
00038 
00039 typedef const char *    (*GNCGeneralSelectGetStringCB) (gpointer);
00040 typedef gpointer        (*GNCGeneralSelectNewSelectCB) (gpointer cbarg, gpointer default_selection, GtkWidget *parent);
00041 
00042 typedef enum
00043 {
00044     GNC_GENERAL_SELECT_TYPE_SELECT = 1,
00045     GNC_GENERAL_SELECT_TYPE_EDIT = 2,
00046     GNC_GENERAL_SELECT_TYPE_VIEW = 3
00047 } GNCGeneralSelectType;
00048 
00049 typedef struct
00050 {
00051     GtkHBox hbox;
00052 
00053     GtkWidget *entry;  /* display of selection name */
00054     GtkWidget *button; /* button for popping up selection window */
00055 
00056     gpointer selected_item;
00057 
00058     GNCGeneralSelectGetStringCB get_string;
00059     GNCGeneralSelectNewSelectCB new_select;
00060     gpointer                    cb_arg;
00061 
00062     int disposed; /* private */
00063 } GNCGeneralSelect;
00064 
00065 typedef struct
00066 {
00067     GtkHBoxClass parent_class;
00068 
00069     void                (*changed) (GNCGeneralSelect *edit);
00070 } GNCGeneralSelectClass;
00071 
00072 
00073 GtkWidget *gnc_general_select_new            (GNCGeneralSelectType type,
00074         GNCGeneralSelectGetStringCB get_string,
00075         GNCGeneralSelectNewSelectCB new_select,
00076         gpointer cb_arg);
00077 void       gnc_general_select_set_selected   (GNCGeneralSelect *gsl,
00078         gpointer selected);
00079 gpointer   gnc_general_select_get_selected   (GNCGeneralSelect *gsl);
00080 const char *gnc_general_select_get_printname (GNCGeneralSelect *gsl,
00081         gpointer selection);
00082 GType      gnc_general_select_get_type       (void);
00083 
00084 void       gnc_general_select_make_mnemonic_target (GNCGeneralSelect *gsl, GtkWidget *label);
00085 
00086 #endif
00087 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines