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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_INC_ACCESSIBLECHARTVIEW_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_INC_ACCESSIBLECHARTVIEW_HXX
22 #include "AccessibleBase.hxx"
23 #include "MutexContainer.hxx"
24 #include <cppuhelper/implbase2.hxx>
25 #include <cppuhelper/weakref.hxx>
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include <com/sun/star/lang/XInitialization.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <com/sun/star/view/XSelectionSupplier.hpp>
32 #include <com/sun/star/view/XSelectionChangeListener.hpp>
33 #include <com/sun/star/awt/XWindow.hpp>
35 #include <boost/shared_ptr.hpp>
37 namespace accessibility
39 class IAccessibleViewForwarder
;
45 class ExplicitValueProvider
;
49 typedef ::cppu::ImplInheritanceHelper2
<
50 ::chart::AccessibleBase
,
51 ::com::sun::star::lang::XInitialization
,
52 ::com::sun::star::view::XSelectionChangeListener
>
53 AccessibleChartView_Base
;
56 class AccessibleChartView
:
57 public impl::AccessibleChartView_Base
61 const ::com::sun::star::uno::Reference
<
62 ::com::sun::star::uno::XComponentContext
>& xContext
, SdrView
* pView
);
63 virtual ~AccessibleChartView();
65 // ____ WeakComponentHelper (called from XComponent::dispose()) ____
66 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
68 // ____ lang::XInitialization ____
69 // 0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
70 // 1: frame::XModel representing the chart model - offers access to object data
71 // 2: lang::XInterface representing the normal chart view - offers access to some extra object data
72 // 3: accessibility::XAccessible representing the parent accessible
73 // 4: awt::XWindow representing the view's window (is a vcl Window)
74 // all arguments are only valid until next initialization - don't keep them longer
75 virtual void SAL_CALL
initialize(
76 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
77 throw (::com::sun::star::uno::Exception
,
78 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 // ____ view::XSelectionChangeListener ____
81 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 // ________ XEventListener ________
84 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 // ________ XAccessibleContext ________
87 virtual OUString SAL_CALL
getAccessibleDescription()
88 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleParent()
90 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual sal_Int32 SAL_CALL
getAccessibleIndexInParent()
92 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 virtual OUString SAL_CALL
getAccessibleName()
94 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 virtual sal_Int16 SAL_CALL
getAccessibleRole()
96 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 // ________ XAccessibleComponent ________
99 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual ::com::sun::star::awt::Point SAL_CALL
getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 // ________ AccessibleChartElement ________
104 virtual ::com::sun::star::awt::Point
GetUpperLeftOnScreen() const SAL_OVERRIDE
;
107 /** @return the result that m_xWindow->getPosSize() _should_ return. It
108 returns (0,0) as upper left corner. When calling
109 getAccessibleParent, you get the parent's parent, which contains
110 a decoration. Thus you have an offset of (currently) (2,2)
111 which isn't taken into account.
113 ::com::sun::star::awt::Rectangle
GetWindowPosSize() const;
115 ExplicitValueProvider
* getExplicitValueProvider();
118 ::com::sun::star::uno::Reference
<
119 ::com::sun::star::uno::XComponentContext
> m_xContext
;
120 ::com::sun::star::uno::WeakReference
<
121 ::com::sun::star::view::XSelectionSupplier
> m_xSelectionSupplier
;
122 ::com::sun::star::uno::WeakReference
<
123 ::com::sun::star::frame::XModel
> m_xChartModel
;
124 ::com::sun::star::uno::WeakReference
<
125 ::com::sun::star::uno::XInterface
> m_xChartView
;
126 ::com::sun::star::uno::WeakReference
<
127 ::com::sun::star::awt::XWindow
> m_xWindow
;
128 ::com::sun::star::uno::WeakReference
<
129 ::com::sun::star::accessibility::XAccessible
> m_xParent
;
131 ::boost::shared_ptr
< ObjectHierarchy
> m_spObjectHierarchy
;
132 AccessibleUniqueId m_aCurrentSelectionOID
;
134 ::accessibility::IAccessibleViewForwarder
* m_pViewForwarder
;
136 //no default constructor
137 AccessibleChartView();
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */