1/* $Id: selection.hg,v 1.2 2004/01/02 09:56:43 murrayc Exp $ */ 2 3/* Copyright (C) 2002 The gtkmm Development Team 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free 17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 */ 19 20_DEFS(atkmm,atk) 21_PINCLUDE(atk/atkobject.h) 22 23#include <glibmm/interface.h> 24 25#ifndef DOXYGEN_SHOULD_SKIP_THIS 26extern "C" 27{ 28 typedef struct _AtkSelectionIface AtkSelectionIface; 29 typedef struct _AtkSelection AtkSelection; 30} 31#endif /* DOXYGEN_SHOULD_SKIP_THIS */ 32 33 34namespace Atk 35{ 36 37class Object; 38 39/** The ATK interface implemented by container objects whose Atk::Object children can be selected. 40 * This should be implemented by UI components with children which are exposed by Atk::Object::ref_child and 41 * Atk::Object::get_n_children, if the use of the parent UI component ordinarily involves selection of one or 42 * more of the objects corresponding to those AtkObject children - for example, selectable lists. 43 * 44 * Note that other types of "selection" (for instance text selection) are accomplished a other ATK interfaces - 45 * Atk::Selection is limited to the selection/deselection of children. 46 */ 47class Selection : public Glib::Interface 48{ 49 _CLASS_INTERFACE(Selection, AtkSelection, ATK_SELECTION, AtkSelectionIface) 50 51public: 52 _WRAP_METHOD(bool add_selection(int i), atk_selection_add_selection) 53 _WRAP_METHOD(bool clear_selection(), atk_selection_clear_selection) 54 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_selection(int i), atk_selection_ref_selection) 55 _WRAP_METHOD(int get_selection_count() const, atk_selection_get_selection_count) 56 _WRAP_METHOD(bool is_child_selected(int i) const, atk_selection_is_child_selected) 57 _WRAP_METHOD(bool remove_selection(int i), atk_selection_remove_selection) 58 _WRAP_METHOD(bool select_all_selection(), atk_selection_select_all_selection) 59 60 _WRAP_SIGNAL(void selection_changed(), "selection_changed") 61 62protected: 63 _WRAP_VFUNC(bool add_selection(int i), add_selection) 64 _WRAP_VFUNC(bool clear_selection(), clear_selection) 65 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_selection(int i), ref_selection, refreturn_ctype) 66 _WRAP_VFUNC(int get_selection_count() const, get_selection_count) 67 _WRAP_VFUNC(bool is_child_selected(int i) const, is_child_selected) 68 _WRAP_VFUNC(bool remove_selection(int i), remove_selection) 69 _WRAP_VFUNC(bool select_all_selection(), select_all_selection) 70}; 71 72} // namespace Atk 73 74