1
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3
* gnm-cell-combo.c: Base class the models of in cell combos (e.g. validation and sheetslicer)
5
* Copyright (C) Jody Goldberg <jody@gnome.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
#include <gnumeric-config.h>
24
#include "gnm-cell-combo.h"
25
#include "sheet-view.h"
27
#include <gsf/gsf-impl-utils.h>
35
gnm_cell_combo_finalize (GObject *object)
37
GnmCellCombo *ccombo = GNM_CELL_COMBO (object);
40
if (NULL != ccombo->sv) {
41
sv_weak_unref (&ccombo->sv);
44
parent = g_type_class_peek (SHEET_OBJECT_TYPE);
45
parent->finalize (object);
49
gnm_cell_combo_set_property (GObject *obj, guint property_id,
50
GValue const *value, GParamSpec *pspec)
52
GnmCellCombo *ccombo = (GnmCellCombo *)obj;
54
switch (property_id) {
56
SheetView *sv = g_value_get_object (value);
57
sv_weak_ref (ccombo->sv = sv, &ccombo->sv);
62
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
67
gnm_cell_combo_get_property (GObject *obj, guint property_id,
68
GValue *value, GParamSpec *pspec)
70
GnmCellCombo const *ccombo = (GnmCellCombo const *)obj;
72
switch (property_id) {
73
case PROP_SV : g_value_set_object (value, ccombo->sv); break;
75
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
80
gnm_cell_combo_init (SheetObject *so)
82
/* keep the arrows from wandering with their cells */
83
so->flags &= ~SHEET_OBJECT_MOVE_WITH_CELLS;
87
gnm_cell_combo_class_init (GObjectClass *gobject_class)
89
SheetObjectClass *so_class = SHEET_OBJECT_CLASS (gobject_class);
90
gobject_class->finalize = gnm_cell_combo_finalize;
91
gobject_class->get_property = gnm_cell_combo_get_property;
92
gobject_class->set_property = gnm_cell_combo_set_property;
93
so_class->read_xml_dom = NULL;
94
so_class->write_xml_sax = NULL;
95
so_class->prep_sax_parser = NULL;
96
so_class->copy = NULL;
98
g_object_class_install_property (gobject_class, PROP_SV,
99
g_param_spec_object ("sheet-view", NULL, NULL,
100
SHEET_VIEW_TYPE, GSF_PARAM_STATIC | G_PARAM_READWRITE));
103
GSF_CLASS_ABSTRACT (GnmCellCombo, gnm_cell_combo,
104
gnm_cell_combo_class_init, gnm_cell_combo_init,