2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-29 14:02:24 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2013-10-23 19:17:00 +02:00
|
|
|
#ifndef INCLUDED_COMPHELPER_ACCESSIBLECOMPONENTHELPER_HXX
|
|
|
|
#define INCLUDED_COMPHELPER_ACCESSIBLECOMPONENTHELPER_HXX
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2003-04-24 16:25:04 +00:00
|
|
|
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
|
|
|
|
#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
|
2002-04-23 10:10:21 +00:00
|
|
|
#include <comphelper/accessiblecontexthelper.hxx>
|
|
|
|
#include <cppuhelper/implbase1.hxx>
|
|
|
|
#include <comphelper/uno3.hxx>
|
2013-11-09 13:59:36 -06:00
|
|
|
#include <comphelper/comphelperdllapi.h>
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
namespace comphelper
|
|
|
|
{
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
//= OCommonAccessibleComponent
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
/** base class encapsulating common functionality for the helper classes implementing
|
|
|
|
the XAccessibleComponent respectively XAccessibleExtendendComponent
|
|
|
|
*/
|
2005-02-16 14:50:52 +00:00
|
|
|
class COMPHELPER_DLLPUBLIC OCommonAccessibleComponent : public OAccessibleContextHelper
|
2002-04-23 10:10:21 +00:00
|
|
|
{
|
|
|
|
protected:
|
2002-05-08 14:38:36 +00:00
|
|
|
/// see the respective base class ctor for an extensive comment on this, please
|
2017-06-05 16:12:27 +02:00
|
|
|
OCommonAccessibleComponent();
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~OCommonAccessibleComponent() override;
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/// implements the calculation of the bounding rectangle - still waiting to be overwritten
|
2017-01-19 18:00:00 +01:00
|
|
|
///
|
|
|
|
/// @throws css::uno::RuntimeException
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::awt::Rectangle implGetBounds( ) = 0;
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/** non-virtual versions of the methods which can be implemented using <method>implGetBounds</method>
|
|
|
|
note: getLocationOnScreen relies on a valid parent (XAccessibleContext::getParent()->getAccessibleContext()),
|
|
|
|
which itself implements XAccessibleComponent
|
2017-01-19 18:00:00 +01:00
|
|
|
|
|
|
|
@throws css::uno::RuntimeException
|
2002-04-23 10:10:21 +00:00
|
|
|
*/
|
2017-12-04 14:20:26 +02:00
|
|
|
bool containsPoint( const css::awt::Point& aPoint );
|
2017-01-19 18:00:00 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-12-04 14:20:26 +02:00
|
|
|
css::awt::Point getLocation( );
|
2017-01-19 18:00:00 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-12-04 14:20:26 +02:00
|
|
|
css::awt::Point getLocationOnScreen( );
|
2017-01-19 18:00:00 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-12-04 14:20:26 +02:00
|
|
|
css::awt::Size getSize( );
|
2017-01-19 18:00:00 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-12-04 14:20:26 +02:00
|
|
|
css::awt::Rectangle getBounds( );
|
2002-04-23 10:10:21 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
//= OAccessibleComponentHelper
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2005-02-16 14:50:52 +00:00
|
|
|
struct OAccessibleComponentHelper_Base :
|
2015-10-19 12:51:29 +02:00
|
|
|
public ::cppu::ImplHelper1< css::accessibility::XAccessibleComponent >
|
2012-03-14 13:27:56 +01:00
|
|
|
{
|
|
|
|
protected:
|
|
|
|
~OAccessibleComponentHelper_Base() {}
|
|
|
|
};
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
/** a helper class for implementing an AccessibleContext which at the same time
|
|
|
|
supports an XAccessibleComponent interface.
|
|
|
|
*/
|
2005-02-16 14:50:52 +00:00
|
|
|
class COMPHELPER_DLLPUBLIC OAccessibleComponentHelper
|
2002-04-23 10:10:21 +00:00
|
|
|
:public OCommonAccessibleComponent
|
|
|
|
,public OAccessibleComponentHelper_Base
|
|
|
|
{
|
|
|
|
protected:
|
2017-06-05 16:12:27 +02:00
|
|
|
OAccessibleComponentHelper();
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// XInterface
|
|
|
|
DECLARE_XINTERFACE( )
|
|
|
|
DECLARE_XTYPEPROVIDER( )
|
|
|
|
|
|
|
|
// XAccessibleComponent - default implementations
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
|
|
|
|
virtual css::awt::Point SAL_CALL getLocation( ) override;
|
|
|
|
virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override;
|
|
|
|
virtual css::awt::Size SAL_CALL getSize( ) override;
|
|
|
|
virtual css::awt::Rectangle SAL_CALL getBounds( ) override;
|
2002-04-23 10:10:21 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
//= OAccessibleExtendedComponentHelper
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleExtendedComponent
|
2002-04-23 10:10:21 +00:00
|
|
|
> OAccessibleExtendedComponentHelper_Base;
|
|
|
|
|
|
|
|
/** a helper class for implementing an AccessibleContext which at the same time
|
|
|
|
supports an XAccessibleExtendedComponent interface.
|
|
|
|
*/
|
2005-02-16 14:50:52 +00:00
|
|
|
class COMPHELPER_DLLPUBLIC OAccessibleExtendedComponentHelper
|
2002-04-23 10:10:21 +00:00
|
|
|
:public OCommonAccessibleComponent
|
|
|
|
,public OAccessibleExtendedComponentHelper_Base
|
|
|
|
{
|
|
|
|
protected:
|
2017-06-05 16:12:27 +02:00
|
|
|
OAccessibleExtendedComponentHelper( );
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// XInterface
|
|
|
|
DECLARE_XINTERFACE( )
|
|
|
|
DECLARE_XTYPEPROVIDER( )
|
|
|
|
|
|
|
|
// XAccessibleComponent - default implementations
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Bool SAL_CALL containsPoint( const css::awt::Point& aPoint ) override;
|
|
|
|
virtual css::awt::Point SAL_CALL getLocation( ) override;
|
|
|
|
virtual css::awt::Point SAL_CALL getLocationOnScreen( ) override;
|
|
|
|
virtual css::awt::Size SAL_CALL getSize( ) override;
|
|
|
|
virtual css::awt::Rectangle SAL_CALL getBounds( ) override;
|
2002-04-23 10:10:21 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
} // namespace comphelper
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2002-04-23 10:10:21 +00:00
|
|
|
|
2013-10-23 19:17:00 +02:00
|
|
|
#endif // INCLUDED_COMPHELPER_ACCESSIBLECOMPONENTHELPER_HXX
|
2002-04-23 10:10:21 +00:00
|
|
|
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|