3
* Copyright (C) 2003 Vivien Malerba
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22
#ifndef __MG_DATA_ENTRY_H_
23
#define __MG_DATA_ENTRY_H_
25
#include <glib-object.h>
27
#include <libgda/libgda.h>
32
#define MG_DATA_ENTRY_TYPE (mg_data_entry_get_type())
33
#define MG_DATA_ENTRY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mg_data_entry_get_type(), MgDataEntry)
34
#define IS_MG_DATA_ENTRY(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_data_entry_get_type ())
35
#define MG_DATA_ENTRY_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MG_DATA_ENTRY_TYPE, MgDataEntryIface))
38
MG_DATA_ENTRY_IS_NULL = 1 << 0, /* READ | WRITE */
39
MG_DATA_ENTRY_CAN_BE_NULL = 1 << 1, /* READ | WRITE */
40
MG_DATA_ENTRY_IS_DEFAULT = 1 << 2, /* READ | WRITE */
41
MG_DATA_ENTRY_CAN_BE_DEFAULT = 1 << 3, /* READ | WRITE */
42
MG_DATA_ENTRY_IS_UNCHANGED = 1 << 4, /* READ | WRITE */
43
MG_DATA_ENTRY_ACTIONS_SHOWN = 1 << 5, /* READ | WRITE */
44
MG_DATA_ENTRY_DATA_NON_VALID = 1 << 6, /* READ */
45
MG_DATA_ENTRY_HAS_VALUE_ORIG = 1 << 7 /* READ */
46
} MgDataEntryAttribute;
48
/* struct for the interface */
49
struct _MgDataEntryIface
51
GTypeInterface g_iface;
54
void (* contents_modified) (MgDataEntry *de);
55
void (* status_changed) (MgDataEntry *de);
58
void ( *set_value_type) (MgDataEntry *de, GdaValueType type);
59
GdaValueType ( *get_value_type) (MgDataEntry *de);
60
void ( *set_value) (MgDataEntry *de, const GdaValue * value);
61
GdaValue *( *get_value) (MgDataEntry *de);
62
void ( *set_value_orig) (MgDataEntry *de, const GdaValue * value);
63
const GdaValue *( *get_value_orig) (MgDataEntry *de);
64
void ( *set_value_default) (MgDataEntry *de, const GdaValue * value);
65
void ( *set_attributes) (MgDataEntry *de, guint attrs, guint mask);
66
guint ( *get_attributes) (MgDataEntry *de);
67
MgDataHandler *( *get_handler) (MgDataEntry *de);
68
gboolean ( *expand_in_layout) (MgDataEntry *de);
74
guint mg_data_entry_get_type (void);
76
void mg_data_entry_set_value_type (MgDataEntry *de, GdaValueType type);
77
GdaValueType mg_data_entry_get_value_type (MgDataEntry *de);
79
void mg_data_entry_set_value (MgDataEntry *de, const GdaValue * value);
80
GdaValue *mg_data_entry_get_value (MgDataEntry *de);
81
void mg_data_entry_set_value_orig (MgDataEntry *de, const GdaValue * value);
82
const GdaValue *mg_data_entry_get_value_orig (MgDataEntry *de);
83
void mg_data_entry_set_current_as_orig (MgDataEntry *de);
84
void mg_data_entry_set_value_default (MgDataEntry *de, const GdaValue * value);
86
void mg_data_entry_set_attributes (MgDataEntry *de, guint attrs, guint mask);
87
guint mg_data_entry_get_attributes (MgDataEntry *de);
89
MgDataHandler *mg_data_entry_get_handler (MgDataEntry *de);
90
gboolean mg_data_entry_expand_in_layout (MgDataEntry *de);