Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# object.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00023
    00024 #ifndef INTI_ATK_OBJECT_H
    00025 #define INTI_ATK_OBJECT_H
    00026
    00027 #ifndef INTI_G_OBJECT_H
    00028 #include <inti/glib/object.h>
    00029 #endif
    00030
    00031 #ifndef INTI_ATK_UTIL_H
    00032 #include <inti/atk/util.h>
    00033 #endif
    00034
    00035 #ifndef __ATK_OBJECT_H__
    00036 #include <atk/atkobject.h>
    00037 #endif
    00038
    00039 namespace Inti {
    00040
    00041 namespace Atk {
    00042
    00043 class ObjectClass;
    00044 class RelationSet;
    00045 class StateSet;
    00046
    00049
    00050 enum Role
    00051 {
    00052         ROLE_INVALID = ATK_ROLE_INVALID,
    00054
    00055         ROLE_ACCEL_LABEL = ATK_ROLE_ACCEL_LABEL,
    00057
    00058         ROLE_ALERT = ATK_ROLE_ALERT,
    00060
    00061         ROLE_ANIMATION = ATK_ROLE_ANIMATION,
    00063
    00064         ROLE_ARROW = ATK_ROLE_ARROW,
    00066
    00067         ROLE_CALENDAR = ATK_ROLE_CALENDAR,
    00069
    00070         ROLE_CANVAS = ATK_ROLE_CANVAS,
    00072
    00073         ROLE_CHECK_BOX = ATK_ROLE_CHECK_BOX,
    00075
    00076         ROLE_CHECK_MENU_ITEM = ATK_ROLE_CHECK_MENU_ITEM,
    00078
    00079         ROLE_COLOR_CHOOSER = ATK_ROLE_COLOR_CHOOSER,
    00081
    00082         ROLE_COLUMN_HEADER = ATK_ROLE_COLUMN_HEADER,
    00084
    00085         ROLE_COMBO_BOX = ATK_ROLE_COMBO_BOX,
    00087
    00088         ROLE_DATE_EDITOR = ATK_ROLE_DATE_EDITOR,
    00090
    00091         ROLE_DESKTOP_ICON = ATK_ROLE_DESKTOP_ICON,
    00093
    00094         ROLE_DESKTOP_FRAME = ATK_ROLE_DESKTOP_FRAME,
    00096
    00097         ROLE_DIAL = ATK_ROLE_DIAL,
    00099
    00100         ROLE_DIALOG = ATK_ROLE_DIALOG,
    00102
    00103         ROLE_DIRECTORY_PANE = ATK_ROLE_DIRECTORY_PANE,
    00105
    00106         ROLE_DRAWING_AREA = ATK_ROLE_DRAWING_AREA,
    00108
    00109         ROLE_FILE_CHOOSER = ATK_ROLE_FILE_CHOOSER,
    00111
    00112         ROLE_FILLER = ATK_ROLE_FILLER,
    00114
    00115         ROLE_FONT_CHOOSER = ATK_ROLE_FONT_CHOOSER,
    00117
    00118         ROLE_FRAME = ATK_ROLE_FRAME,
    00120
    00121         ROLE_GLASS_PANE = ATK_ROLE_GLASS_PANE,
    00123
    00124         ROLE_HTML_CONTAINER = ATK_ROLE_HTML_CONTAINER,
    00126
    00127         ROLE_ICON = ATK_ROLE_ICON,
    00129
    00130         ROLE_IMAGE = ATK_ROLE_IMAGE,
    00132
    00133         ROLE_INTERNAL_FRAME = ATK_ROLE_INTERNAL_FRAME,
    00135
    00136         ROLE_LABEL = ATK_ROLE_LABEL,
    00138
    00139         ROLE_LAYERED_PANE = ATK_ROLE_LAYERED_PANE,
    00141
    00142         ROLE_LIST = ATK_ROLE_LIST,
    00144
    00145         ROLE_LIST_ITEM = ATK_ROLE_LIST_ITEM,
    00147
    00148         ROLE_MENU = ATK_ROLE_MENU,
    00150
    00151         ROLE_MENU_BAR = ATK_ROLE_MENU_BAR,
    00154
    00155         ROLE_MENU_ITEM = ATK_ROLE_MENU_ITEM,
    00157
    00158         ROLE_OPTION_PANE = ATK_ROLE_OPTION_PANE,
    00160
    00161         ROLE_PAGE_TAB = ATK_ROLE_PAGE_TAB,
    00163
    00164         ROLE_PAGE_TAB_LIST = ATK_ROLE_PAGE_TAB_LIST,
    00167
    00168         ROLE_PANEL = ATK_ROLE_PANEL,
    00170
    00171         ROLE_PASSWORD_TEXT = ATK_ROLE_PASSWORD_TEXT,
    00173
    00174         ROLE_POPUP_MENU = ATK_ROLE_POPUP_MENU,
    00177
    00178         ROLE_PROGRESS_BAR = ATK_ROLE_PROGRESS_BAR,
    00180
    00181         ROLE_PUSH_BUTTON = ATK_ROLE_PUSH_BUTTON,
    00183
    00184         ROLE_RADIO_BUTTON = ATK_ROLE_RADIO_BUTTON,
    00187
    00188         ROLE_RADIO_MENU_ITEM = ATK_ROLE_RADIO_MENU_ITEM,
    00191
    00192         OLE_ROOT_PANE = ATK_ROLE_ROOT_PANE,
    00194
    00195         ROLE_ROW_HEADER = ATK_ROLE_ROW_HEADER,
    00197
    00198         ROLE_SCROLL_BAR = ATK_ROLE_SCROLL_BAR,
    00200
    00201         ROLE_SCROLL_PANE = ATK_ROLE_SCROLL_PANE,
    00203
    00204         ROLE_SEPARATOR = ATK_ROLE_SEPARATOR,
    00206
    00207         ROLE_SLIDER = ATK_ROLE_SLIDER,
    00209
    00210         ROLE_SPLIT_PANE = ATK_ROLE_SPLIT_PANE,
    00212
    00213         ROLE_SPIN_BUTTON = ATK_ROLE_SPIN_BUTTON,
    00215
    00216         ROLE_STATUSBAR = ATK_ROLE_STATUSBAR,
    00218
    00219         ROLE_TABLE = ATK_ROLE_TABLE,
    00221
    00222         ROLE_TABLE_CELL = ATK_ROLE_TABLE_CELL,
    00224
    00225         ROLE_TABLE_COLUMN_HEADER = ATK_ROLE_TABLE_COLUMN_HEADER,
    00227
    00228         ROLE_TABLE_ROW_HEADER = ATK_ROLE_TABLE_ROW_HEADER,
    00230
    00231         ROLE_TEAR_OFF_MENU_ITEM = ATK_ROLE_TEAR_OFF_MENU_ITEM,
    00233
    00234         ROLE_TERMINAL = ATK_ROLE_TERMINAL,
    00236
    00237         ROLE_TEXT = ATK_ROLE_TEXT,
    00239
    00240         ROLE_TOGGLE_BUTTON = ATK_ROLE_TOGGLE_BUTTON,
    00243
    00244         ROLE_TOOL_BAR = ATK_ROLE_TOOL_BAR,
    00246
    00247         ROLE_TOOL_TIP = ATK_ROLE_TOOL_TIP,
    00249
    00250         ROLE_TREE = ATK_ROLE_TREE,
    00252
    00253         ROLE_TREE_TABLE = ATK_ROLE_TREE_TABLE,
    00255
    00256         ROLE_UNKNOWN = ATK_ROLE_UNKNOWN,
    00258
    00259         ROLE_VIEWPORT = ATK_ROLE_VIEWPORT,
    00261
    00262         ROLE_WINDOW = ATK_ROLE_WINDOW,
    00264
    00265         ROLE_HEADER = ATK_ROLE_HEADER,
    00267
    00268         ROLE_FOOTER = ATK_ROLE_FOOTER,
    00270
    00271         ROLE_PARAGRAPH = ATK_ROLE_PARAGRAPH,
    00273
    00274         ROLE_RULER = ATK_ROLE_RULER,
    00277
    00278         ROLE_APPLICATION = ATK_ROLE_APPLICATION,
    00280
    00281         ROLE_LAST_DEFINED = ATK_ROLE_LAST_DEFINED
    00283 };
    00284
    00287
    00288 Role role_register(const String& name);
    00292
    00293 String role_get_name(Role role);
    00297
    00298 String role_get_localized_name(Role role);
    00302
    00303 Role role_for_name(const String& name);
    00307
    00309
    00325
    00326 class Object : public G::Object
    00327 {
    00328         friend class G::Object;
    00329         friend class ObjectClass;
    00330
    00331         Object(const Object&);
    00332         Object& operator=(const Object&);
    00333
    00334 protected:
    00337
    00338         explicit Object(AtkObject *object, bool reference = true);
    00345
    00347 //  Override these do_ methods when you want to change the default behaviour of the AtkObject.
    00348
    00349         virtual const char* do_get_name();
    00350
    00351         virtual const char* do_get_description();
    00352
    00353         virtual AtkObject* do_get_parent();
    00354
    00355         virtual int do_get_n_children();
    00356
    00357         virtual AtkObject* do_ref_child(int i);
    00358
    00359         virtual int do_get_index_in_parent();
    00360
    00361         virtual AtkRelationSet* do_ref_relation_set();
    00362
    00363         virtual AtkRole do_get_role();
    00364
    00365         virtual AtkLayer do_get_layer();
    00366
    00367         virtual int do_get_mdi_zorder();
    00368
    00369         virtual AtkStateSet* do_ref_state_set();
    00370
    00371         virtual void do_set_name(const char *name);
    00372
    00373         virtual void do_set_description(const char *description);
    00374
    00375         virtual void do_set_parent(AtkObject *parent);
    00376
    00377         virtual void do_set_role(AtkRole role);
    00378
    00381
    00382         virtual void on_children_changed(unsigned int change_index, gpointer changed_child);
    00389
    00390         virtual void on_focus_event(bool focus_in);
    00393
    00394         virtual void on_property_change(AtkPropertyValues *values);
    00397
    00398         virtual void on_state_change(const String& name, bool state_set);
    00404
    00405         virtual void on_visible_data_changed();
    00407
    00408         virtual void on_active_descendant_changed(void **child);
    00412
    00414 //  Properties
    00415
    00416         typedef G::Property<String> AccessibleNamePropertyType;
    00417         typedef G::PropertyProxy<G::Object, AccessibleNamePropertyType> AccessibleNamePropertyProxy;
    00418         static const AccessibleNamePropertyType accessible_name_property;
    00419
    00420         typedef G::Property<String> AccessibleDescriptionPropertyType;
    00421         typedef G::PropertyProxy<G::Object, AccessibleDescriptionPropertyType> AccessibleDescriptionPropertyProxy;
    00422         static const AccessibleDescriptionPropertyType accessible_description_property;
    00423
    00424         typedef G::Property<Atk::Object*> AccessibleParentPropertyType;
    00425         typedef G::PropertyProxy<G::Object, AccessibleParentPropertyType> AccessibleParentPropertyProxy;
    00426         static const AccessibleParentPropertyType accessible_parent_property;
    00427
    00428         typedef G::Property<double> AccessibleValuePropertyType;
    00429         typedef G::PropertyProxy<G::Object, AccessibleValuePropertyType> AccessibleValuePropertyProxy;
    00430         static const AccessibleValuePropertyType accessible_value_property;
    00431
    00432         typedef G::Property<int> AccessibleRolePropertyType;
    00433         typedef G::PropertyProxy<G::Object, AccessibleRolePropertyType> AccessibleRolePropertyProxy;
    00434         static const AccessibleRolePropertyType accessible_role_property;
    00435
    00436         typedef G::ReadableProperty<int> AccessibleComponentLayerPropertyType;
    00437         typedef G::PropertyProxy<G::Object, AccessibleComponentLayerPropertyType> AccessibleComponentLayerPropertyProxy;
    00438         static const AccessibleComponentLayerPropertyType accessible_component_layer_property;
    00439
    00440         typedef G::ReadableProperty<int> AccessibleComponentMdiZorderPropertyType;
    00441         typedef G::PropertyProxy<G::Object, AccessibleComponentMdiZorderPropertyType> AccessibleComponentMdiZorderPropertyProxy;
    00442         static const AccessibleComponentMdiZorderPropertyType accessible_component_mdi_zorder_property;
    00443
    00444         typedef G::Property<String> AccessibleTableCaptionPropertyType;
    00445         typedef G::PropertyProxy<G::Object, AccessibleTableCaptionPropertyType> AccessibleTableCaptionPropertyProxy;
    00446         static const AccessibleTableCaptionPropertyType accessible_table_caption_property;
    00447
    00448         typedef G::Property<String> AccessibleTableColumnDescriptionPropertyType;
    00449         typedef G::PropertyProxy<G::Object, AccessibleTableColumnDescriptionPropertyType> AccessibleTableColumnDescriptionPropertyProxy;
    00450         static const AccessibleTableColumnDescriptionPropertyType accessible_table_column_description_property;
    00451
    00452         typedef G::Property<Atk::Object*> AccessibleTableColumnHeaderPropertyType;
    00453         typedef G::PropertyProxy<G::Object, AccessibleTableColumnHeaderPropertyType> AccessibleTableColumnHeaderPropertyProxy;
    00454         static const AccessibleTableColumnHeaderPropertyType accessible_table_column_header_property;
    00455
    00456         typedef G::Property<String> AccessibleTableRowDescriptionPropertyType;
    00457         typedef G::PropertyProxy<G::Object, AccessibleTableRowDescriptionPropertyType> AccessibleTableRowDescriptionPropertyProxy;
    00458         static const AccessibleTableRowDescriptionPropertyType accessible_table_row_description_property;
    00459
    00460         typedef G::Property<Atk::Object*> AccessibleTableRowHeaderPropertyType;
    00461         typedef G::PropertyProxy<G::Object, AccessibleTableRowHeaderPropertyType> AccessibleTableRowHeaderPropertyProxy;
    00462         static const AccessibleTableRowHeaderPropertyType accessible_table_row_header_property;
    00463
    00464         typedef G::Property<Atk::Object*> AccessibleTableSummaryPropertyType;
    00465         typedef G::PropertyProxy<G::Object, AccessibleTableSummaryPropertyType> AccessibleTableSummaryPropertyProxy;
    00466         static const AccessibleTableSummaryPropertyType accessible_table_summary_property;
    00467
    00468 //  Signals
    00469
    00470         typedef G::Signal2<void, unsigned int, gpointer> ChildrenChangedSignalType;
    00471         typedef G::SignalProxy<TypeInstance, ChildrenChangedSignalType> ChildrenChangedSignalProxy;
    00472         static const ChildrenChangedSignalType children_changed_signal;
    00473
    00474         typedef G::Signal1<void, bool> FocusEventSignalType;
    00475         typedef G::SignalProxy<TypeInstance, FocusEventSignalType> FocusEventSignalProxy;
    00476         static const FocusEventSignalType focus_event_signal;
    00477
    00478         typedef G::Signal1<void, AtkPropertyValues*> PropertyChangeSignalType;
    00479         typedef G::SignalProxy<TypeInstance, PropertyChangeSignalType> PropertyChangeSignalProxy;
    00480         static const PropertyChangeSignalType property_change_signal;
    00481
    00482         typedef G::Signal2<void, const char*, bool> StateChangeSignalType;
    00483         typedef G::SignalProxy<TypeInstance, StateChangeSignalType> StateChangeSignalProxy;
    00484         static const StateChangeSignalType state_change_signal;
    00485
    00486         typedef G::Signal0<void> VisibleDataChangedSignalType;
    00487         typedef G::SignalProxy<TypeInstance, VisibleDataChangedSignalType> VisibleDataChangedSignalProxy;
    00488         static const VisibleDataChangedSignalType visible_data_changed_signal;
    00489
    00490         typedef G::Signal1<void, void**> ActiveDescendantChangedSignalType;
    00491         typedef G::SignalProxy<TypeInstance, ActiveDescendantChangedSignalType> ActiveDescendantChangedSignalProxy;
    00492         static const ActiveDescendantChangedSignalType active_descendant_changed_signal;
    00493
    00494 public:
    00497
    00498         virtual ~Object();
    00500
    00504
    00505         AtkObject* atk_object() const { return (AtkObject*)instance; }
    00507
    00508         AtkObjectClass* atk_object_class() const;
    00510
    00511         operator AtkObject* () const;
    00513
    00514         String get_name() const;
    00517
    00518         String get_description() const;
    00521
    00522         Object* get_parent() const;
    00525
    00526         int get_n_accessible_children() const;
    00529
    00530         Object* ref_accessible_child(int index) const;
    00537
    00538         RelationSet* ref_relation_set() const;
    00541
    00542         Role get_role() const;
    00545
    00546         Pointer<StateSet> ref_state_set() const;
    00549
    00550         int get_index_in_parent() const;
    00554
    00558
    00559         void set_name(const String& name);
    00562
    00563         void set_description(const String& description);
    00566
    00567         void set_parent(Object& parent);
    00570
    00571         void set_role(Role role);
    00574
    00575         void notify_state_change(State state, bool value);
    00579
    00580         bool add_relationship(RelationType relationship, const Object& target);
    00585
    00586         bool remove_relationship(RelationType relationship, const Object& target);
    00591
    00595
    00596         const AccessibleNamePropertyProxy prop_accessible_name()
    00597         {
    00598                 return AccessibleNamePropertyProxy(this, &accessible_name_property);
    00599         }
    00601
    00602         const AccessibleDescriptionPropertyProxy prop_accessible_description()
    00603         {
    00604                 return AccessibleDescriptionPropertyProxy(this, &accessible_description_property);
    00605         }
    00607
    00608         const AccessibleParentPropertyProxy prop_accessible_parent()
    00609         {
    00610                 return AccessibleParentPropertyProxy(this, &accessible_parent_property);
    00611         }
    00613
    00614         const AccessibleValuePropertyProxy prop_accessible_value()
    00615         {
    00616                 return AccessibleValuePropertyProxy(this, &accessible_value_property);
    00617         }
    00619
    00620         const AccessibleRolePropertyProxy prop_accessible_role()
    00621         {
    00622                 return AccessibleRolePropertyProxy(this, &accessible_role_property);
    00623         }
    00625
    00626         const AccessibleComponentLayerPropertyProxy prop_accessible_component_layer()
    00627         {
    00628                 return AccessibleComponentLayerPropertyProxy(this, &accessible_component_layer_property);
    00629         }
    00631
    00632         const AccessibleComponentMdiZorderPropertyProxy prop_accessible_component_mdi_zorder()
    00633         {
    00634                 return AccessibleComponentMdiZorderPropertyProxy(this, &accessible_component_mdi_zorder_property);
    00635         }
    00637
    00638         const AccessibleTableCaptionPropertyProxy prop_accessible_table_caption()
    00639         {
    00640                 return AccessibleTableCaptionPropertyProxy(this, &accessible_table_caption_property);
    00641         }
    00643
    00644         const AccessibleTableColumnDescriptionPropertyProxy prop_accessible_table_column_description()
    00645         {
    00646                 return AccessibleTableColumnDescriptionPropertyProxy(this, &accessible_table_column_description_property);
    00647         }
    00649
    00650         const AccessibleTableColumnHeaderPropertyProxy prop_accessible_table_column_header()
    00651         {
    00652                 return AccessibleTableColumnHeaderPropertyProxy(this, &accessible_table_column_header_property);
    00653         }
    00655
    00656         const AccessibleTableRowDescriptionPropertyProxy prop_accessible_table_row_description()
    00657         {
    00658                 return AccessibleTableRowDescriptionPropertyProxy(this, &accessible_table_row_description_property);
    00659         }
    00661
    00662         const AccessibleTableRowHeaderPropertyProxy prop_accessible_table_row_header()
    00663         {
    00664                 return AccessibleTableRowHeaderPropertyProxy(this, &accessible_table_row_header_property);
    00665         }
    00667
    00668         const AccessibleTableSummaryPropertyProxy prop_accessible_table_summary()
    00669         {
    00670                 return AccessibleTableSummaryPropertyProxy(this, &accessible_table_summary_property);
    00671         }
    00673
    00677
    00678         const ChildrenChangedSignalProxy sig_children_changed()
    00679         {
    00680                 return ChildrenChangedSignalProxy(this, &children_changed_signal);
    00681         }
    00683
    00684         const FocusEventSignalProxy sig_focus_event()
    00685         {
    00686                 return FocusEventSignalProxy(this, &focus_event_signal);
    00687         }
    00689
    00690         const PropertyChangeSignalProxy sig_property_change()
    00691         {
    00692                 return PropertyChangeSignalProxy(this, &property_change_signal);
    00693         }
    00695
    00696         const StateChangeSignalProxy sig_state_change()
    00697         {
    00698                 return StateChangeSignalProxy(this, &state_change_signal);
    00699         }
    00701
    00702         const VisibleDataChangedSignalProxy sig_visible_data_changed()
    00703         {
    00704                 return VisibleDataChangedSignalProxy(this, &visible_data_changed_signal);
    00705         }
    00708
    00709         const ActiveDescendantChangedSignalProxy sig_active_descendant_changed()
    00710         {
    00711                 return ActiveDescendantChangedSignalProxy(this, &active_descendant_changed_signal);
    00712         }
    00717
    00719 };
    00720
    00721 } // namespace Atk
    00722
    00723 } // namespace Inti
    00724
    00725 #endif // INTI_ATK_OBJECT_H
    00726

Main Page - Footer