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