1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY! 2 #ifndef _GTKMM_SIZEGROUP_H 3 #define _GTKMM_SIZEGROUP_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* 10 * Copyright 2002 The gtkmm Development Team 11 * 12 * This library is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 2.1 of the License, or (at your option) any later version. 16 * 17 * This library is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this library; if not, write to the Free Software 24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 */ 26 27 #include <vector> 28 29 #include <glibmm/object.h> 30 #include <gtkmm/widget.h> 31 32 33 #ifndef DOXYGEN_SHOULD_SKIP_THIS 34 using GtkSizeGroup = struct _GtkSizeGroup; 35 using GtkSizeGroupClass = struct _GtkSizeGroupClass; 36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 37 38 39 #ifndef DOXYGEN_SHOULD_SKIP_THIS 40 namespace Gtk 41 { class SizeGroup_Class; } // namespace Gtk 42 #endif //DOXYGEN_SHOULD_SKIP_THIS 43 44 namespace Gtk 45 { 46 47 48 /** @addtogroup gtkmmEnums gtkmm Enums and Flags */ 49 50 /** 51 * @var SizeGroupMode SIZE_GROUP_NONE 52 * Group has no effect. 53 * 54 * @var SizeGroupMode SIZE_GROUP_HORIZONTAL 55 * Group affects horizontal requisition. 56 * 57 * @var SizeGroupMode SIZE_GROUP_VERTICAL 58 * Group affects vertical requisition. 59 * 60 * @var SizeGroupMode SIZE_GROUP_BOTH 61 * Group affects both horizontal and vertical requisition. 62 * 63 * @enum SizeGroupMode 64 * 65 * The mode of the size group determines the directions in which the size 66 * group affects the requested sizes of its component widgets. 67 * 68 * @ingroup gtkmmEnums 69 */ 70 enum SizeGroupMode 71 { 72 SIZE_GROUP_NONE, 73 SIZE_GROUP_HORIZONTAL, 74 SIZE_GROUP_VERTICAL, 75 SIZE_GROUP_BOTH 76 }; 77 78 } // namespace Gtk 79 80 #ifndef DOXYGEN_SHOULD_SKIP_THIS 81 namespace Glib 82 { 83 84 template <> 85 class Value<Gtk::SizeGroupMode> : public Glib::Value_Enum<Gtk::SizeGroupMode> 86 { 87 public: 88 static GType value_type() G_GNUC_CONST; 89 }; 90 91 } // namespace Glib 92 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 93 94 namespace Gtk 95 { 96 97 98 /** Gtk::SizeGroup provides a mechanism for grouping a number of widgets together so they all request the same amount of space. 99 * This is typically useful when you want a column of widgets to have the same size, but you can't use a Gtk::Grid widget. 100 * 101 * In detail, the size requested for each widget in a Gtk::SizeGroup is the maximum of the sizes that would have been 102 * requested for each widget in the size group if they were not in the size group. The mode of the size group (see 103 * set_mode()) determines whether this applies to the horizontal size, the vertical size, or both sizes. 104 * 105 * Note that size groups only affect the amount of space requested, not the size that the widgets finally receive. If 106 * you want the widgets in a GtkSizeGroup to actually be the same size, you need to pack them in such a way that they 107 * get the size they request and not more. For example, if you are packing your widgets into a table, you would not 108 * include the Gtk::FILL flag. 109 * 110 * Widgets can be part of multiple size groups; GTK+ will compute the horizontal size of a widget from the horizontal 111 * requisition of all widgets that can be reached from the widget by a chain of size groups of type 112 * Gtk::SIZE_GROUP_HORIZONTAL or Gtk::SIZE_GROUP_BOTH, and the vertical size from the vertical requisition of all widgets 113 * that can be reached from the widget by a chain of size groups of type Gtk::SIZE_GROUP_VERTICAL or Gtk::SIZE_GROUP_BOTH. 114 */ 115 116 class SizeGroup 117 : public Glib::Object, 118 public Buildable 119 { 120 121 #ifndef DOXYGEN_SHOULD_SKIP_THIS 122 123 public: 124 using CppObjectType = SizeGroup; 125 using CppClassType = SizeGroup_Class; 126 using BaseObjectType = GtkSizeGroup; 127 using BaseClassType = GtkSizeGroupClass; 128 129 // noncopyable 130 SizeGroup(const SizeGroup&) = delete; 131 SizeGroup& operator=(const SizeGroup&) = delete; 132 133 private: friend class SizeGroup_Class; 134 static CppClassType sizegroup_class_; 135 136 protected: 137 explicit SizeGroup(const Glib::ConstructParams& construct_params); 138 explicit SizeGroup(GtkSizeGroup* castitem); 139 140 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 141 142 public: 143 144 SizeGroup(SizeGroup&& src) noexcept; 145 SizeGroup& operator=(SizeGroup&& src) noexcept; 146 147 ~SizeGroup() noexcept override; 148 149 /** Get the GType for this class, for use with the underlying GObject type system. 150 */ 151 static GType get_type() G_GNUC_CONST; 152 153 #ifndef DOXYGEN_SHOULD_SKIP_THIS 154 155 156 static GType get_base_type() G_GNUC_CONST; 157 #endif 158 159 ///Provides access to the underlying C GObject. gobj()160 GtkSizeGroup* gobj() { return reinterpret_cast<GtkSizeGroup*>(gobject_); } 161 162 ///Provides access to the underlying C GObject. gobj()163 const GtkSizeGroup* gobj() const { return reinterpret_cast<GtkSizeGroup*>(gobject_); } 164 165 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. 166 GtkSizeGroup* gobj_copy(); 167 168 private: 169 170 171 protected: 172 explicit SizeGroup(SizeGroupMode mode); 173 174 public: 175 176 177 static Glib::RefPtr<SizeGroup> create(SizeGroupMode mode); 178 179 180 /** Sets the Gtk::SizeGroupMode of the size group. The mode of the size 181 * group determines whether the widgets in the size group should 182 * all have the same horizontal requisition (Gtk::SIZE_GROUP_HORIZONTAL) 183 * all have the same vertical requisition (Gtk::SIZE_GROUP_VERTICAL), 184 * or should all have the same requisition in both directions 185 * (Gtk::SIZE_GROUP_BOTH). 186 * 187 * @param mode The mode to set for the size group. 188 */ 189 void set_mode(SizeGroupMode mode); 190 191 /** Gets the current mode of the size group. See set_mode(). 192 * 193 * @return The current mode of the size group. 194 */ 195 SizeGroupMode get_mode() const; 196 197 198 #ifndef GTKMM_DISABLE_DEPRECATED 199 200 /** Sets whether unmapped widgets should be ignored when 201 * calculating the size. 202 * 203 * @newin{2,8} 204 * 205 * Deprecated: 3.22: Measuring the size of hidden widgets has not worked 206 * reliably for a long time. In most cases, they will report a size 207 * of 0 nowadays, and thus, their size will not affect the other 208 * size group members. In effect, size groups will always operate 209 * as if this property was <tt>true</tt>. Use a Gtk::Stack instead to hide 210 * widgets while still having their size taken into account. 211 * 212 * @deprecated Does not work reliably. Use a Gtk::Stack instead to hide widgets while still having their size taken into account. 213 * 214 * @param ignore_hidden Whether unmapped widgets should be ignored 215 * when calculating the size. 216 */ 217 void set_ignore_hidden(bool ignore_hidden = true); 218 #endif // GTKMM_DISABLE_DEPRECATED 219 220 221 #ifndef GTKMM_DISABLE_DEPRECATED 222 223 /** Returns if invisible widgets are ignored when calculating the size. 224 * 225 * @newin{2,8} 226 * 227 * Deprecated: 3.22: Measuring the size of hidden widgets has not worked 228 * reliably for a long time. In most cases, they will report a size 229 * of 0 nowadays, and thus, their size will not affect the other 230 * size group members. In effect, size groups will always operate 231 * as if this property was <tt>true</tt>. Use a Gtk::Stack instead to hide 232 * widgets while still having their size taken into account. 233 * 234 * @deprecated Does not work reliably. Use a Gtk::Stack instead to hide widgets while still having their size taken into account. 235 * 236 * @return <tt>true</tt> if invisible widgets are ignored. 237 */ 238 bool get_ignore_hidden() const; 239 #endif // GTKMM_DISABLE_DEPRECATED 240 241 242 /** Adds a widget to a Gtk::SizeGroup. In the future, the requisition 243 * of the widget will be determined as the maximum of its requisition 244 * and the requisition of the other widgets in the size group. 245 * Whether this applies horizontally, vertically, or in both directions 246 * depends on the mode of the size group. See set_mode(). 247 * 248 * When the widget is destroyed or no longer referenced elsewhere, it will 249 * be removed from the size group. 250 * 251 * @param widget The Gtk::Widget to add. 252 */ 253 void add_widget(Widget& widget); 254 255 /** Removes a widget from a Gtk::SizeGroup. 256 * 257 * @param widget The Gtk::Widget to remove. 258 */ 259 void remove_widget(Widget& widget); 260 261 262 /** Returns the list of widgets associated with @a size_group. 263 * 264 * @newin{2,10} 265 * 266 * @return A SList of 267 * widgets. The list is owned by GTK+ and should not be modified. 268 */ 269 std::vector<Widget*> get_widgets(); 270 271 272 /** Returns the list of widgets associated with @a size_group. 273 * 274 * @newin{2,10} 275 * 276 * @return A SList of 277 * widgets. The list is owned by GTK+ and should not be modified. 278 */ 279 std::vector<const Widget*> get_widgets() const; 280 281 /** The directions in which the size group affects the requested sizes of its component widgets. 282 * 283 * Default value: Gtk::SIZE_GROUP_HORIZONTAL 284 * 285 * @return A PropertyProxy that allows you to get or set the value of the property, 286 * or receive notification when the value of the property changes. 287 */ 288 Glib::PropertyProxy< SizeGroupMode > property_mode() ; 289 290 /** The directions in which the size group affects the requested sizes of its component widgets. 291 * 292 * Default value: Gtk::SIZE_GROUP_HORIZONTAL 293 * 294 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 295 * or receive notification when the value of the property changes. 296 */ 297 Glib::PropertyProxy_ReadOnly< SizeGroupMode > property_mode() const; 298 299 300 #ifndef GTKMM_DISABLE_DEPRECATED 301 302 /** If <tt>true</tt>, unmapped widgets are ignored when determining 303 * the size of the group. 304 * 305 * @newin{2,8} 306 * 307 * Deprecated: 3.22: Measuring the size of hidden widgets has not worked 308 * reliably for a long time. In most cases, they will report a size 309 * of 0 nowadays, and thus, their size will not affect the other 310 * size group members. In effect, size groups will always operate 311 * as if this property was <tt>true</tt>. Use a Gtk::Stack instead to hide 312 * widgets while still having their size taken into account. 313 * 314 * @deprecated Does not work reliably. Use a Gtk::Stack instead to hide widgets while still having their size taken into account. 315 * 316 * Default value: <tt>false</tt> 317 * 318 * @return A PropertyProxy that allows you to get or set the value of the property, 319 * or receive notification when the value of the property changes. 320 */ 321 Glib::PropertyProxy< bool > property_ignore_hidden() ; 322 323 /** If <tt>true</tt>, unmapped widgets are ignored when determining 324 * the size of the group. 325 * 326 * @newin{2,8} 327 * 328 * Deprecated: 3.22: Measuring the size of hidden widgets has not worked 329 * reliably for a long time. In most cases, they will report a size 330 * of 0 nowadays, and thus, their size will not affect the other 331 * size group members. In effect, size groups will always operate 332 * as if this property was <tt>true</tt>. Use a Gtk::Stack instead to hide 333 * widgets while still having their size taken into account. 334 * 335 * @deprecated Does not work reliably. Use a Gtk::Stack instead to hide widgets while still having their size taken into account. 336 * 337 * Default value: <tt>false</tt> 338 * 339 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 340 * or receive notification when the value of the property changes. 341 */ 342 Glib::PropertyProxy_ReadOnly< bool > property_ignore_hidden() const; 343 344 #endif // GTKMM_DISABLE_DEPRECATED 345 346 347 public: 348 349 public: 350 //C++ methods used to invoke GTK+ virtual functions: 351 352 protected: 353 //GTK+ Virtual Functions (override these to change behaviour): 354 355 //Default Signal Handlers:: 356 357 358 }; 359 360 } //namespace Gtk 361 362 363 namespace Glib 364 { 365 /** A Glib::wrap() method for this object. 366 * 367 * @param object The C instance. 368 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 369 * @result A C++ instance that wraps this C instance. 370 * 371 * @relates Gtk::SizeGroup 372 */ 373 Glib::RefPtr<Gtk::SizeGroup> wrap(GtkSizeGroup* object, bool take_copy = false); 374 } 375 376 377 #endif /* _GTKMM_SIZEGROUP_H */ 378 379