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