/* * 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_COLUMN_H #define VN_COLUMN_H #include #include #define VN_TYPE_COLUMN (vn_column_get_type ()) #define VN_COLUMN(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, VN_TYPE_COLUMN, VnColumn)) #define VN_IS_COLUMN(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, VN_TYPE_COLUMN)) #define VN_COLUMN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, VN_TYPE_COLUMN, VnColumnClass)) #define VN_IS_COLUMN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE (klass, VN_TYPE_COLUMN)) #define VN_COLUMN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (obj, VN_TYPE_COLUMN, VnColumnClass)) typedef struct _VnColumn VnColumn; typedef struct _VnColumnClass VnColumnClass; typedef void (*VnColumnSetValueFunc) (VnColumn * obj, GtkTreeModel * model, GtkTreeIter * iter, GtkCellRenderer * cell, const GValue * value); typedef void (*VnColumnValuechangedFunc) (VnColumn * obj, const gchar * path, const GValue * value); typedef void (*VnColumnSetRendererFunc) (VnColumn * obj, GtkCellRenderer * cell); typedef void (*VnColumnSetEditableFunc) (VnColumn * obj, gboolean editable); typedef void (*VnColumnSetNullFunc) (VnColumn * obj, gboolean null); typedef void (*VnColumnModelChangedFunc) (VnColumn * obj); struct _VnColumn { GtkTreeViewColumn parent; GtkCellRenderer * cell; gint column_index; gchar * column_name; gboolean editable; gboolean null; gint tab_index; VnColumnSetValueFunc set_value; }; struct _VnColumnClass { GtkTreeViewColumnClass parent; VnColumnSetValueFunc set_value; VnColumnValuechangedFunc value_changed; VnColumnSetRendererFunc set_renderer; VnColumnSetEditableFunc set_editable; VnColumnSetNullFunc set_null; VnColumnModelChangedFunc model_changed; }; GType vn_column_get_type (); const gchar * vn_column_get_column_name (VnColumn * obj); void vn_column_set_column_name (VnColumn * obj, const gchar * name); gint vn_column_get_column_index (VnColumn * obj); void vn_column_set_column_index (VnColumn * obj, gint index); gboolean vn_column_get_editable (VnColumn * obj); void vn_column_set_editable (VnColumn * obj, gboolean editable); gboolean vn_column_get_null (VnColumn * obj); void vn_column_set_null (VnColumn * obj, gboolean null); int vn_column_get_tab_index (VnColumn * obj); void vn_column_set_tab_index (VnColumn * obj, gint tab_index); DbModel * vn_column_get_model (VnColumn * obj); gboolean vn_column_get_iter (VnColumn * obj, const gchar * path, DbIter * iter); void vn_column_model_changed (VnColumn * obj); #endif