2013-10-11 23:07:35 +00:00
|
|
|
/*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VN_HANDLER_H
|
|
|
|
#define VN_HANDLER_H
|
|
|
|
|
|
|
|
#include <db/db.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#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
|
|
|
|
{
|
2014-06-10 10:48:03 +00:00
|
|
|
GtkBin parent;
|
2013-10-11 23:07:35 +00:00
|
|
|
DbIterator * iterator;
|
|
|
|
VnHandlerShowFlags show_flags;
|
|
|
|
gboolean simple_record;
|
2014-06-10 10:48:03 +00:00
|
|
|
GtkWidget * buttons;
|
2014-05-29 08:37:06 +00:00
|
|
|
GActionGroup * group;
|
2014-06-10 10:48:03 +00:00
|
|
|
GSimpleAction * undo;
|
|
|
|
GSimpleAction * save;
|
|
|
|
GSimpleAction * remove;
|
|
|
|
GSimpleAction * add;
|
|
|
|
GSimpleAction * move_first;
|
|
|
|
GSimpleAction * move_previous;
|
|
|
|
GSimpleAction * move_next;
|
|
|
|
GSimpleAction * move_last;
|
2014-05-29 08:37:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _VnHandlerClass
|
|
|
|
{
|
|
|
|
/* <private> */
|
2014-06-10 10:48:03 +00:00
|
|
|
GtkBinClass parent;
|
2013-10-11 23:07:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2014-06-10 10:48:03 +00:00
|
|
|
#endif
|