summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-30 13:46:11 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-03-30 13:46:11 +0200
commit21cdc409181bc82a5aec83a1f09f62984b12537f (patch)
tree91f55d0cabf5995fc50c12fbe8a584f480e315c5 /sd
parentfc9d2b013fe73e9abbb39fdcf44746a564d418ac (diff)
slidecopy: A11Y for the ToolPanelDeck VCL control
Diffstat (limited to 'sd')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/PaneChildWindows.cxx2
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/taskpane/ControlContainer.hxx1
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/ToolPanelDeck.cxx8
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/ToolPanelDrawer.cxx48
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/ToolPanelDrawer.hxx8
-rwxr-xr-x[-rw-r--r--]sd/source/ui/toolpanel/ToolPanelViewShell.cxx39
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/sdwindow.cxx70
7 files changed, 121 insertions, 55 deletions
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx
index 552428bfd13e..a06af1a0467d 100644..100755
--- a/sd/source/ui/dlg/PaneChildWindows.cxx
+++ b/sd/source/ui/dlg/PaneChildWindows.cxx
@@ -147,7 +147,7 @@ LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_nId, SfxBindings* i_pBindings,
SfxChildWinInfo* i_pChildWindowInfo )
:PaneChildWindow( i_pParentWindow, i_nId, i_pBindings, i_pChildWindowInfo,
- FLT_TOOL_PANEL_DOCKING_WINDOW, STR_RIGHT_PANE_TITLE, SFX_ALIGN_NOALIGNMENT )
+ FLT_TOOL_PANEL_DOCKING_WINDOW, STR_RIGHT_PANE_TITLE, SFX_ALIGN_RIGHT )
{
}
diff --git a/sd/source/ui/inc/taskpane/ControlContainer.hxx b/sd/source/ui/inc/taskpane/ControlContainer.hxx
index 57312cfc9417..90164d3fdfad 100644..100755
--- a/sd/source/ui/inc/taskpane/ControlContainer.hxx
+++ b/sd/source/ui/inc/taskpane/ControlContainer.hxx
@@ -31,7 +31,6 @@
#ifndef SD_TOOLPANEL_CONTROL_CONTAINER_HXX
#define SD_TOOLPANEL_CONTROL_CONTAINER_HXX
-#include "TitleBar.hxx"
#include <osl/mutex.hxx>
#include <vector>
diff --git a/sd/source/ui/toolpanel/ToolPanelDeck.cxx b/sd/source/ui/toolpanel/ToolPanelDeck.cxx
index 25d8bb45c012..a6fc04ded305 100644..100755
--- a/sd/source/ui/toolpanel/ToolPanelDeck.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelDeck.cxx
@@ -32,6 +32,8 @@
#include "taskpane/ControlContainer.hxx"
#include "framework/FrameworkHelper.hxx"
#include "TaskPaneToolPanel.hxx"
+#include "strings.hrc"
+#include "sdresid.hxx"
/** === begin UNO includes === **/
#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
@@ -71,6 +73,10 @@ namespace sd { namespace toolpanel
,m_rViewShell( i_rViewShell )
{
SetDrawersLayout();
+
+ const String sPaneTitle( SdResId( STR_RIGHT_PANE_TITLE ) );
+ SetAccessibleName( sPaneTitle );
+ SetAccessibleDescription( sPaneTitle );
}
//------------------------------------------------------------------------------------------------------------------
@@ -140,7 +146,7 @@ namespace sd { namespace toolpanel
// this is a de-activate request. Quite improbable that this really happens: We're within the overloaded
// version of IToolPanelDeck::ActivatePanel. The only instance which has access to this IToolPanel
// interface is the panel layouter, which is not expected to call us with a NULL panel position.
- // All other instances should now have access to this method, as it is protected in this class here.
+ // All other instances should not have access to this method, as it is protected in this class here.
OSL_ENSURE( false, "ToolPanelDeck::ActivatePanel: is this legitimate?" );
// well, handle it nonetheless.
ActivatePanelDirectly( i_rPanel );
diff --git a/sd/source/ui/toolpanel/ToolPanelDrawer.cxx b/sd/source/ui/toolpanel/ToolPanelDrawer.cxx
index a52771650a04..065f1b3a5011 100644..100755
--- a/sd/source/ui/toolpanel/ToolPanelDrawer.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelDrawer.cxx
@@ -36,6 +36,11 @@ namespace sd { namespace toolpanel
{
//......................................................................................................................
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::accessibility::XAccessible;
+ /** === end UNO using === **/
+
//==================================================================================================================
//= ToolPanelDrawer
//==================================================================================================================
@@ -127,6 +132,42 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
+ ::boost::optional< size_t > ToolPanelDrawer::GetPanelItemFromScreenPos( const ::Point& i_rScreenPos )
+ {
+ for ( ::std::vector< PTitleBar >::const_iterator drawer = m_aDrawers.begin();
+ drawer != m_aDrawers.end();
+ ++drawer
+ )
+ {
+ const Rectangle aDrawerBounds(
+ m_rParentWindow.OutputToScreenPixel( (*drawer)->GetWindow()->GetPosPixel() ),
+ (*drawer)->GetWindow()->GetSizePixel()
+ );
+ if ( aDrawerBounds.IsInside( i_rScreenPos ) )
+ return ::boost::optional< size_t >( drawer - m_aDrawers.begin() );
+ }
+ return ::boost::optional< size_t >();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > ToolPanelDrawer::GetPanelItemAccessible( const size_t i_nItemPos, const Reference< XAccessible >& i_rParentAccessible )
+ {
+ ENSURE_OR_RETURN( i_nItemPos < m_aDrawers.size(), "illegal index", NULL );
+
+ const PTitleBar pTitleBar( m_aDrawers[ i_nItemPos ] );
+ Window* pItemWindow( pTitleBar->GetWindow() );
+
+ Reference< XAccessible > xItemAccessible( pItemWindow->GetAccessible( FALSE ) );
+ if ( !xItemAccessible.is() )
+ {
+ xItemAccessible = pTitleBar->CreateAccessibleObject( i_rParentAccessible );
+ pItemWindow->SetAccessible( xItemAccessible );
+ }
+
+ return xItemAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
void ToolPanelDrawer::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition )
{
OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "ToolPanelDrawer::PanelInserted: inconsistency!" );
@@ -172,6 +213,13 @@ namespace sd { namespace toolpanel
}
//------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter )
+ {
+ // not interested in
+ (void)i_rNewLayouter;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
size_t ToolPanelDrawer::impl_getPanelPositionFromWindow( const Window* i_pTitleBarWindow ) const
{
for ( ::std::vector< PTitleBar >::const_iterator drawerPos = m_aDrawers.begin();
diff --git a/sd/source/ui/toolpanel/ToolPanelDrawer.hxx b/sd/source/ui/toolpanel/ToolPanelDrawer.hxx
index 005194ab6a2b..8c31e66ede92 100644..100755
--- a/sd/source/ui/toolpanel/ToolPanelDrawer.hxx
+++ b/sd/source/ui/toolpanel/ToolPanelDrawer.hxx
@@ -65,11 +65,19 @@ namespace sd { namespace toolpanel
virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
virtual void Destroy();
virtual void SetFocusToPanelSelector();
+ ::boost::optional< size_t >
+ GetPanelItemFromScreenPos( const ::Point& i_rScreenPos );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetPanelItemAccessible(
+ const size_t i_nItemPos,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
// IToolPanelDeckListener
virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition );
virtual void PanelRemoved( const size_t i_nPosition );
virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter );
virtual void Dying();
private:
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
index f4050cff9de1..dc3d0a48c2e7 100644..100755
--- a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
+++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
@@ -261,11 +261,15 @@ public:
*/
void DeactivatePanelDirectly( const PanelId i_nPanelId );
+ Reference< XAccessible >
+ CreateAccessible( ::sd::Window& i_rWindow );
+
protected:
// IToolPanelDeckListener overridables
virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition );
virtual void PanelRemoved( const size_t i_nPosition );
virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter );
virtual void Dying();
private:
@@ -994,24 +998,10 @@ DockingWindow* ToolPanelViewShell::GetDockingWindow()
}
// ---------------------------------------------------------------------------------------------------------------------
-Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* pWindow )
+Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow )
{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> xAccessible;
-
- OSL_ENSURE( false, "ToolPanelViewShell::CreateAccessibleDocumentView: missing implementation!" );
-// if (mpTaskPane.get()!=NULL && pWindow!=NULL)
-// {
-// // We have to call CreateAccessible directly so that we can specify
-// // the correct accessible parent.
-// ::Window* pParentWindow = pWindow->GetAccessibleParentWindow();
-// if (pParentWindow != NULL)
-// xAccessible = mpTaskPane->CreateAccessibleObject(
-// pParentWindow->GetAccessible());
-// }
- (void)pWindow;
-
- return xAccessible;
+ ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL );
+ return mpImpl->CreateAccessible( *i_pWindow );
}
// ---------------------------------------------------------------------------------------------------------------------
@@ -1226,11 +1216,26 @@ void ToolPanelViewShell_Impl::ActivePanelChanged( const ::boost::optional< size_
}
// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter )
+{
+ // not interested in
+ (void)i_rNewLayouter;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
void ToolPanelViewShell_Impl::Dying()
{
}
// ---------------------------------------------------------------------------------------------------------------------
+Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window& i_rWindow )
+{
+ ::Window* pAccessibleParent = i_rWindow.GetAccessibleParentWindow();
+ m_pPanelDeck->SetAccessibleParentWindow( pAccessibleParent );
+ return m_pPanelDeck->GetAccessible();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
PanelId GetStandardPanelId( const ::rtl::OUString& i_rTaskPanelResourceURL )
{
PanelId ePanelId( PID_UNKNOWN );
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index e3c3ab3a7e95..6da9c3437eb9 100644..100755
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -37,8 +37,8 @@
#include <sfx2/viewfrm.hxx>
-#include <svx/outliner.hxx>
-
+#include <svx/outliner.hxx>
+
#include <svx/editview.hxx>
#include "app.hrc"
@@ -1209,38 +1209,38 @@ void Window::DropScroll(const Point& rMousePos)
}
}
-XubString Window::GetSurroundingText() const
-{
- if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
- {
- return XubString();
- }
- else if ( mpViewShell->GetView()->IsTextEdit() )
- {
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingText();
- }
- else
- {
- return XubString();
- }
-}
-
-Selection Window::GetSurroundingTextSelection() const
-{
- if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
- {
- return Selection( 0, 0 );
- }
- else if ( mpViewShell->GetView()->IsTextEdit() )
- {
- OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
- return pOLV->GetEditView().GetSurroundingTextSelection();
- }
- else
- {
- return Selection( 0, 0 );
- }
-}
+XubString Window::GetSurroundingText() const
+{
+ if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
+ {
+ return XubString();
+ }
+ else if ( mpViewShell->GetView()->IsTextEdit() )
+ {
+ OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
+ return pOLV->GetEditView().GetSurroundingText();
+ }
+ else
+ {
+ return XubString();
+ }
+}
+
+Selection Window::GetSurroundingTextSelection() const
+{
+ if ( mpViewShell->GetShellType() == ViewShell::ST_OUTLINE )
+ {
+ return Selection( 0, 0 );
+ }
+ else if ( mpViewShell->GetView()->IsTextEdit() )
+ {
+ OutlinerView *pOLV = mpViewShell->GetView()->GetTextEditOutlinerView();
+ return pOLV->GetEditView().GetSurroundingTextSelection();
+ }
+ else
+ {
+ return Selection( 0, 0 );
+ }
+}
} // end of namespace sd