/* * Copyright (C) 2012 - Juan Ferrer Toribio * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef VN_HANDLER_H #define VN_HANDLER_H #include #include #define VN_TYPE_HANDLER (vn_handler_get_type ()) #define VN_IS_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, VN_TYPE_HANDLER)) #define VN_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, VN_TYPE_HANDLER , VnHandler)) #define VN_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, VN_TYPE_HANDLER, VnHandlerClass)) #define VN_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (obj, VN_TYPE_HANDLER, VnHandlerClass)) #define VN_TYPE_HANDLER_SHOW_FLAGS (vn_handler_show_flags_get_type ()) typedef struct _VnHandler VnHandler; typedef struct _VnHandlerClass VnHandlerClass; typedef enum { VN_HANDLER_SHOW_REFRESH = 1 << 0 ,VN_HANDLER_SHOW_UNDO = 1 << 1 ,VN_HANDLER_SHOW_SAVE = 1 << 2 ,VN_HANDLER_SHOW_REMOVE = 1 << 3 ,VN_HANDLER_SHOW_ADD = 1 << 4 ,VN_HANDLER_SHOW_SCROLL = 1 << 5 } VnHandlerShowFlags; struct _VnHandler { GtkBin parent; DbIterator * iterator; VnHandlerShowFlags show_flags; gboolean simple_record; GtkWidget * buttons; GActionGroup * group; GSimpleAction * undo; GSimpleAction * save; GSimpleAction * remove; GSimpleAction * add; GSimpleAction * move_first; GSimpleAction * move_previous; GSimpleAction * move_next; GSimpleAction * move_last; }; struct _VnHandlerClass { /* */ GtkBinClass parent; }; GType vn_handler_get_type (); GType vn_handler_show_flags_get_type () G_GNUC_CONST; GtkWidget * vn_handler_new (); GtkWidget * vn_handler_new_with_iterator (DbIterator * iterator); DbIterator * vn_handler_get_iterator (VnHandler * obj); void vn_handler_set_iterator (VnHandler * obj, DbIterator * iterator); void vn_handler_set_show_flags (VnHandler * obj, VnHandlerShowFlags show_flags); void vn_handler_set_simple_record (VnHandler * obj, gboolean simple); #endif