Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef __ATK_WRAPPER_HXX__
30 : : #define __ATK_WRAPPER_HXX__
31 : :
32 : : #include <atk/atk.h>
33 : : #include <com/sun/star/accessibility/XAccessible.hpp>
34 : :
35 : : extern "C" {
36 : :
37 : : typedef struct _AtkObjectWrapper AtkObjectWrapper;
38 : : typedef struct _AtkObjectWrapperClass AtkObjectWrapperClass;
39 : :
40 : : namespace com { namespace sun { namespace star { namespace accessibility {
41 : : class XAccessibleAction;
42 : : class XAccessibleComponent;
43 : : class XAccessibleEditableText;
44 : : class XAccessibleHypertext;
45 : : class XAccessibleImage;
46 : : class XAccessibleMultiLineText;
47 : : class XAccessibleSelection;
48 : : class XAccessibleTable;
49 : : class XAccessibleText;
50 : : class XAccessibleTextMarkup;
51 : : class XAccessibleTextAttributes;
52 : : class XAccessibleValue;
53 : : } } } }
54 : :
55 : :
56 : : struct _AtkObjectWrapper
57 : : {
58 : : AtkObject aParent;
59 : :
60 : : ::com::sun::star::accessibility::XAccessible *mpAccessible;
61 : : ::com::sun::star::accessibility::XAccessibleContext *mpContext;
62 : : ::com::sun::star::accessibility::XAccessibleAction *mpAction;
63 : : ::com::sun::star::accessibility::XAccessibleComponent *mpComponent;
64 : : ::com::sun::star::accessibility::XAccessibleEditableText *mpEditableText;
65 : : ::com::sun::star::accessibility::XAccessibleHypertext *mpHypertext;
66 : : ::com::sun::star::accessibility::XAccessibleImage *mpImage;
67 : : ::com::sun::star::accessibility::XAccessibleMultiLineText *mpMultiLineText;
68 : : ::com::sun::star::accessibility::XAccessibleSelection *mpSelection;
69 : : ::com::sun::star::accessibility::XAccessibleTable *mpTable;
70 : : ::com::sun::star::accessibility::XAccessibleText *mpText;
71 : : ::com::sun::star::accessibility::XAccessibleTextMarkup *mpTextMarkup;
72 : : ::com::sun::star::accessibility::XAccessibleTextAttributes *mpTextAttributes;
73 : : ::com::sun::star::accessibility::XAccessibleValue *mpValue;
74 : :
75 : : AtkObject *child_about_to_be_removed;
76 : : gint index_of_child_about_to_be_removed;
77 : : // ::rtl::OString * m_pKeyBindings
78 : : };
79 : :
80 : : struct _AtkObjectWrapperClass
81 : : {
82 : : AtkObjectClass aParentClass;
83 : : };
84 : :
85 : : GType atk_object_wrapper_get_type (void) G_GNUC_CONST;
86 : : AtkObject * atk_object_wrapper_ref(
87 : : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
88 : : bool create = true );
89 : :
90 : : AtkObject * atk_object_wrapper_new(
91 : : const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
92 : : AtkObject* parent = NULL );
93 : :
94 : : void atk_object_wrapper_add_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
95 : : void atk_object_wrapper_remove_child(AtkObjectWrapper* wrapper, AtkObject *child, gint index);
96 : :
97 : : void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);
98 : :
99 : : AtkStateType mapAtkState( sal_Int16 nState );
100 : :
101 : : void actionIfaceInit(AtkActionIface *iface);
102 : : void componentIfaceInit(AtkComponentIface *iface);
103 : : void editableTextIfaceInit(AtkEditableTextIface *iface);
104 : : void hypertextIfaceInit(AtkHypertextIface *iface);
105 : : void imageIfaceInit(AtkImageIface *iface);
106 : : void selectionIfaceInit(AtkSelectionIface *iface);
107 : : void tableIfaceInit(AtkTableIface *iface);
108 : : void textIfaceInit(AtkTextIface *iface);
109 : : void valueIfaceInit(AtkValueIface *iface);
110 : :
111 : : } // extern "C"
112 : :
113 : : #define ATK_TYPE_OBJECT_WRAPPER atk_object_wrapper_get_type()
114 : : #define ATK_OBJECT_WRAPPER(obj) \
115 : : (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_WRAPPER, AtkObjectWrapper))
116 : :
117 : : static inline gchar *
118 : 0 : OUStringToGChar(const rtl::OUString& rString )
119 : : {
120 : 0 : rtl::OString aUtf8 = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
121 : 0 : return g_strdup( aUtf8.getStr() );
122 : : }
123 : :
124 : : #define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
125 : :
126 : : #endif /* __ATK_WRAPPER_HXX__ */
127 : :
128 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|