fix for type error on 64 bit systems
[ardour.git] / libs / gtkmm2 / atk / atkmm / table.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_TABLE_H
4 #define _ATKMM_TABLE_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright (C) 2002 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 extern "C"
30 {
31   typedef struct _AtkTableIface AtkTableIface;
32   typedef struct _AtkTable      AtkTable;
33 }
34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
35
36
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 typedef struct _AtkTable AtkTable;
39 typedef struct _AtkTableClass AtkTableClass;
40 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41
42
43 namespace Atk
44 { class Table_Class; } // namespace Atk
45 namespace Atk
46 {
47
48 class Object;
49
50 /** The ATK interface implemented for UI components which contain tabular or row/column information.
51  * This should be implemented by components which present elements ordered via rows and columns. It may also be used to
52  * present tree-structured information if the nodes of the trees can be said to contain multiple "columns". Individual
53  * elements of an Atk::Table are typically referred to as "cells", and these cells are exposed by Atk::Table as child
54  * Atk::Objects of the Atk::Table. Both row/column and child-index-based access to these children is provided.
55  *
56  * Children of Atk::Table are frequently "lightweight" objects, that is, they may not have backing widgets in the host UI
57  * toolkit. They are therefore often transient.
58  *
59  * Since tables are often very complex, Atk::Table includes provision for offering simplified summary information, as
60  * well as row and column headers and captions. Headers and captions are AtkObjects which may implement other interfaces
61  * (Atk::Text, Atk::Image, etc.) as appropriate. Atk::Table summaries may themselves be (simplified) Atk::Tables, etc. 
62  */
63
64 class Table : public Glib::Interface
65 {
66   
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68
69 public:
70   typedef Table CppObjectType;
71   typedef Table_Class CppClassType;
72   typedef AtkTable BaseObjectType;
73   typedef AtkTableIface BaseClassType;
74
75 private:
76   friend class Table_Class;
77   static CppClassType table_class_;
78
79   // noncopyable
80   Table(const Table&);
81   Table& operator=(const Table&);
82
83 protected:
84   Table(); // you must derive from this class
85   explicit Table(AtkTable* castitem);
86
87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
88
89 public:
90   virtual ~Table();
91
92   static void add_interface(GType gtype_implementer);
93
94 #ifndef DOXYGEN_SHOULD_SKIP_THIS
95   static GType get_type()      G_GNUC_CONST;
96   static GType get_base_type() G_GNUC_CONST;
97 #endif
98
99   ///Provides access to the underlying C GObject.
100   AtkTable*       gobj()       { return reinterpret_cast<AtkTable*>(gobject_); }
101
102   ///Provides access to the underlying C GObject.  
103   const AtkTable* gobj() const { return reinterpret_cast<AtkTable*>(gobject_); }
104
105 private:
106
107
108 public:
109   
110   /** Get a reference to the table cell at @a row , @a column .
111    * @param row A <tt>int</tt> representing a row in @a table .
112    * @param column A <tt>int</tt> representing a column in @a table .
113    * @return A AtkObject* representing the referred to accessible.
114    */
115   Glib::RefPtr<Atk::Object> get_at(int row, int column);
116   
117   /** Gets a <tt>int</tt> representing the index at the specified @a row  and @a column .
118    * The value -1 is returned if the object at row,column is not a child
119    * of table or table does not implement this interface.
120    * @param row A <tt>int</tt> representing a row in @a table .
121    * @param column A <tt>int</tt> representing a column in @a table .
122    * @return A <tt>int</tt> representing the index at specified position.
123    */
124   int get_index_at(int row, int column) const;
125   
126   /** Gets a <tt>int</tt> representing the column at the specified @a index , or -1
127    * if the table does not implement this interface
128    * @param index A <tt>int</tt> representing an index in @a table .
129    * @return A <tt>int</tt> representing the column at the specified index.
130    */
131   int get_column_at_index(int index) const;
132   
133   /** Gets a <tt>int</tt> representing the row at the specified @a index , or -1
134    * if the table does not implement this interface
135    * @param index A <tt>int</tt> representing an index in @a table .
136    * @return A <tt>int</tt> representing the row at the specified index.
137    */
138   int get_row_at_index(int index) const;
139   
140   /** Gets the number of columns in the table.
141    * @return A <tt>int</tt> representing the number of columns, or 0
142    * if value does not implement this interface.
143    */
144   int get_n_columns() const;
145   
146   /** Gets the number of rows in the table.
147    * @return A <tt>int</tt> representing the number of rows, or 0
148    * if value does not implement this interface.
149    */
150   int get_n_rows() const;
151   
152   /** Gets the number of columns occupied by the accessible object
153    * at the specified @a row  and @a column  in the @a table .
154    * @param row A <tt>int</tt> representing a row in @a table .
155    * @param column A <tt>int</tt> representing a column in @a table .
156    * @return A <tt>int</tt> representing the column extent at specified position, or 0
157    * if value does not implement this interface.
158    */
159   int get_column_extent_at(int row, int column) const;
160   
161   /** Gets the number of rows occupied by the accessible object
162    * at a specified @a row  and @a column  in the @a table .
163    * @param row A <tt>int</tt> representing a row in @a table .
164    * @param column A <tt>int</tt> representing a column in @a table .
165    * @return A <tt>int</tt> representing the row extent at specified position, or 0
166    * if value does not implement this interface.
167    */
168   int get_row_extent_at(int row, int column) const;
169   
170   
171   /** Gets the caption for the @a table .
172    * @return A AtkObject* representing the table caption, or <tt>0</tt>
173    * if value does not implement this interface.
174    */
175   Glib::RefPtr<Atk::Object> get_caption();
176   
177   /** Gets the caption for the @a table .
178    * @return A AtkObject* representing the table caption, or <tt>0</tt>
179    * if value does not implement this interface.
180    */
181   Glib::RefPtr<const Atk::Object> get_caption() const;
182   
183   
184   /** Gets the description text of the specified @a column  in the table
185    * @param column A <tt>int</tt> representing a column in @a table .
186    * @return A gchar* representing the column description, or <tt>0</tt>
187    * if value does not implement this interface.
188    */
189   Glib::ustring get_column_description(int column) const;
190   
191   
192   /** Gets the column header of a specified column in an accessible table.
193    * @param column A <tt>int</tt> representing a column in the table.
194    * @return A AtkObject* representing the specified column header, or
195    * <tt>0</tt> if value does not implement this interface.
196    */
197   Glib::RefPtr<Atk::Object> get_column_header(int column);
198   
199   /** Gets the column header of a specified column in an accessible table.
200    * @param column A <tt>int</tt> representing a column in the table.
201    * @return A AtkObject* representing the specified column header, or
202    * <tt>0</tt> if value does not implement this interface.
203    */
204   Glib::RefPtr<const Atk::Object> get_column_header(int column) const;
205
206   
207   /** Gets the description text of the specified row in the table
208    * @param row A <tt>int</tt> representing a row in @a table .
209    * @return A gchar* representing the row description, or <tt>0</tt>
210    * if value does not implement this interface.
211    */
212   Glib::ustring get_row_description(int row) const;
213
214   
215   /** Gets the row header of a specified row in an accessible table.
216    * @param row A <tt>int</tt> representing a row in the table.
217    * @return A AtkObject* representing the specified row header, or
218    * <tt>0</tt> if value does not implement this interface.
219    */
220   Glib::RefPtr<Atk::Object> get_row_header(int row);
221   
222   /** Gets the row header of a specified row in an accessible table.
223    * @param row A <tt>int</tt> representing a row in the table.
224    * @return A AtkObject* representing the specified row header, or
225    * <tt>0</tt> if value does not implement this interface.
226    */
227   Glib::RefPtr<const Atk::Object> get_row_header(int row) const;
228   
229   
230   /** Gets the summary description of the table.
231    * @return A AtkObject* representing a summary description of the table,
232    * or zero if value does not implement this interface.
233    */
234   Glib::RefPtr<Atk::Object> get_summary();
235   
236   /** Gets the summary description of the table.
237    * @return A AtkObject* representing a summary description of the table,
238    * or zero if value does not implement this interface.
239    */
240   Glib::RefPtr<const Atk::Object> get_summary() const;
241   
242   
243   /** Sets the caption for the table.
244    * @param caption A Atk::Object representing the caption to set for @a table .
245    */
246   void set_caption(const Glib::RefPtr<Atk::Object>& caption);
247   
248   /** Sets the description text for the specified @a column  of the @a table .
249    * @param column A <tt>int</tt> representing a column in @a table .
250    * @param description A #gchar representing the description text
251    * to set for the specified @a column  of the @a table .
252    */
253   void set_column_description(int column, const Glib::ustring& description);
254   
255   /** Sets the specified column header to @a header .
256    * @param column A <tt>int</tt> representing a column in @a table .
257    * @param header An Atk::Table.
258    */
259   void set_column_header(int column, const Glib::RefPtr<Atk::Object>& header);
260   
261   /** Sets the description text for the specified @a row  of @a table .
262    * @param row A <tt>int</tt> representing a row in @a table .
263    * @param description A #gchar representing the description text
264    * to set for the specified @a row  of @a table .
265    */
266   void set_row_description(int row, const Glib::ustring& description);
267   
268   /** Sets the specified row header to @a header .
269    * @param row A <tt>int</tt> representing a row in @a table .
270    * @param header An Atk::Table.
271    */
272   void set_row_header(int row, const Glib::RefPtr<Atk::Object>& header);
273   
274   /** Sets the summary description of the table.
275    * @param accessible An Atk::Object representing the summary description
276    * to set for @a table .
277    */
278   void set_summary(const Glib::RefPtr<Atk::Object>& accessible);
279
280   
281   Glib::ArrayHandle<int> get_selected_columns() const;
282   Glib::ArrayHandle<int> get_selected_rows() const;
283
284   
285   /** Gets a boolean value indicating whether the specified @a column 
286    * is selected
287    * @param column A <tt>int</tt> representing a column in @a table .
288    * @return A <tt>bool</tt> representing if the column is selected, or 0
289    * if value does not implement this interface.
290    */
291   bool is_column_selected(int column) const;
292   
293   /** Gets a boolean value indicating whether the specified @a row 
294    * is selected
295    * @param row A <tt>int</tt> representing a row in @a table .
296    * @return A <tt>bool</tt> representing if the row is selected, or 0
297    * if value does not implement this interface.
298    */
299   bool is_row_selected(int row) const;
300   
301   /** Gets a boolean value indicating whether the accessible object
302    * at the specified @a row  and @a column  is selected
303    * @param row A <tt>int</tt> representing a row in @a table .
304    * @param column A <tt>int</tt> representing a column in @a table .
305    * @return A <tt>bool</tt> representing if the cell is selected, or 0
306    * if value does not implement this interface.
307    */
308   bool is_selected(int row, int column) const;
309   
310   /** Adds the specified @a row  to the selection.
311    * @param row A <tt>int</tt> representing a row in @a table .
312    * @return A <tt>bool</tt> representing if row was successfully added to selection,
313    * or 0 if value does not implement this interface.
314    */
315   bool add_row_selection(int row);
316   
317   /** Removes the specified @a row  from the selection.
318    * @param row A <tt>int</tt> representing a row in @a table .
319    * @return A <tt>bool</tt> representing if the row was successfully removed from
320    * the selection, or 0 if value does not implement this interface.
321    */
322   bool remove_row_selection(int row);
323   
324   /** Adds the specified @a column  to the selection.
325    * @param column A <tt>int</tt> representing a column in @a table .
326    * @return A <tt>bool</tt> representing if the column was successfully added to 
327    * the selection, or 0 if value does not implement this interface.
328    */
329   bool add_column_selection(int column);
330   
331   /** Adds the specified @a column  to the selection.
332    * @param column A <tt>int</tt> representing a column in @a table .
333    * @return A <tt>bool</tt> representing if the column was successfully removed from
334    * the selection, or 0 if value does not implement this interface.
335    */
336   bool remove_column_selection(int column);
337
338   
339   Glib::SignalProxy2< void,int,int > signal_row_inserted();
340
341   
342   Glib::SignalProxy2< void,int,int > signal_column_inserted();
343
344   
345   Glib::SignalProxy2< void,int,int > signal_row_deleted();
346
347   
348   Glib::SignalProxy2< void,int,int > signal_column_deleted();
349
350   
351   Glib::SignalProxy0< void > signal_row_reordered();
352
353   
354   Glib::SignalProxy0< void > signal_column_reordered();
355
356   
357   Glib::SignalProxy0< void > signal_model_changed();
358
359
360 protected:
361     virtual Glib::RefPtr<Atk::Object> get_at_vfunc(int row, int column);
362     virtual int get_index_at_vfunc(int row, int column) const;
363     virtual int get_column_at_index_vfunc(int index) const;
364     virtual int get_row_at_index_vfunc(int index) const;
365     virtual int get_n_columns_vfunc() const;
366     virtual int get_n_rows_vfunc() const;
367     virtual int get_column_extent_at_vfunc(int row, int column) const;
368     virtual int get_row_extent_at_vfunc(int row, int column) const;
369     virtual Glib::RefPtr<Atk::Object> get_caption_vfunc();
370     virtual const char* get_column_description_vfunc(int column) const;
371     virtual Glib::RefPtr<Atk::Object> get_column_header_vfunc(int column);
372     virtual const char* get_row_description_vfunc(int row) const;
373     virtual Glib::RefPtr<Atk::Object> get_row_header_vfunc(int row);
374     virtual Glib::RefPtr<Atk::Object> get_summary_vfunc();
375     virtual void set_caption_vfunc(const Glib::RefPtr<Atk::Object>& caption);
376     virtual void set_column_description_vfunc(int column, const char* description);
377     virtual void set_column_header_vfunc(int column, const Glib::RefPtr<Atk::Object>& header);
378     virtual void set_row_description_vfunc(int row, const char* description);
379     virtual void set_row_header_vfunc(int row, const Glib::RefPtr<Atk::Object>& header);
380     virtual void set_summary_vfunc(const Glib::RefPtr<Atk::Object>& accessible);
381     virtual bool is_column_selected_vfunc(int column) const;
382     virtual bool is_row_selected_vfunc(int row) const;
383     virtual bool is_selected_vfunc(int row, int column) const;
384     virtual bool add_row_selection_vfunc(int row);
385     virtual bool remove_row_selection_vfunc(int row);
386     virtual bool add_column_selection_vfunc(int column);
387     virtual bool remove_column_selection_vfunc(int column);
388     virtual int get_selected_columns_vfunc(int** selected) const;
389     virtual int get_selected_rows_vfunc(int** selected) const;
390
391
392 public:
393
394 public:
395   //C++ methods used to invoke GTK+ virtual functions:
396
397 protected:
398   //GTK+ Virtual Functions (override these to change behaviour):
399
400   //Default Signal Handlers::
401   virtual void on_row_inserted(int row, int num_inserted);
402   virtual void on_column_inserted(int column, int num_inserted);
403   virtual void on_row_deleted(int row, int num_deleted);
404   virtual void on_column_deleted(int column, int num_deleted);
405   virtual void on_row_reordered();
406   virtual void on_column_reordered();
407   virtual void on_model_changed();
408
409
410 };
411
412 } // namespace Atk
413
414
415 namespace Glib
416 {
417   /** @relates Atk::Table
418    * @param object The C instance
419    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
420    * @result A C++ instance that wraps this C instance.
421    */
422   Glib::RefPtr<Atk::Table> wrap(AtkTable* object, bool take_copy = false);
423
424 } // namespace Glib
425
426 #endif /* _ATKMM_TABLE_H */
427