30#include <inputwin.hxx>
32#include <com/sun/star/accessibility/AccessibleRole.hpp>
33#include <com/sun/star/accessibility/AccessibleStateType.hpp>
34#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
35#include <com/sun/star/sheet/XSpreadsheet.hpp>
36#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
39#include <editeng/editeng.hxx>
46#include <unonames.hxx>
47#include <document.hxx>
49#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
51#include <com/sun/star/accessibility/XAccessibleText.hpp>
53using ::com::sun::star::lang::IndexOutOfBoundsException;
60 const uno::Reference<XAccessible>& rxParent,
62 const OUString& rDescription, EditObjectType eObjectType)
64 , mpEditView(pEditView)
67 , meObjectType(eObjectType)
71 InitAcc(rxParent, pEditView, rName, rDescription);
79 , meObjectType(eObjectType)
86 const uno::Reference<XAccessible>& rxParent,
88 const OUString& rName,
89 const OUString& rDescription)
145css::uno::Any SAL_CALL
148 css::uno::Any aReturn = ScAccessibleContextBase::queryInterface (rType);
149 if ( ! aReturn.hasValue())
150 aReturn = ::cppu::queryInterface (rType,
151 static_cast< css::accessibility::XAccessibleSelection*
>(
this)
159 ScAccessibleContextBase::acquire ();
165 ScAccessibleContextBase::release ();
170 const awt::Point& rPoint )
172 uno::Reference<XAccessible> xRet;
202 aScreenBounds.
SetPos( aPos );
207 aScreenBounds =
mpWindow->GetWindowExtentsAbsolute();
211 return aScreenBounds;
220 uno::Reference< XAccessible > xThis(
mpWindow->GetAccessible() );
223 uno::Reference< XAccessibleContext > xContext( xThis->getAccessibleContext() );
226 uno::Reference< XAccessible > xParent( xContext->getAccessibleParent() );
229 uno::Reference< XAccessibleComponent > xParentComponent( xParent->getAccessibleContext(), uno::UNO_QUERY );
230 if ( xParentComponent.is() )
233 awt::Point aParentScreenLoc = xParentComponent->getLocationOnScreen();
234 Point aPos( aScreenLoc.
getX() - aParentScreenLoc.X, aScreenLoc.
getY() - aParentScreenLoc.Y );
256uno::Reference< XAccessible > SAL_CALL
268 sal_Int64 nParentStates = 0;
271 uno::Reference<XAccessibleContext> xParentContext =
getAccessibleParent()->getAccessibleContext();
272 nParentStates = xParentContext->getAccessibleStateSet();
274 sal_Int64 nStateSet = 0;
276 nStateSet |= AccessibleStateType::DEFUNC;
280 nStateSet |= AccessibleStateType::EDITABLE;
281 nStateSet |= AccessibleStateType::ENABLED;
282 nStateSet |= AccessibleStateType::SENSITIVE;
283 nStateSet |= AccessibleStateType::MULTI_LINE;
284 nStateSet |= AccessibleStateType::MULTI_SELECTABLE;
285 nStateSet |= AccessibleStateType::SHOWING;
286 nStateSet |= AccessibleStateType::VISIBLE;
301 OSL_FAIL(
"Should never be called, because is set in the constructor.");
331 return "ScAccessibleEditObject";
336uno::Sequence<sal_Int8> SAL_CALL
339 return css::uno::Sequence<sal_Int8>();
347 (nParentStates & AccessibleStateType::DEFUNC);
360 ::std::unique_ptr < ScAccessibleTextData > pAccessibleTextData;
363 pAccessibleTextData.reset
368 pAccessibleTextData.reset
372 std::unique_ptr<ScAccessibilityEditSource> pEditSrc =
373 std::make_unique<ScAccessibilityEditSource>(std::move(pAccessibleTextData));
375 mpTextHelper = std::make_unique<::accessibility::AccessibleTextHelper>(std::move(pEditSrc));
392 if( pInputHdl && !pInputHdl->
IsTopMode() )
394 SdrHint aHint( SdrHintKind::BeginEdit );
395 mpTextHelper->GetEditSource().GetBroadcaster().Broadcast( aHint );
419 uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( pObjSh->
GetModel(), uno::UNO_QUERY );
420 if ( xSpreadDoc.is() )
422 uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets();
423 uno::Reference<container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY );
427 uno::Reference<sheet::XSpreadsheet> xTable;
433 uno::Reference<beans::XPropertySet> xCellProps(xCell, uno::UNO_QUERY);
436 uno::Any aAny = xCellProps->getPropertyValue(strPropColor);
456 uno::Reference<XAccessibleContext> xContext;
458 xContext = xAcc->getAccessibleContext();
461 if( xContext->getAccessibleRole() == AccessibleRole::PARAGRAPH )
463 uno::Reference< css::accessibility::XAccessibleText >
464 xText(xAcc, uno::UNO_QUERY);
467 if( xText->getSelectionStart() >= 0 )
return true;
486 for( sal_Int64
i = 0;
i < TotalCount;
i++ )
494 throw IndexOutOfBoundsException();
499 if( i2 == nSelectedChildIndex )
503 return uno::Reference<XAccessible>();
518 if ( pLabeledBy && pLabeledBy != pWindow )
520 uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pLabeledBy->
GetAccessible() };
521 rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::LABELED_BY, aSequence ) );
524 if ( pMemberOf && pMemberOf != pWindow )
526 uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->
GetAccessible() };
527 rRelationSet->AddRelation( AccessibleRelation( AccessibleRelationType::MEMBER_OF, aSequence ) );
531 return uno::Reference< XAccessibleRelationSet >();
544 return aScreenBounds;
554 uno::Reference< XAccessible > xParent( xContext->getAccessibleParent() );
557 uno::Reference< XAccessibleComponent > xParentComponent( xParent->getAccessibleContext(), uno::UNO_QUERY );
558 if ( xParentComponent.is() )
561 awt::Point aParentScreenLoc = xParentComponent->getLocationOnScreen();
562 Point aPos( aScreenLoc.
getX() - aParentScreenLoc.X, aScreenLoc.
getY() - aParentScreenLoc.Y );
581 return uno::Reference< XAccessibleRelationSet >();
MapMode const & GetRefMapMode() const
EditEngine * GetEditEngine() const
const tools::Rectangle & GetOutputArea() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
void IsObjectValid() const
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
===== XAccessible =====================================================
virtual void SAL_CALL disposing() override
void SetDescription(const OUString &rDesc)
Use this method to set initial Description without notification.
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
void CommitFocusLost() const
Calls all FocusListener to tell they that the focus is lost.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
void CommitFocusGained() const
Calls all FocusListener to tell they that the focus is gained.
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
void SetName(const OUString &rName)
Use this method to set initial Name without notification.
void SetParent(const css::uno::Reference< css::accessibility::XAccessible > &rParent)
ScAddress GetCurCellAddress() const
ScDocument * GetDocument() const
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
virtual void SAL_CALL disposing() override
weld::CustomWidgetController * m_pController
virtual OutputDevice * GetOutputDeviceForView() override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
ScAccessibleEditLineObject(ScTextWnd *pTextWnd)
@descr This base class provides an implementation of the AccessibleCell service.
std::unique_ptr< accessibility::AccessibleTextHelper > mpTextHelper
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual OutputDevice * GetOutputDeviceForView()
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
VclPtr< vcl::Window > mpWindow
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or NULL if index is invalid.
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) override
===== XInterface =====================================================
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int32 SAL_CALL getBackground() override
ScAccessibleEditObject(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, EditView *pEditView, vcl::Window *pWin, const OUString &rName, const OUString &rDescription, EditObjectType eObjectType)
EditObjectType meObjectType
void InitAcc(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, EditView *pEditView, const OUString &rName, const OUString &rDescription)
virtual sal_Int32 SAL_CALL getForeground() override
===== XAccessibleComponent ============================================
sal_Int32 GetFgBgColor(const OUString &strPropColor)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
virtual OUString createAccessibleDescription() override
Return this object's description.
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual OUString createAccessibleName() override
Return the object's current name.
virtual void SAL_CALL acquire() noexcept override
virtual ~ScAccessibleEditObject() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
===== XTypeProvider ===================================================
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
===== XAccessibleContext ==============================================
virtual void SAL_CALL clearAccessibleSelection() override
ScAddress m_curCellAddress
virtual void SAL_CALL release() noexcept override
SfxObjectShell * GetDocumentShell() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
vcl::Window * GetAccessibleRelationLabeledBy() const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
vcl::Window * GetAccessibleRelationMemberOf() const
virtual OutputDevice & get_ref_device()=0
virtual a11yrelationset get_accessible_relation_set()=0
virtual Point get_accessible_location_on_screen()=0
constexpr OUStringLiteral SC_UNONAME_CCOLOR
constexpr OUStringLiteral SC_UNONAME_CELLBACK
VclPtr< vcl::Window > mpWindow