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