1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
21 #error "Only <atk/atk.h> can be included directly."
24 #ifndef __ATK_VALUE_H__
25 #define __ATK_VALUE_H__
27 #include <atk/atkobject.h>
28 #include <atk/atkrange.h>
32 #define ATK_TYPE_VALUE (atk_value_get_type ())
33 #define ATK_IS_VALUE(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_VALUE)
34 #define ATK_VALUE(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_VALUE, AtkValue)
35 #define ATK_VALUE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_VALUE, AtkValueIface))
37 #ifndef _TYPEDEF_ATK_VALUE_
38 #define _TYPEDEF_ATK_VALUE__
39 typedef struct _AtkValue AtkValue;
41 typedef struct _AtkValueIface AtkValueIface;
46 * Default types for a given value. Those are defined in order to
47 * easily get localized strings to describe a given value or a given
48 * subrange, using atk_value_type_get_localized_name().
57 ATK_VALUE_VERY_STRONG,
68 ATK_VALUE_LAST_DEFINED
73 * @get_current_value: This virtual function is deprecated since 2.12
74 * and it should not be overriden.
75 * @get_maximum_value: This virtual function is deprecated since 2.12
76 * and it should not be overriden.
77 * @get_minimum_value: This virtual function is deprecated since 2.12
78 * and it should not be overriden.
79 * @set_current_value: This virtual function is deprecated since 2.12
80 * and it should not be overriden.
81 * @get_minimum_increment: This virtual function is deprecated since
82 * 2.12 and it should not be overriden.
83 * @get_value_and_text: gets the current value and the human readable
84 * text alternative (if available) of this object. Since 2.12.
85 * @get_range: gets the range that defines the minimum and maximum
86 * value of this object. Returns NULL if there is no range
87 * defined. Since 2.12.
88 * @get_increment: gets the minimum increment by which the value of
89 * this object may be changed. If zero it is undefined. Since 2.12.
90 * @get_sub_ranges: returns a list of different subranges, and their
91 * description (if available) of this object. Returns NULL if there
92 * is not subranges defined. Since 2.12.
93 * @set_value: sets the value of this object. Since 2.12.
97 GTypeInterface parent;
100 void (* get_current_value) (AtkValue *obj,
102 void (* get_maximum_value) (AtkValue *obj,
104 void (* get_minimum_value) (AtkValue *obj,
106 gboolean (* set_current_value) (AtkValue *obj,
107 const GValue *value);
108 void (* get_minimum_increment) (AtkValue *obj,
111 void (* get_value_and_text) (AtkValue *obj,
114 AtkRange*(* get_range) (AtkValue *obj);
115 gdouble (* get_increment) (AtkValue *obj);
116 GSList* (* get_sub_ranges) (AtkValue *obj);
117 void (* set_value) (AtkValue *obj,
118 const gdouble new_value);
123 GType atk_value_get_type (void);
125 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_value_and_text)
126 void atk_value_get_current_value (AtkValue *obj,
129 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_range)
130 void atk_value_get_maximum_value (AtkValue *obj,
132 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_range)
133 void atk_value_get_minimum_value (AtkValue *obj,
135 ATK_DEPRECATED_IN_2_12_FOR(atk_value_set_value)
136 gboolean atk_value_set_current_value (AtkValue *obj,
137 const GValue *value);
138 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_increment)
139 void atk_value_get_minimum_increment (AtkValue *obj,
142 ATK_AVAILABLE_IN_2_12
143 void atk_value_get_value_and_text (AtkValue *obj,
146 ATK_AVAILABLE_IN_2_12
147 AtkRange* atk_value_get_range (AtkValue *obj);
148 ATK_AVAILABLE_IN_2_12
149 gdouble atk_value_get_increment (AtkValue *obj);
150 ATK_AVAILABLE_IN_2_12
151 GSList* atk_value_get_sub_ranges (AtkValue *obj);
152 ATK_AVAILABLE_IN_2_12
153 void atk_value_set_value (AtkValue *obj,
154 const gdouble new_value);
155 /* AtkValueType methods */
157 const gchar* atk_value_type_get_name (AtkValueType value_type);
159 const gchar* atk_value_type_get_localized_name (AtkValueType value_type);
163 #endif /* __ATK_VALUE_H__ */