merge the formfield patch from ooo-build
[ooovba.git] / vcl / unx / gtk / a11y / atkwrapper.hxx
blob092de6e9faaab13b8fa8941ffa2a92e05a9e26d5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: atkwrapper.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __ATK_WRAPPER_HXX__
32 #define __ATK_WRAPPER_HXX__
34 #include <atk/atk.h>
35 #include <com/sun/star/accessibility/XAccessible.hpp>
37 extern "C" {
39 typedef struct _AtkObjectWrapper AtkObjectWrapper;
40 typedef struct _AtkObjectWrapperClass AtkObjectWrapperClass;
42 namespace com { namespace sun { namespace star { namespace accessibility {
43 class XAccessibleAction;
44 class XAccessibleComponent;
45 class XAccessibleEditableText;
46 class XAccessibleHypertext;
47 class XAccessibleImage;
48 class XAccessibleMultiLineText;
49 class XAccessibleSelection;
50 class XAccessibleTable;
51 class XAccessibleText;
52 class XAccessibleTextMarkup;
53 class XAccessibleTextAttributes;
54 class XAccessibleValue;
55 } } } }
58 struct _AtkObjectWrapper
60 AtkObject aParent;
62 ::com::sun::star::accessibility::XAccessible *mpAccessible;
63 ::com::sun::star::accessibility::XAccessibleContext *mpContext;
64 ::com::sun::star::accessibility::XAccessibleAction *mpAction;
65 ::com::sun::star::accessibility::XAccessibleComponent *mpComponent;
66 ::com::sun::star::accessibility::XAccessibleEditableText *mpEditableText;
67 ::com::sun::star::accessibility::XAccessibleHypertext *mpHypertext;
68 ::com::sun::star::accessibility::XAccessibleImage *mpImage;
69 ::com::sun::star::accessibility::XAccessibleMultiLineText *mpMultiLineText;
70 ::com::sun::star::accessibility::XAccessibleSelection *mpSelection;
71 ::com::sun::star::accessibility::XAccessibleTable *mpTable;
72 ::com::sun::star::accessibility::XAccessibleText *mpText;
73 ::com::sun::star::accessibility::XAccessibleTextMarkup *mpTextMarkup;
74 ::com::sun::star::accessibility::XAccessibleTextAttributes *mpTextAttributes;
75 ::com::sun::star::accessibility::XAccessibleValue *mpValue;
77 AtkObject *child_about_to_be_removed;
78 gint index_of_child_about_to_be_removed;
79 // ::rtl::OString * m_pKeyBindings
82 struct _AtkObjectWrapperClass
84 AtkObjectClass aParentClass;
87 GType atk_object_wrapper_get_type (void) G_GNUC_CONST;
88 AtkObject * atk_object_wrapper_ref(
89 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
90 bool create = true );
92 AtkObject * atk_object_wrapper_new(
93 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
94 AtkObject* parent = NULL );
96 void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
97 void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
99 void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);
101 AtkStateType mapAtkState( sal_Int16 nState );
103 void actionIfaceInit(AtkActionIface *iface);
104 void componentIfaceInit(AtkComponentIface *iface);
105 void editableTextIfaceInit(AtkEditableTextIface *iface);
106 void hypertextIfaceInit(AtkHypertextIface *iface);
107 void imageIfaceInit(AtkImageIface *iface);
108 void selectionIfaceInit(AtkSelectionIface *iface);
109 void tableIfaceInit(AtkTableIface *iface);
110 void textIfaceInit(AtkTextIface *iface);
111 void valueIfaceInit(AtkValueIface *iface);
113 } // extern "C"
115 #define ATK_TYPE_OBJECT_WRAPPER atk_object_wrapper_get_type()
116 #define ATK_OBJECT_WRAPPER(obj) \
117 (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_WRAPPER, AtkObjectWrapper))
119 static inline gchar *
120 OUStringToGChar(const rtl::OUString& rString )
122 rtl::OString aUtf8 = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
123 return g_strdup( aUtf8 );
126 #define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
128 #endif /* __ATK_WRAPPER_HXX__ */