1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleChartView.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CHART2_ACCESSIBLE_CHART_VIEW_HXX
31 #define _CHART2_ACCESSIBLE_CHART_VIEW_HXX
33 #include "AccessibleBase.hxx"
34 #include "MutexContainer.hxx"
35 #include "ServiceMacros.hxx"
36 #include <cppuhelper/implbase2.hxx>
37 // header for class WeakReference
38 #include <cppuhelper/weakref.hxx>
39 #include <com/sun/star/accessibility/XAccessible.hpp>
40 #include <com/sun/star/frame/XModel.hpp>
41 #include <com/sun/star/lang/XInitialization.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/uno/XComponentContext.hpp>
44 #include <com/sun/star/view/XSelectionSupplier.hpp>
45 #include <com/sun/star/view/XSelectionChangeListener.hpp>
46 #include <com/sun/star/awt/XWindow.hpp>
48 #include <boost/shared_ptr.hpp>
50 //.............................................................................
53 //.............................................................................
55 class ExplicitValueProvider
;
56 class ObjectHierarchy
;
60 typedef ::cppu::ImplInheritanceHelper2
<
61 ::chart::AccessibleBase
,
62 ::com::sun::star::lang::XInitialization
,
63 ::com::sun::star::view::XSelectionChangeListener
>
64 AccessibleChartView_Base
;
67 class AccessibleChartView
:
68 public impl::AccessibleChartView_Base
72 const ::com::sun::star::uno::Reference
<
73 ::com::sun::star::uno::XComponentContext
> & xContext
);
74 virtual ~AccessibleChartView();
76 // ____ lang::XServiceInfo ____
77 APPHELPER_XSERVICEINFO_DECL()
78 APPHELPER_SERVICE_FACTORY_HELPER( AccessibleChartView
)
81 // ____ WeakComponentHelper (called from XComponent::dispose()) ____
82 virtual void SAL_CALL
disposing();
84 // ____ lang::XInitialization ____
85 // 0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
86 // 1: frame::XModel representing the chart model - offers access to object data
87 // 2: lang::XInterface representing the normal chart view - offers access to some extra object data
88 // 3: accessibility::XAccessible representing the parent accessible
89 // 4: awt::XWindow representing the view's window (is a vcl Window)
90 // all arguments are only valid until next initialization - don't keep them longer
91 virtual void SAL_CALL
initialize(
92 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
93 throw (::com::sun::star::uno::Exception
,
94 ::com::sun::star::uno::RuntimeException
);
96 // ____ view::XSelectionChangeListener ____
97 virtual void SAL_CALL
selectionChanged( const ::com::sun::star::lang::EventObject
& aEvent
) throw (::com::sun::star::uno::RuntimeException
);
99 // ________ XEventListener ________
100 virtual void SAL_CALL
disposing( const ::com::sun::star::lang::EventObject
& Source
) throw (::com::sun::star::uno::RuntimeException
);
102 // ________ XAccessibleContext ________
103 virtual ::rtl::OUString SAL_CALL
getAccessibleDescription()
104 throw (::com::sun::star::uno::RuntimeException
);
105 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
getAccessibleParent()
106 throw (::com::sun::star::uno::RuntimeException
);
107 virtual sal_Int32 SAL_CALL
getAccessibleIndexInParent()
108 throw (::com::sun::star::uno::RuntimeException
);
109 virtual ::rtl::OUString SAL_CALL
getAccessibleName()
110 throw (::com::sun::star::uno::RuntimeException
);
111 virtual sal_Int16 SAL_CALL
getAccessibleRole()
112 throw (::com::sun::star::uno::RuntimeException
);
114 // ________ XAccessibleComponent ________
115 virtual ::com::sun::star::awt::Rectangle SAL_CALL
getBounds() throw (::com::sun::star::uno::RuntimeException
);
116 virtual ::com::sun::star::awt::Point SAL_CALL
getLocationOnScreen() throw (::com::sun::star::uno::RuntimeException
);
118 // ________ AccessibleChartElement ________
119 virtual ::com::sun::star::awt::Point
GetUpperLeftOnScreen() const;
122 /** @return the result that m_xWindow->getPosSize() _should_ return. It
123 returns (0,0) as upper left corner. When calling
124 getAccessibleParent, you get the parent's parent, which contains
125 a decoration. Thus you have an offset of (currently) (2,2)
126 which isn't taken into account.
128 virtual ::com::sun::star::awt::Rectangle
GetWindowPosSize() const;
130 ExplicitValueProvider
* getExplicitValueProvider();
133 ::com::sun::star::uno::Reference
<
134 ::com::sun::star::uno::XComponentContext
> m_xContext
;
135 ::com::sun::star::uno::WeakReference
<
136 ::com::sun::star::view::XSelectionSupplier
> m_xSelectionSupplier
;
137 ::com::sun::star::uno::WeakReference
<
138 ::com::sun::star::frame::XModel
> m_xChartModel
;
139 ::com::sun::star::uno::WeakReference
<
140 ::com::sun::star::uno::XInterface
> m_xChartView
;
141 ::com::sun::star::uno::WeakReference
<
142 ::com::sun::star::awt::XWindow
> m_xWindow
;
143 ::com::sun::star::uno::WeakReference
<
144 ::com::sun::star::accessibility::XAccessible
> m_xParent
;
146 ::boost::shared_ptr
< ObjectHierarchy
> m_spObjectHierarchy
;
147 AccessibleUniqueId m_aCurrentSelectionCID
;
149 //no default constructor
150 AccessibleChartView();
153 //.............................................................................
155 //.............................................................................