summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-21 10:04:47 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-22 16:29:39 +0000
commitc294a21d6644ccdda63824da525621f77f4a7eac (patch)
tree56d989d0e805f578adbcafb290394ce65b5ab7d6 /vcl
parente9b0e18b4f5b14e29d9ddf3bef0c8030fba1cdb4 (diff)
revert removal of used a11y code
reverting the a11y parts of bc34a22e76775799e068cfa2617152da4c608e7d so that we can now make use of them Change-Id: I8090a2f9602743628d3b948338b45ed2252501eb
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/window.hxx3
-rw-r--r--vcl/source/window/dlgctrl.cxx55
-rw-r--r--vcl/source/window/window.cxx7
3 files changed, 65 insertions, 0 deletions
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index bdb588583c0c..d9aa034716c9 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -1004,9 +1004,12 @@ public:
void SetAccessibleRelationLabeledBy( Window* pLabeledBy );
Window* GetAccessibleRelationLabeledBy() const;
+ void SetAccessibleRelationLabelFor( Window* pLabelFor );
Window* GetAccessibleRelationLabelFor() const;
void SetAccessibleRelationMemberOf( Window* pMemberOf );
+ Window* GetAccessibleRelationMemberOf() const;
+
// to avoid sending accessibility events in cases like closing dialogs
// by default checks complete parent path
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 6c481da574a6..28b09105ebb5 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1332,6 +1332,61 @@ Window* Window::GetAccessibleRelationLabeledBy() const
return pWindow;
}
+Window* Window::GetAccessibleRelationMemberOf() const
+{
+ Window* pWindow = NULL;
+ Window* pFrameWindow = GetParent();
+ if ( !pFrameWindow )
+ {
+ pFrameWindow = ImplGetFrameWindow();
+ }
+ // if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+ if( !( GetType() == WINDOW_FIXEDLINE ||
+ GetType() == WINDOW_GROUPBOX ) )
+ {
+ // search for a control that makes member of this window
+ // it is considered the last fixed line or group box
+ // that comes before this control; with the exception of push buttons
+ // which are labeled only if the fixed line or group box
+ // is directly before the control
+ // get form start and form end and index of this control
+ sal_uInt16 nIndex, nFormStart, nFormEnd;
+ Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow,
+ const_cast<Window*>(this),
+ nIndex,
+ nFormStart,
+ nFormEnd );
+ if( pSWindow && nIndex != nFormStart )
+ {
+ if( GetType() == WINDOW_PUSHBUTTON ||
+ GetType() == WINDOW_HELPBUTTON ||
+ GetType() == WINDOW_OKBUTTON ||
+ GetType() == WINDOW_CANCELBUTTON )
+ {
+ nFormStart = nIndex-1;
+ }
+ for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- )
+ {
+ sal_uInt16 nFoundIndex = 0;
+ pSWindow = ::ImplGetChildWindow( pFrameWindow,
+ nSearchIndex,
+ nFoundIndex,
+ sal_False );
+ if( pSWindow && pSWindow->IsVisible() &&
+ ( pSWindow->GetType() == WINDOW_FIXEDLINE ||
+ pSWindow->GetType() == WINDOW_GROUPBOX ) )
+ {
+ pWindow = pSWindow;
+ break;
+ }
+ if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
+ break;
+ }
+ }
+ }
+ return pWindow;
+}
+
// -----------------------------------------------------------------------
KeyEvent Window::GetActivationKey() const
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index baf4658bb867..34b2d49c3568 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -8966,6 +8966,13 @@ void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy )
mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy;
}
+void Window::SetAccessibleRelationLabelFor( Window* pLabelFor )
+{
+ if ( !mpWindowImpl->mpAccessibleInfos )
+ mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
+ mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor;
+}
+
void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin )
{
if ( !mpWindowImpl->mpAccessibleInfos )