1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEEDITOBJECT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEEDITOBJECT_HXX
23 #include "AccessibleContextBase.hxx"
25 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
27 #include <vcl/window.hxx>
29 namespace accessibility
31 class AccessibleTextHelper
;
34 namespace vcl
{ class Window
; }
37 This base class provides an implementation of the
38 <code>AccessibleCell</code> service.
40 class ScAccessibleEditObject
41 : public ScAccessibleContextBase
,
42 public ::com::sun::star::accessibility::XAccessibleSelection
52 ScAccessibleEditObject(
53 const ::com::sun::star::uno::Reference
<
54 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
55 EditView
* pEditView
, vcl::Window
* pWin
, const OUString
& rName
,
56 const OUString
& rDescription
, EditObjectType eObjectType
);
59 virtual ~ScAccessibleEditObject();
61 using ScAccessibleContextBase::IsDefunc
;
64 using ScAccessibleContextBase::disposing
;
66 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
71 ///===== XInterface =====================================================
73 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
74 ::com::sun::star::uno::Type
const & rType
)
75 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
77 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
79 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
80 ///===== XAccessibleComponent ============================================
82 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
83 SAL_CALL
getAccessibleAtPoint(
84 const ::com::sun::star::awt::Point
& rPoint
)
85 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 /// Return the object's current bounding box relative to the desktop.
89 virtual Rectangle
GetBoundingBoxOnScreen() const
90 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 /// Return the object's current bounding box relative to the parent object.
93 virtual Rectangle
GetBoundingBox() const
94 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 ///===== XAccessibleContext ==============================================
99 /// Return the number of currently visible children.
100 /// override to calculate this on demand
101 virtual sal_Int32 SAL_CALL
102 getAccessibleChildCount()
103 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 /// Return the specified child or NULL if index is invalid.
106 /// override to calculate this on demand
107 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
108 getAccessibleChild(sal_Int32 nIndex
)
109 throw (::com::sun::star::uno::RuntimeException
,
110 ::com::sun::star::lang::IndexOutOfBoundsException
, std::exception
) SAL_OVERRIDE
;
112 /// Return the set of current states.
113 virtual ::com::sun::star::uno::Reference
<
114 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
115 getAccessibleStateSet()
116 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 //===== XAccessibleSelection ============================================
120 virtual void SAL_CALL
selectAccessibleChild(
121 sal_Int32 nChildIndex
)
122 throw ( ::com::sun::star::lang::IndexOutOfBoundsException
,
123 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual sal_Bool SAL_CALL
isAccessibleChildSelected(
125 sal_Int32 nChildIndex
)
126 throw ( ::com::sun::star::lang::IndexOutOfBoundsException
,
127 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
clearAccessibleSelection( )
129 throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
130 virtual void SAL_CALL
selectAllAccessibleChildren( )
131 throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
132 virtual sal_Int32 SAL_CALL
getSelectedAccessibleChildCount( )
133 throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
134 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getSelectedAccessibleChild(
135 sal_Int32 nSelectedChildIndex
)
136 throw ( ::com::sun::star::lang::IndexOutOfBoundsException
,
137 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
138 virtual void SAL_CALL
deselectAccessibleChild(
139 sal_Int32 nSelectedChildIndex
)
140 throw ( ::com::sun::star::lang::IndexOutOfBoundsException
,
141 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
142 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleRelationSet
> SAL_CALL
getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
144 /// Return this object's description.
145 virtual OUString SAL_CALL
146 createAccessibleDescription()
147 throw (::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
149 /// Return the object's current name.
150 virtual OUString SAL_CALL
151 createAccessibleName()
152 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
155 ///===== XAccessibleEventBroadcaster =====================================
157 /** Add listener that is informed of future changes of name,
158 description and so on events.
160 virtual void SAL_CALL
161 addAccessibleEventListener(
162 const ::com::sun::star::uno::Reference
<
163 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
164 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
166 // Remove an existing event listener.
167 virtual void SAL_CALL
168 removeAccessibleEventListener(
169 const ::com::sun::star::uno::Reference
<
170 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
171 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
173 ///===== XServiceInfo ====================================================
175 /** Returns an identifier for the implementation of this object.
177 virtual OUString SAL_CALL
178 getImplementationName()
179 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
181 ///===== XTypeProvider ===================================================
183 /** Returns a implementation id.
185 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
186 getImplementationId()
187 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
190 accessibility::AccessibleTextHelper
* mpTextHelper
;
191 EditView
* mpEditView
;
192 VclPtr
<vcl::Window
> mpWindow
;
193 EditObjectType meObjectType
;
197 const com::sun::star::uno::Reference
<
198 ::com::sun::star::accessibility::XAccessibleStateSet
>& rxParentStates
);
200 void CreateTextHelper();
201 ScDocument
*m_pScDoc
;
202 ScAddress m_curCellAddress
;
204 ///===== XAccessibleComponent ============================================
205 virtual sal_Int32 SAL_CALL
getForeground( )
206 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
208 virtual sal_Int32 SAL_CALL
getBackground( )
209 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
211 sal_Int32
GetFgBgColor( const rtl::OUString
&strPropColor
) ;
216 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */