Debian Codegraph @

atk/src/table.hg

raw
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 #include <glibmm/arrayhandle.h>
24
25 #ifndef DOXYGEN_SHOULD_SKIP_THIS
26 extern "C"
27 {
28 typedef struct _AtkTableIface AtkTableIface;
29 typedef struct _AtkTable AtkTable;
30 }
31 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
32
33
34 namespace Atk
35 {
36
37 class ATKMM_API Object;
38
39 /** The ATK interface implemented for UI components which contain tabular or row/column information.
40 * This should be implemented by components which present elements ordered via rows and columns. It may also be used to
41 * present tree-structured information if the nodes of the trees can be said to contain multiple "columns". Individual
42 * elements of an Atk::Table are typically referred to as "cells", and these cells are exposed by Atk::Table as child
43 * Atk::Objects of the Atk::Table. Both row/column and child-index-based access to these children is provided.
44 *
45 * Children of Atk::Table are frequently "lightweight" objects, that is, they may not have backing widgets in the host UI
46 * toolkit. They are therefore often transient.
47 *
48 * Since tables are often very complex, Atk::Table includes provision for offering simplified summary information, as
49 * well as row and column headers and captions. Headers and captions are AtkObjects which may implement other interfaces
50 * (Atk::Text, Atk::Image, etc.) as appropriate. Atk::Table summaries may themselves be (simplified) Atk::Tables, etc.
51 */
52 class ATKMM_API Table : public Glib::Interface
53 {
54 _CLASS_INTERFACE(Table, AtkTable, ATK_TABLE, AtkTableIface, , , ATKMM_API)
55
56 public:
57 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_at(int row, int column), atk_table_ref_at)
58 _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_at(int row, int column) const, atk_table_ref_at)
59
60 _WRAP_METHOD(int get_index_at(int row, int column) const, atk_table_get_index_at, deprecated "Use get_at() instead.")
61
62 _WRAP_METHOD(int get_column_at_index(int index) const, atk_table_get_column_at_index, deprecated "This should not be used in newly-written code.")
63 _WRAP_METHOD(int get_row_at_index(int index) const, atk_table_get_row_at_index, deprecated "This should not be used in newly-written code.")
64 _WRAP_METHOD(int get_n_columns() const, atk_table_get_n_columns)
65 _WRAP_METHOD(int get_n_rows() const, atk_table_get_n_rows)
66 _WRAP_METHOD(int get_column_extent_at(int row, int column) const, atk_table_get_column_extent_at)
67 _WRAP_METHOD(int get_row_extent_at(int row, int column) const, atk_table_get_row_extent_at)
68
69 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_caption(), atk_table_get_caption, refreturn)
70 _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_caption() const, atk_table_get_caption, refreturn, constversion)
71
72 _WRAP_METHOD(Glib::ustring get_column_description(int column) const, atk_table_get_column_description)
73
74 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_column_header(int column), atk_table_get_column_header, refreturn)
75 _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_column_header(int column) const, atk_table_get_column_header, refreturn, constversion)
76
77
78 _WRAP_METHOD(Glib::ustring get_row_description(int row) const, atk_table_get_row_description)
79
80 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_row_header(int row), atk_table_get_row_header, refreturn)
81 _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_row_header(int row) const, atk_table_get_row_header, refreturn, constversion)
82
83 _WRAP_METHOD(Glib::RefPtr<Atk::Object> get_summary(), atk_table_get_summary, refreturn)
84 _WRAP_METHOD(Glib::RefPtr<const Atk::Object> get_summary() const, atk_table_get_summary, refreturn, constversion)
85
86 _WRAP_METHOD(void set_caption(const Glib::RefPtr<Atk::Object>& caption), atk_table_set_caption)
87 _WRAP_METHOD(void set_column_description(int column, const Glib::ustring& description), atk_table_set_column_description)
88 _WRAP_METHOD(void set_column_header(int column, const Glib::RefPtr<Atk::Object>& header), atk_table_set_column_header)
89 _WRAP_METHOD(void set_row_description(int row, const Glib::ustring& description), atk_table_set_row_description)
90 _WRAP_METHOD(void set_row_header(int row, const Glib::RefPtr<Atk::Object>& header), atk_table_set_row_header)
91 _WRAP_METHOD(void set_summary(const Glib::RefPtr<Atk::Object>& accessible), atk_table_set_summary)
92
93 _IGNORE(atk_table_get_selected_columns, atk_table_get_selected_rows)
94 Glib::ArrayHandle<int> get_selected_columns() const;
95 Glib::ArrayHandle<int> get_selected_rows() const;
96
97 _WRAP_METHOD(bool is_column_selected(int column) const, atk_table_is_column_selected)
98 _WRAP_METHOD(bool is_row_selected(int row) const, atk_table_is_row_selected)
99 _WRAP_METHOD(bool is_selected(int row, int column) const, atk_table_is_selected)
100 _WRAP_METHOD(bool add_row_selection(int row), atk_table_add_row_selection)
101 _WRAP_METHOD(bool remove_row_selection(int row), atk_table_remove_row_selection)
102 _WRAP_METHOD(bool add_column_selection(int column), atk_table_add_column_selection)
103 _WRAP_METHOD(bool remove_column_selection(int column), atk_table_remove_column_selection)
104
105 _WRAP_SIGNAL(void row_inserted(int row, int num_inserted), "row_inserted")
106 _WRAP_SIGNAL(void column_inserted(int column, int num_inserted), "column_inserted")
107 _WRAP_SIGNAL(void row_deleted(int row, int num_deleted), "row_deleted")
108 _WRAP_SIGNAL(void column_deleted(int column, int num_deleted), "column_deleted")
109 _WRAP_SIGNAL(void row_reordered(), "row_reordered")
110 _WRAP_SIGNAL(void column_reordered(), "column_reordered")
111 _WRAP_SIGNAL(void model_changed(), "model_changed")
112
113 protected:
114 #m4 _CONVERSION(`AtkObject*',`const Glib::RefPtr<Atk::Object>&',`Glib::wrap($3, true)')
115 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_at(int row, int column), ref_at, refreturn_ctype)
116 _WRAP_VFUNC(int get_index_at(int row, int column) const, get_index_at)
117 _WRAP_VFUNC(int get_column_at_index(int index) const, get_column_at_index)
118 _WRAP_VFUNC(int get_row_at_index(int index) const, get_row_at_index)
119 _WRAP_VFUNC(int get_n_columns() const, get_n_columns)
120 _WRAP_VFUNC(int get_n_rows() const, get_n_rows)
121 _WRAP_VFUNC(int get_column_extent_at(int row, int column) const, get_column_extent_at)
122 _WRAP_VFUNC(int get_row_extent_at(int row, int column) const, get_row_extent_at)
123 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_caption(), get_caption, refreturn)
124 _WRAP_VFUNC(const char* get_column_description(int column) const, get_column_description)
125 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_column_header(int column), get_column_header, refreturn)
126 _WRAP_VFUNC(const char* get_row_description(int row) const, get_row_description)
127 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_row_header(int row), get_row_header, refreturn)
128 _WRAP_VFUNC(Glib::RefPtr<Atk::Object> get_summary(), get_summary, refreturn)
129 _WRAP_VFUNC(void set_caption(const Glib::RefPtr<Atk::Object>& caption), set_caption)
130 _WRAP_VFUNC(void set_column_description(int column, const char* description), set_column_description)
131 _WRAP_VFUNC(void set_column_header(int column, const Glib::RefPtr<Atk::Object>& header), set_column_header)
132 _WRAP_VFUNC(void set_row_description(int row, const char* description), set_row_description)
133 _WRAP_VFUNC(void set_row_header(int row, const Glib::RefPtr<Atk::Object>& header), set_row_header)
134 _WRAP_VFUNC(void set_summary(const Glib::RefPtr<Atk::Object>& accessible), set_summary)
135 _WRAP_VFUNC(bool is_column_selected(int column) const, is_column_selected)
136 _WRAP_VFUNC(bool is_row_selected(int row) const, is_row_selected)
137 _WRAP_VFUNC(bool is_selected(int row, int column) const, is_selected)
138 _WRAP_VFUNC(bool add_row_selection(int row), add_row_selection)
139 _WRAP_VFUNC(bool remove_row_selection(int row), remove_row_selection)
140 _WRAP_VFUNC(bool add_column_selection(int column), add_column_selection)
141 _WRAP_VFUNC(bool remove_column_selection(int column), remove_column_selection)
142 _WRAP_VFUNC(int get_selected_columns(int** selected) const, get_selected_columns)
143 _WRAP_VFUNC(int get_selected_rows(int** selected) const, get_selected_rows)
144 };
145
146 } // namespace Atk