1 // Generated by gmmproc 2.56.0 -- DO NOT MODIFY! 2 #ifndef _ATKMM_VALUE_H 3 #define _ATKMM_VALUE_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* $Id: value.hg,v 1.2 2004/01/02 09:56:43 murrayc Exp $ */ 10 11 /* Copyright (C) 2002 The gtkmm Development Team 12 * 13 * This library is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU Lesser General Public 15 * License as published by the Free Software Foundation; either 16 * version 2.1 of the License, or (at your option) any later version. 17 * 18 * This library is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 * Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public 24 * License along with this library; if not, write to the Free 25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 26 */ 27 28 29 #include <glibmm/interface.h> 30 #include <atkmm/range.h> 31 32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 33 extern "C" 34 { 35 typedef struct _AtkValueIface AtkValueIface; 36 typedef struct _AtkValue AtkValue; 37 } 38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 39 40 41 #ifndef DOXYGEN_SHOULD_SKIP_THIS 42 using AtkValue = struct _AtkValue; 43 using AtkValueClass = struct _AtkValueClass; 44 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 45 46 47 #ifndef DOXYGEN_SHOULD_SKIP_THIS 48 namespace Atk 49 { class Value_Class; } // namespace Atk 50 #endif // DOXYGEN_SHOULD_SKIP_THIS 51 52 namespace Atk 53 { 54 55 /** The ATK interface implemented by valuators and components which display or select a value from a bounded range of values. 56 * This should be implemented for components which either display a value from a bounded range, or which allow the user 57 * to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, 58 * should have Atk::Object representations which implement Atk::Value on the component's behalf. Atk::Values may be 59 * read-only, in which case attempts to alter the value return false to indicate failure. 60 */ 61 62 class Value : public Glib::Interface 63 { 64 65 #ifndef DOXYGEN_SHOULD_SKIP_THIS 66 67 public: 68 using CppObjectType = Value; 69 using CppClassType = Value_Class; 70 using BaseObjectType = AtkValue; 71 using BaseClassType = AtkValueIface; 72 73 // noncopyable 74 Value(const Value&) = delete; 75 Value& operator=(const Value&) = delete; 76 77 private: 78 friend class Value_Class; 79 static CppClassType value_class_; 80 81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 82 protected: 83 /** 84 * You should derive from this class to use it. 85 */ 86 Value(); 87 88 #ifndef DOXYGEN_SHOULD_SKIP_THIS 89 /** Called by constructors of derived classes. Provide the result of 90 * the Class init() function to ensure that it is properly 91 * initialized. 92 * 93 * @param interface_class The Class object for the derived type. 94 */ 95 explicit Value(const Glib::Interface_Class& interface_class); 96 97 public: 98 // This is public so that C++ wrapper instances can be 99 // created for C instances of unwrapped types. 100 // For instance, if an unexpected C type implements the C interface. 101 explicit Value(AtkValue* castitem); 102 103 protected: 104 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 105 106 public: 107 108 Value(Value&& src) noexcept; 109 Value& operator=(Value&& src) noexcept; 110 111 ~Value() noexcept override; 112 113 static void add_interface(GType gtype_implementer); 114 115 /** Get the GType for this class, for use with the underlying GObject type system. 116 */ 117 static GType get_type() G_GNUC_CONST; 118 119 #ifndef DOXYGEN_SHOULD_SKIP_THIS 120 static GType get_base_type() G_GNUC_CONST; 121 #endif 122 123 ///Provides access to the underlying C GObject. gobj()124 AtkValue* gobj() { return reinterpret_cast<AtkValue*>(gobject_); } 125 126 ///Provides access to the underlying C GObject. gobj()127 const AtkValue* gobj() const { return reinterpret_cast<AtkValue*>(gobject_); } 128 129 private: 130 131 132 public: 133 134 #ifndef ATKMM_DISABLE_DEPRECATED 135 136 /** Gets the value of this object. 137 * 138 * Deprecated: Since 2.12. Use get_value_and_text() 139 * instead. 140 * 141 * @deprecated Use get_value_and_text() instead. 142 * 143 * @param value A Value representing the current accessible value. 144 */ 145 void get_current_value(Glib::ValueBase& value) const; 146 #endif // ATKMM_DISABLE_DEPRECATED 147 148 149 #ifndef ATKMM_DISABLE_DEPRECATED 150 151 /** Gets the maximum value of this object. 152 * 153 * Deprecated: Since 2.12. Use get_range() instead. 154 * 155 * @deprecated Use get_range() instead. 156 * 157 * @param value A Value representing the maximum accessible value. 158 */ 159 void get_maximum_value(Glib::ValueBase& value) const; 160 #endif // ATKMM_DISABLE_DEPRECATED 161 162 163 #ifndef ATKMM_DISABLE_DEPRECATED 164 165 /** Gets the minimum value of this object. 166 * 167 * Deprecated: Since 2.12. Use get_range() instead. 168 * 169 * @deprecated Use get_range() instead. 170 * 171 * @param value A Value representing the minimum accessible value. 172 */ 173 void get_minimum_value(Glib::ValueBase& value) const; 174 #endif // ATKMM_DISABLE_DEPRECATED 175 176 177 #ifndef ATKMM_DISABLE_DEPRECATED 178 179 /** Sets the value of this object. 180 * 181 * Deprecated: Since 2.12. Use set_value() instead. 182 * 183 * @deprecated Use set_value() instead. 184 * 185 * @param value A Value which is the desired new accessible value. 186 * @return <tt>true</tt> if new value is successfully set, <tt>false</tt> otherwise. 187 */ 188 bool set_current_value(const Glib::ValueBase& value); 189 #endif // ATKMM_DISABLE_DEPRECATED 190 191 192 /** Gets the current value and the human readable text alternative. 193 * 194 * @newin{2,24} 195 */ 196 void get_value_and_text(double& value, Glib::ustring& text); 197 198 199 /** Gets the range of this object. 200 * 201 * @newin{2,12} 202 * 203 * @return A newly allocated Atk::Range 204 * that represents the minimum, maximum and descriptor (if available) 205 * of @a obj. <tt>nullptr</tt> if that range is not defined. 206 */ 207 Range get_range() const; 208 209 210 /** Gets the minimum increment by which the value of this object may be 211 * changed. If zero, the minimum increment is undefined, which may 212 * mean that it is limited only by the floating point precision of the 213 * platform. 214 * 215 * @newin{2,12} 216 * 217 * @return The minimum increment by which the value of this 218 * object may be changed. zero if undefined. 219 */ 220 double get_increment(); 221 222 223 /** Sets the value of this object. 224 * 225 * This method is intended to provide a way to change the value of the 226 * object. In any case, it is possible that the value can't be 227 * modified (ie: a read-only component). If the value changes due this 228 * call, it is possible that the text could change, and will trigger 229 * an Atk::Value::signal_value_changed() signal emission. 230 * 231 * Note for implementors: the deprecated set_current_value() 232 * method returned <tt>true</tt> or <tt>false</tt> depending if the value was assigned 233 * or not. In the practice several implementors were not able to 234 * decide it, and returned <tt>true</tt> in any case. For that reason it is not 235 * required anymore to return if the value was properly assigned or 236 * not. 237 * 238 * @newin{2,12} 239 * 240 * @param new_value A double which is the desired new accessible value. 241 */ 242 void set_value(const gdouble new_value); 243 244 245 //TODO: atk_value_get_sub_ranges () 246 247 248 protected: 249 virtual void get_current_value_vfunc(Glib::ValueBase& value) const; 250 251 virtual void get_maximum_value_vfunc(Glib::ValueBase& value) const; 252 253 virtual void get_minimum_value_vfunc(Glib::ValueBase& value) const; 254 255 virtual bool set_current_value_vfunc(const Glib::ValueBase& value); 256 257 258 public: 259 260 public: 261 //C++ methods used to invoke GTK+ virtual functions: 262 263 protected: 264 //GTK+ Virtual Functions (override these to change behaviour): 265 266 //Default Signal Handlers:: 267 268 269 }; 270 271 } // namespace Atk 272 273 274 namespace Glib 275 { 276 /** A Glib::wrap() method for this object. 277 * 278 * @param object The C instance. 279 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 280 * @result A C++ instance that wraps this C instance. 281 * 282 * @relates Atk::Value 283 */ 284 Glib::RefPtr<Atk::Value> wrap(AtkValue* object, bool take_copy = false); 285 286 } // namespace Glib 287 288 289 #endif /* _ATKMM_VALUE_H */ 290 291