gobject-introspection: fix virtual annotations and missing type descriptions
[atk.git] / atk / atkvalue.h
blobd3e3ad5a4b5a795279955b59daf4e5a00ea0560e
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 #ifndef __ATK_VALUE_H__
21 #define __ATK_VALUE_H__
23 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
24 #error "Only <atk/atk.h> can be included directly."
25 #endif
27 #include <atk/atkobject.h>
28 #include <atk/atkrange.h>
30 G_BEGIN_DECLS
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;
40 #endif
41 typedef struct _AtkValueIface AtkValueIface;
43 /**
44 * AtkValueType:
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().
51 typedef enum
53 ATK_VALUE_VERY_WEAK,
54 ATK_VALUE_WEAK,
55 ATK_VALUE_ACCEPTABLE,
56 ATK_VALUE_STRONG,
57 ATK_VALUE_VERY_STRONG,
58 ATK_VALUE_VERY_LOW,
59 ATK_VALUE_LOW,
60 ATK_VALUE_MEDIUM,
61 ATK_VALUE_HIGH,
62 ATK_VALUE_VERY_HIGH,
63 ATK_VALUE_VERY_BAD,
64 ATK_VALUE_BAD,
65 ATK_VALUE_GOOD,
66 ATK_VALUE_VERY_GOOD,
67 ATK_VALUE_BEST,
68 ATK_VALUE_LAST_DEFINED
69 }AtkValueType;
71 /**
72 * AtkValueIface:
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.
95 struct _AtkValueIface
97 GTypeInterface parent;
99 /*<deprecated>*/
100 void (* get_current_value) (AtkValue *obj,
101 GValue *value);
102 void (* get_maximum_value) (AtkValue *obj,
103 GValue *value);
104 void (* get_minimum_value) (AtkValue *obj,
105 GValue *value);
106 gboolean (* set_current_value) (AtkValue *obj,
107 const GValue *value);
108 void (* get_minimum_increment) (AtkValue *obj,
109 GValue *value);
110 /*</deprecated>*/
111 void (* get_value_and_text) (AtkValue *obj,
112 gdouble *value,
113 gchar **text);
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);
122 ATK_AVAILABLE_IN_ALL
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,
127 GValue *value);
129 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_range)
130 void atk_value_get_maximum_value (AtkValue *obj,
131 GValue *value);
132 ATK_DEPRECATED_IN_2_12_FOR(atk_value_get_range)
133 void atk_value_get_minimum_value (AtkValue *obj,
134 GValue *value);
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,
140 GValue *value);
142 ATK_AVAILABLE_IN_2_12
143 void atk_value_get_value_and_text (AtkValue *obj,
144 gdouble *value,
145 gchar **text);
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 */
156 ATK_AVAILABLE_IN_ALL
157 const gchar* atk_value_type_get_name (AtkValueType value_type);
158 ATK_AVAILABLE_IN_ALL
159 const gchar* atk_value_type_get_localized_name (AtkValueType value_type);
161 G_END_DECLS
163 #endif /* __ATK_VALUE_H__ */