1 // Generated by gmmproc 2.60.0 -- DO NOT MODIFY! 2 #ifndef _GTKMM_STACK_H 3 #define _GTKMM_STACK_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* 10 * Copyright (C) 2013 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 <gtkmm/container.h> 28 #include <gtkmm/enums.h> 29 30 31 #ifndef DOXYGEN_SHOULD_SKIP_THIS 32 using GtkStack = struct _GtkStack; 33 using GtkStackClass = struct _GtkStackClass; 34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 35 36 37 #ifndef DOXYGEN_SHOULD_SKIP_THIS 38 namespace Gtk 39 { class Stack_Class; } // namespace Gtk 40 #endif //DOXYGEN_SHOULD_SKIP_THIS 41 42 namespace Gtk 43 { 44 45 46 /** A container that shows only one child at a time. 47 * 48 * Gtk::Stack does not provide a means for users to change the visible 49 * child. Instead, the Gtk::StackSwitcher or Gtk::StackSidebar widget can be used with 50 * Gtk::Stack to provide this functionality. 51 * 52 * @ingroup Widgets 53 * @ingroup Containers 54 * @newin{3,10} 55 */ 56 57 class Stack 58 : public Container 59 { 60 public: 61 #ifndef DOXYGEN_SHOULD_SKIP_THIS 62 typedef Stack CppObjectType; 63 typedef Stack_Class CppClassType; 64 typedef GtkStack BaseObjectType; 65 typedef GtkStackClass BaseClassType; 66 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 67 68 Stack(Stack&& src) noexcept; 69 Stack& operator=(Stack&& src) noexcept; 70 71 // noncopyable 72 Stack(const Stack&) = delete; 73 Stack& operator=(const Stack&) = delete; 74 75 ~Stack() noexcept override; 76 77 #ifndef DOXYGEN_SHOULD_SKIP_THIS 78 79 private: 80 friend class Stack_Class; 81 static CppClassType stack_class_; 82 83 protected: 84 explicit Stack(const Glib::ConstructParams& construct_params); 85 explicit Stack(GtkStack* castitem); 86 87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 88 89 public: 90 91 /** Get the GType for this class, for use with the underlying GObject type system. 92 */ 93 static GType get_type() G_GNUC_CONST; 94 95 #ifndef DOXYGEN_SHOULD_SKIP_THIS 96 97 98 static GType get_base_type() G_GNUC_CONST; 99 #endif 100 101 /// Provides access to the underlying C GObject. gobj()102 GtkStack* gobj() { return reinterpret_cast<GtkStack*>(gobject_); } 103 104 /// Provides access to the underlying C GObject. gobj()105 const GtkStack* gobj() const { return reinterpret_cast<GtkStack*>(gobject_); } 106 107 108 public: 109 //C++ methods used to invoke GTK+ virtual functions: 110 111 protected: 112 //GTK+ Virtual Functions (override these to change behaviour): 113 114 //Default Signal Handlers:: 115 116 117 private: 118 119 public: 120 Stack(); 121 122 123 /** Adds a child to @a stack. 124 * The child is identified by the @a name. 125 * 126 * @newin{3,10} 127 * 128 * @param child The widget to add. 129 * @param name The name for @a child. 130 */ 131 void add(Widget& child, const Glib::ustring& name); 132 133 134 /** Adds a child to @a stack. 135 * The child is identified by the @a name. The @a title 136 * will be used by Gtk::StackSwitcher to represent 137 * @a child in a tab bar, so it should be short. 138 * 139 * @newin{3,10} 140 * 141 * @param child The widget to add. 142 * @param name The name for @a child. 143 * @param title A human-readable title for @a child. 144 */ 145 void add(Widget& child, const Glib::ustring& name, const Glib::ustring& title); 146 147 //TODO: Remove this method overload when we can break ABI and API, and Container::add() 148 //has been made non-virtual. It's not very useful in Stack. It's needed only to 149 //avoid a compilation error when compiling with -Woverloaded-virtual -Werror. 150 //See https://bugzilla.gnome.org/show_bug.cgi?id=724732 151 /** Adds a child. 152 * 153 * @newin{3,14} 154 * 155 * @deprecated Use one of the other add() methods instead. This method was added only to avoid a compilation error. 156 */ 157 void add(Widget& child) override; 158 159 160 /** Makes @a child the visible child of @a stack. 161 * 162 * If @a child is different from the currently 163 * visible child, the transition between the 164 * two will be animated with the current 165 * transition type of @a stack. 166 * 167 * Note that the @a child widget has to be visible itself 168 * (see Gtk::Widget::show()) in order to become the visible 169 * child of @a stack. 170 * 171 * @newin{3,10} 172 * 173 * @param child A child of @a stack. 174 */ 175 void set_visible_child(Widget& child); 176 177 178 /** Gets the currently visible child of @a stack, or <tt>nullptr</tt> if 179 * there are no visible children. 180 * 181 * @newin{3,10} 182 * 183 * @return The visible child of the Gtk::Stack. 184 */ 185 Widget* get_visible_child(); 186 187 /** Gets the currently visible child of @a stack, or <tt>nullptr</tt> if 188 * there are no visible children. 189 * 190 * @newin{3,10} 191 * 192 * @return The visible child of the Gtk::Stack. 193 */ 194 const Widget* get_visible_child() const; 195 196 197 /** Makes the child with the given name visible. 198 * 199 * If @a child is different from the currently 200 * visible child, the transition between the 201 * two will be animated with the current 202 * transition type of @a stack. 203 * 204 * Note that the child widget has to be visible itself 205 * (see Gtk::Widget::show()) in order to become the visible 206 * child of @a stack. 207 * 208 * @newin{3,10} 209 * 210 * @param name The name of the child to make visible. 211 */ 212 void set_visible_child(const Glib::ustring& name); 213 214 /** Makes the child with the given name visible. 215 * 216 * Note that the child widget has to be visible itself 217 * (see Gtk::Widget::show()) in order to become the visible 218 * child of @a stack. 219 * 220 * @newin{3,10} 221 * 222 * @param name The name of the child to make visible. 223 * @param transition The transition type to use. 224 */ 225 void set_visible_child(const Glib::ustring& name, StackTransitionType transition); 226 227 /** Returns the name of the currently visible child of @a stack, or 228 * <tt>nullptr</tt> if there is no visible child. 229 * 230 * @newin{3,10} 231 * 232 * @return The name of the visible child of the Gtk::Stack. 233 */ 234 Glib::ustring get_visible_child_name() const; 235 236 237 /** Sets the Gtk::Stack to be homogeneous or not. If it 238 * is homogeneous, the Gtk::Stack will request the same 239 * size for all its children. If it isn't, the stack 240 * may change size when a different child becomes visible. 241 * 242 * Since 3.16, homogeneity can be controlled separately 243 * for horizontal and vertical size, with the 244 * Gtk::Stack::property_hhomogeneous() and Gtk::Stack::property_vhomogeneous(). 245 * 246 * @newin{3,10} 247 * 248 * @param homogeneous <tt>true</tt> to make @a stack homogeneous. 249 */ 250 void set_homogeneous(bool homogeneous = true); 251 252 /** Gets whether @a stack is homogeneous. 253 * See set_homogeneous(). 254 * 255 * @newin{3,10} 256 * 257 * @return Whether @a stack is homogeneous. 258 */ 259 bool get_homogeneous() const; 260 261 262 /** Sets the Gtk::Stack to be horizontally homogeneous or not. 263 * If it is homogeneous, the Gtk::Stack will request the same 264 * width for all its children. If it isn't, the stack 265 * may change width when a different child becomes visible. 266 * 267 * @newin{3,16} 268 * 269 * @param hhomogeneous <tt>true</tt> to make @a stack horizontally homogeneous. 270 */ 271 void set_hhomogeneous(bool hhomogeneous = true); 272 273 /** Gets whether @a stack is horizontally homogeneous. 274 * See set_hhomogeneous(). 275 * 276 * @newin{3,16} 277 * 278 * @return Whether @a stack is horizontally homogeneous. 279 */ 280 bool get_hhomogeneous() const; 281 282 283 /** Sets the Gtk::Stack to be vertically homogeneous or not. 284 * If it is homogeneous, the Gtk::Stack will request the same 285 * height for all its children. If it isn't, the stack 286 * may change height when a different child becomes visible. 287 * 288 * @newin{3,16} 289 * 290 * @param vhomogeneous <tt>true</tt> to make @a stack vertically homogeneous. 291 */ 292 void set_vhomogeneous(bool vhomogeneous = true); 293 294 /** Gets whether @a stack is vertically homogeneous. 295 * See set_vhomogeneous(). 296 * 297 * @newin{3,16} 298 * 299 * @return Whether @a stack is vertically homogeneous. 300 */ 301 bool get_vhomogeneous() const; 302 303 304 /** Sets the duration that transitions between pages in @a stack 305 * will take. 306 * 307 * @newin{3,10} 308 * 309 * @param duration The new duration, in milliseconds. 310 */ 311 void set_transition_duration(guint duration); 312 313 /** Returns the amount of time (in milliseconds) that 314 * transitions between pages in @a stack will take. 315 * 316 * @newin{3,10} 317 * 318 * @return The transition duration. 319 */ 320 guint get_transition_duration() const; 321 322 323 /** Sets the type of animation that will be used for 324 * transitions between pages in @a stack. Available 325 * types include various kinds of fades and slides. 326 * 327 * The transition type can be changed without problems 328 * at runtime, so it is possible to change the animation 329 * based on the page that is about to become current. 330 * 331 * @newin{3,10} 332 * 333 * @param transition The new transition type. 334 */ 335 void set_transition_type(StackTransitionType transition); 336 337 #ifndef GTKMM_DISABLE_DEPRECATED 338 339 /** Gets the type of animation that will be used 340 * for transitions between pages in @a stack. 341 * 342 * @newin{3,10} 343 * 344 * @deprecated Use the const method instead. 345 * 346 * @return The current transition type of @a stack. 347 */ 348 StackTransitionType get_transition_type(); 349 #endif // GTKMM_DISABLE_DEPRECATED 350 351 352 /** Gets the type of animation that will be used 353 * for transitions between pages in @a stack. 354 * 355 * @newin{3,10} 356 * 357 * @return The current transition type of @a stack. 358 */ 359 StackTransitionType get_transition_type() const; 360 361 362 /** Returns whether the @a stack is currently in a transition from one page to 363 * another. 364 * 365 * @newin{3,12} 366 * 367 * @return <tt>true</tt> if the transition is currently running, <tt>false</tt> otherwise. 368 */ 369 bool get_transition_running() const; 370 371 372 /** Finds the child of the Gtk::Stack with the name given as 373 * the argument. Returns <tt>nullptr</tt> if there is no child with this 374 * name. 375 * 376 * @newin{3,12} 377 * 378 * @param name The name of the child to find. 379 * @return The requested child of the Gtk::Stack. 380 */ 381 Widget* get_child_by_name(const Glib::ustring& name); 382 383 /** Finds the child of the Gtk::Stack with the name given as 384 * the argument. Returns <tt>nullptr</tt> if there is no child with this 385 * name. 386 * 387 * @newin{3,12} 388 * 389 * @param name The name of the child to find. 390 * @return The requested child of the Gtk::Stack. 391 */ 392 const Widget* get_child_by_name(const Glib::ustring& name) const; 393 394 395 /** Sets whether or not @a stack will interpolate its size when 396 * changing the visible child. If the Gtk::Stack::property_interpolate_size() 397 * property is set to <tt>true</tt>, @a stack will interpolate its size between 398 * the current one and the one it'll take after changing the 399 * visible child, according to the set transition duration. 400 * 401 * @newin{3,20} 402 * 403 * @param interpolate_size The new value. 404 */ 405 void set_interpolate_size(bool interpolate_size); 406 407 /** Returns wether the Gtk::Stack is set up to interpolate between 408 * the sizes of children on page switch. 409 * 410 * @newin{3,20} 411 * 412 * @return <tt>true</tt> if child sizes are interpolated. 413 */ 414 bool get_interpolate_size() const; 415 416 /** Homogeneous sizing. 417 * 418 * Default value: <tt>true</tt> 419 * 420 * @return A PropertyProxy that allows you to get or set the value of the property, 421 * or receive notification when the value of the property changes. 422 */ 423 Glib::PropertyProxy< bool > property_homogeneous() ; 424 425 /** Homogeneous sizing. 426 * 427 * Default value: <tt>true</tt> 428 * 429 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 430 * or receive notification when the value of the property changes. 431 */ 432 Glib::PropertyProxy_ReadOnly< bool > property_homogeneous() const; 433 434 /** <tt>true</tt> if the stack allocates the same width for all children. 435 * 436 * @newin{3,16} 437 * 438 * Default value: <tt>true</tt> 439 * 440 * @return A PropertyProxy that allows you to get or set the value of the property, 441 * or receive notification when the value of the property changes. 442 */ 443 Glib::PropertyProxy< bool > property_hhomogeneous() ; 444 445 /** <tt>true</tt> if the stack allocates the same width for all children. 446 * 447 * @newin{3,16} 448 * 449 * Default value: <tt>true</tt> 450 * 451 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 452 * or receive notification when the value of the property changes. 453 */ 454 Glib::PropertyProxy_ReadOnly< bool > property_hhomogeneous() const; 455 456 /** The animation duration, in milliseconds. 457 * 458 * Default value: 200 459 * 460 * @return A PropertyProxy that allows you to get or set the value of the property, 461 * or receive notification when the value of the property changes. 462 */ 463 Glib::PropertyProxy< unsigned int > property_transition_duration() ; 464 465 /** The animation duration, in milliseconds. 466 * 467 * Default value: 200 468 * 469 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 470 * or receive notification when the value of the property changes. 471 */ 472 Glib::PropertyProxy_ReadOnly< unsigned int > property_transition_duration() const; 473 474 /** Whether or not the transition is currently running. 475 * 476 * Default value: <tt>false</tt> 477 * 478 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 479 * or receive notification when the value of the property changes. 480 */ 481 Glib::PropertyProxy_ReadOnly< bool > property_transition_running() const; 482 483 484 /** The type of animation used to transition. 485 * 486 * Default value: Gtk::STACK_TRANSITION_TYPE_NONE 487 * 488 * @return A PropertyProxy that allows you to get or set the value of the property, 489 * or receive notification when the value of the property changes. 490 */ 491 Glib::PropertyProxy< StackTransitionType > property_transition_type() ; 492 493 /** The type of animation used to transition. 494 * 495 * Default value: Gtk::STACK_TRANSITION_TYPE_NONE 496 * 497 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 498 * or receive notification when the value of the property changes. 499 */ 500 Glib::PropertyProxy_ReadOnly< StackTransitionType > property_transition_type() const; 501 502 /** <tt>true</tt> if the stack allocates the same height for all children. 503 * 504 * @newin{3,16} 505 * 506 * Default value: <tt>true</tt> 507 * 508 * @return A PropertyProxy that allows you to get or set the value of the property, 509 * or receive notification when the value of the property changes. 510 */ 511 Glib::PropertyProxy< bool > property_vhomogeneous() ; 512 513 /** <tt>true</tt> if the stack allocates the same height for all children. 514 * 515 * @newin{3,16} 516 * 517 * Default value: <tt>true</tt> 518 * 519 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 520 * or receive notification when the value of the property changes. 521 */ 522 Glib::PropertyProxy_ReadOnly< bool > property_vhomogeneous() const; 523 524 /** The widget currently visible in the stack. 525 * 526 * @return A PropertyProxy that allows you to get or set the value of the property, 527 * or receive notification when the value of the property changes. 528 */ 529 Glib::PropertyProxy< Widget* > property_visible_child() ; 530 531 /** The widget currently visible in the stack. 532 * 533 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 534 * or receive notification when the value of the property changes. 535 */ 536 Glib::PropertyProxy_ReadOnly< Widget* > property_visible_child() const; 537 538 /** The name of the widget currently visible in the stack. 539 * 540 * Default value: "" 541 * 542 * @return A PropertyProxy that allows you to get or set the value of the property, 543 * or receive notification when the value of the property changes. 544 */ 545 Glib::PropertyProxy< Glib::ustring > property_visible_child_name() ; 546 547 /** The name of the widget currently visible in the stack. 548 * 549 * Default value: "" 550 * 551 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 552 * or receive notification when the value of the property changes. 553 */ 554 Glib::PropertyProxy_ReadOnly< Glib::ustring > property_visible_child_name() const; 555 556 /** Whether or not the size should smoothly change when changing between differently sized children. 557 * 558 * @newin{3,20} 559 * 560 * Default value: <tt>false</tt> 561 * 562 * @return A PropertyProxy that allows you to get or set the value of the property, 563 * or receive notification when the value of the property changes. 564 */ 565 Glib::PropertyProxy< bool > property_interpolate_size() ; 566 567 /** Whether or not the size should smoothly change when changing between differently sized children. 568 * 569 * @newin{3,20} 570 * 571 * Default value: <tt>false</tt> 572 * 573 * @return A PropertyProxy_ReadOnly that allows you to get the value of the property, 574 * or receive notification when the value of the property changes. 575 */ 576 Glib::PropertyProxy_ReadOnly< bool > property_interpolate_size() const; 577 578 579 /** The name of the child page. 580 * 581 * Default value: "" 582 * 583 * @return A ChildPropertyProxy that allows you to get or set the value of the property, 584 * or receive notification when the value of the property changes. 585 */ 586 Gtk::ChildPropertyProxy< Glib::ustring > child_property_name(Gtk::Widget& child) ; 587 588 /** The name of the child page. 589 * 590 * Default value: "" 591 * 592 * @return A ChildPropertyProxy_ReadOnly that allows you to get the value of the property, 593 * or receive notification when the value of the property changes. 594 */ 595 Gtk::ChildPropertyProxy_ReadOnly< Glib::ustring > child_property_name(const Gtk::Widget& child) const; 596 597 /** The title of the child page. 598 * 599 * Default value: "" 600 * 601 * @return A ChildPropertyProxy that allows you to get or set the value of the property, 602 * or receive notification when the value of the property changes. 603 */ 604 Gtk::ChildPropertyProxy< Glib::ustring > child_property_title(Gtk::Widget& child) ; 605 606 /** The title of the child page. 607 * 608 * Default value: "" 609 * 610 * @return A ChildPropertyProxy_ReadOnly that allows you to get the value of the property, 611 * or receive notification when the value of the property changes. 612 */ 613 Gtk::ChildPropertyProxy_ReadOnly< Glib::ustring > child_property_title(const Gtk::Widget& child) const; 614 615 /** The icon name of the child page. 616 * 617 * Default value: "" 618 * 619 * @return A ChildPropertyProxy that allows you to get or set the value of the property, 620 * or receive notification when the value of the property changes. 621 */ 622 Gtk::ChildPropertyProxy< Glib::ustring > child_property_icon_name(Gtk::Widget& child) ; 623 624 /** The icon name of the child page. 625 * 626 * Default value: "" 627 * 628 * @return A ChildPropertyProxy_ReadOnly that allows you to get the value of the property, 629 * or receive notification when the value of the property changes. 630 */ 631 Gtk::ChildPropertyProxy_ReadOnly< Glib::ustring > child_property_icon_name(const Gtk::Widget& child) const; 632 633 /** The index of the child in the parent. 634 * 635 * Default value: 0 636 * 637 * @return A ChildPropertyProxy that allows you to get or set the value of the property, 638 * or receive notification when the value of the property changes. 639 */ 640 Gtk::ChildPropertyProxy< int > child_property_position(Gtk::Widget& child) ; 641 642 /** The index of the child in the parent. 643 * 644 * Default value: 0 645 * 646 * @return A ChildPropertyProxy_ReadOnly that allows you to get the value of the property, 647 * or receive notification when the value of the property changes. 648 */ 649 Gtk::ChildPropertyProxy_ReadOnly< int > child_property_position(const Gtk::Widget& child) const; 650 651 /** Sets a flag specifying whether the child requires the user attention. 652 * This is used by the Gtk::StackSwitcher to change the appearance of the 653 * corresponding button when a page needs attention and it is not the 654 * current one. 655 * 656 * @newin{3,12} 657 * 658 * Default value: <tt>false</tt> 659 * 660 * @return A ChildPropertyProxy that allows you to get or set the value of the property, 661 * or receive notification when the value of the property changes. 662 */ 663 Gtk::ChildPropertyProxy< bool > child_property_needs_attention(Gtk::Widget& child) ; 664 665 /** Sets a flag specifying whether the child requires the user attention. 666 * This is used by the Gtk::StackSwitcher to change the appearance of the 667 * corresponding button when a page needs attention and it is not the 668 * current one. 669 * 670 * @newin{3,12} 671 * 672 * Default value: <tt>false</tt> 673 * 674 * @return A ChildPropertyProxy_ReadOnly that allows you to get the value of the property, 675 * or receive notification when the value of the property changes. 676 */ 677 Gtk::ChildPropertyProxy_ReadOnly< bool > child_property_needs_attention(const Gtk::Widget& child) const; 678 679 680 // There are no signals or vfuncs. 681 682 683 }; 684 685 } //namespace Gtk 686 687 688 namespace Glib 689 { 690 /** A Glib::wrap() method for this object. 691 * 692 * @param object The C instance. 693 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 694 * @result A C++ instance that wraps this C instance. 695 * 696 * @relates Gtk::Stack 697 */ 698 Gtk::Stack* wrap(GtkStack* object, bool take_copy = false); 699 } //namespace Glib 700 701 702 #endif /* _GTKMM_STACK_H */ 703 704