| 1 | #ifndef _GTKMM_RADIOBUTTONGROUP_H |
| 2 | #define _GTKMM_RADIOBUTTONGROUP_H |
| 3 | /* radiobuttongroup.h |
| 4 | * |
| 5 | * Copyright (C) 2001-2002 The gtkmm Development Team |
| 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Lesser General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2.1 of the License, or(at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public |
| 18 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include <gtkmmconfig.h> // Can define GTKMM_DISABLE_DEPRECATED |
| 22 | |
| 23 | #include <glibmm/object.h> //For Glib::RefPtr<> and std::size_t |
| 24 | |
| 25 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 26 | extern "C" |
| 27 | { |
| 28 | typedef struct _GSList GSList; |
| 29 | } |
| 30 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 31 | |
| 32 | namespace Gtk |
| 33 | { |
| 34 | |
| 35 | class GTKMM_API RadioButton; |
| 36 | class GTKMM_API RadioMenuItem; |
| 37 | class GTKMM_API RadioAction; //deprecated |
| 38 | class GTKMM_API RadioToolButton; |
| 39 | |
| 40 | /** RadioButtonGroup, identifier for RadioButtons. |
| 41 | * To set up this RadioButtonGroup, construct a RadioButtonGroup and then pass it |
| 42 | * to the constructor of all radio items. You do not need |
| 43 | * to keep the RadioButtonGroup beyond the initial construction. |
| 44 | * It should not be instantiated with new, and it will be invalid after the RadioButtons have been deleted. |
| 45 | */ |
| 46 | class GTKMM_API RadioButtonGroup |
| 47 | { |
| 48 | public: |
| 49 | RadioButtonGroup(); |
| 50 | RadioButtonGroup(const RadioButtonGroup& src); |
| 51 | |
| 52 | RadioButtonGroup& operator=(const RadioButtonGroup& src); |
| 53 | |
| 54 | protected: |
| 55 | explicit RadioButtonGroup(GSList* group); |
| 56 | |
| 57 | friend class Gtk::RadioButton; |
| 58 | friend class Gtk::RadioMenuItem; |
| 59 | friend class Gtk::RadioAction; //deprecated |
| 60 | friend class Gtk::RadioToolButton; |
| 61 | |
| 62 | |
| 63 | //These all have similar interfaces. |
| 64 | //TODO: Add a common multiply-inherited base class, with set_group()=0? |
| 65 | // Would that anything useful other than being tidy? murrayc |
| 66 | void add(RadioButton& item); |
| 67 | void add(RadioMenuItem& item); |
| 68 | #ifndef GTKMM_DISABLE_DEPRECATED |
| 69 | /** @deprecated Because Gtk::RadioAction is deprecated. |
| 70 | */ |
| 71 | void add(const Glib::RefPtr<RadioAction>& item); |
| 72 | #endif // GTKMM_DISABLE_DEPRECATED |
| 73 | void add(RadioToolButton& item); |
| 74 | |
| 75 | void* operator new(std::size_t); // not implemented |
| 76 | |
| 77 | GSList* group_; |
| 78 | }; |
| 79 | |
| 80 | } // namespace Gtk |
| 81 | |
| 82 | #endif /* _GTKMM_RADIOBUTTONGROUP_H */ |