2004-07-13 08:40:12 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
2008-04-10 16:28:29 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-07-13 08:40:12 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 13:16:21 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2005-07-14 04:23:06 -05:00
|
|
|
#include "taskpane/TitledControl.hxx"
|
2004-07-13 08:40:12 -05:00
|
|
|
|
2005-07-14 04:23:06 -05:00
|
|
|
#include "AccessibleTreeNode.hxx"
|
|
|
|
#include "taskpane/ControlContainer.hxx"
|
2004-07-13 08:40:12 -05:00
|
|
|
#include "TaskPaneFocusManager.hxx"
|
2005-03-18 09:59:16 -06:00
|
|
|
#include "taskpane/TaskPaneControlFactory.hxx"
|
2004-07-13 08:40:12 -05:00
|
|
|
#include <vcl/ctrl.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
namespace sd { namespace toolpanel {
|
|
|
|
|
|
|
|
|
|
|
|
TitledControl::TitledControl (
|
|
|
|
TreeNode* pParent,
|
|
|
|
::std::auto_ptr<TreeNode> pControl,
|
|
|
|
const String& rTitle,
|
2007-04-03 10:21:29 -05:00
|
|
|
const ClickHandler& rClickHandler,
|
2004-07-13 08:40:12 -05:00
|
|
|
TitleBar::TitleBarType eType)
|
|
|
|
: ::Window (pParent->GetWindow(), WB_TABSTOP),
|
|
|
|
TreeNode(pParent),
|
2005-04-08 10:18:03 -05:00
|
|
|
msTitle(rTitle),
|
|
|
|
mbVisible(true),
|
|
|
|
mpUserData(NULL),
|
|
|
|
mpControlFactory(NULL),
|
2007-04-03 10:21:29 -05:00
|
|
|
mpClickHandler(new ClickHandler(rClickHandler)),
|
2005-03-23 07:14:26 -06:00
|
|
|
mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
|
|
|
if (pControl.get() != NULL)
|
|
|
|
{
|
|
|
|
mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
|
|
|
|
new TitleBar (this, rTitle, eType, pControl->IsExpandable())));
|
|
|
|
pControl->SetParentNode (this);
|
|
|
|
}
|
|
|
|
mpControlContainer->AddControl (pControl);
|
|
|
|
|
2005-07-14 04:23:06 -05:00
|
|
|
FocusManager::Instance().RegisterDownLink(this, GetControl()->GetWindow());
|
|
|
|
FocusManager::Instance().RegisterUpLink(GetControl()->GetWindow(), this);
|
2004-07-13 08:40:12 -05:00
|
|
|
|
|
|
|
SetBackground (Wallpaper());
|
|
|
|
|
|
|
|
GetTitleBar()->GetWindow()->Show ();
|
|
|
|
GetTitleBar()->GetWindow()->AddEventListener (
|
|
|
|
LINK(this,TitledControl,WindowEventListener));
|
|
|
|
|
|
|
|
UpdateStates ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:59:16 -06:00
|
|
|
TitledControl::TitledControl (
|
|
|
|
TreeNode* pParent,
|
|
|
|
::std::auto_ptr<ControlFactory> pControlFactory,
|
|
|
|
const String& rTitle,
|
2007-04-03 10:21:29 -05:00
|
|
|
const ClickHandler& rClickHandler,
|
2005-03-18 09:59:16 -06:00
|
|
|
TitleBar::TitleBarType eType)
|
|
|
|
: ::Window (pParent->GetWindow(), WB_TABSTOP),
|
|
|
|
TreeNode(pParent),
|
|
|
|
msTitle (rTitle),
|
|
|
|
mbVisible (true),
|
2005-03-23 07:14:26 -06:00
|
|
|
mpUserData (NULL),
|
2005-04-08 10:18:03 -05:00
|
|
|
mpControlFactory(pControlFactory),
|
2007-04-03 10:21:29 -05:00
|
|
|
mpClickHandler(new ClickHandler(rClickHandler)),
|
2005-04-08 10:18:03 -05:00
|
|
|
mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
|
2005-03-18 09:59:16 -06:00
|
|
|
{
|
|
|
|
mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
|
|
|
|
new TitleBar (this, rTitle, eType, true)));
|
|
|
|
|
|
|
|
// The second control is created on demand, i.e. when GetControl(true)
|
|
|
|
// is called the first time.
|
|
|
|
|
|
|
|
SetBackground (Wallpaper());
|
|
|
|
|
|
|
|
GetTitleBar()->GetWindow()->Show ();
|
|
|
|
GetTitleBar()->GetWindow()->AddEventListener (
|
|
|
|
LINK(this,TitledControl,WindowEventListener));
|
|
|
|
|
|
|
|
UpdateStates ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:40:12 -05:00
|
|
|
TitledControl::~TitledControl (void)
|
|
|
|
{
|
|
|
|
GetTitleBar()->GetWindow()->RemoveEventListener (
|
|
|
|
LINK(this,TitledControl,WindowEventListener));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Size TitledControl::GetPreferredSize (void)
|
|
|
|
{
|
|
|
|
Size aPreferredSize;
|
2005-03-18 09:59:16 -06:00
|
|
|
if (GetControl(false) != NULL)
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
|
|
|
aPreferredSize = GetControl()->GetPreferredSize();
|
|
|
|
if ( ! IsExpanded())
|
|
|
|
aPreferredSize.Height() = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aPreferredSize = Size (GetSizePixel().Width(), 0);
|
|
|
|
if (aPreferredSize.Width() == 0)
|
|
|
|
aPreferredSize.Width() = 300;
|
|
|
|
aPreferredSize.Height() += GetTitleBar()->GetPreferredHeight(
|
|
|
|
aPreferredSize.Width());
|
|
|
|
|
|
|
|
return aPreferredSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 TitledControl::GetPreferredWidth (sal_Int32 nHeight)
|
|
|
|
{
|
|
|
|
int nPreferredWidth = 0;
|
2005-03-18 09:59:16 -06:00
|
|
|
if (GetControl(false) != NULL)
|
2004-07-13 08:40:12 -05:00
|
|
|
nPreferredWidth = GetControl()->GetPreferredWidth(
|
|
|
|
nHeight - GetTitleBar()->GetWindow()->GetSizePixel().Height());
|
|
|
|
else
|
|
|
|
nPreferredWidth = GetSizePixel().Width();
|
|
|
|
if (nPreferredWidth == 0)
|
|
|
|
nPreferredWidth = 300;
|
|
|
|
|
|
|
|
return nPreferredWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 TitledControl::GetPreferredHeight (sal_Int32 nWidth)
|
|
|
|
{
|
|
|
|
int nPreferredHeight = 0;
|
2005-03-18 09:59:16 -06:00
|
|
|
if (IsExpanded() && GetControl(false)!=NULL)
|
2004-07-13 08:40:12 -05:00
|
|
|
nPreferredHeight = GetControl()->GetPreferredHeight(nWidth);
|
|
|
|
nPreferredHeight += GetTitleBar()->GetPreferredHeight(nWidth);
|
|
|
|
|
|
|
|
return nPreferredHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TitledControl::IsResizable (void)
|
|
|
|
{
|
|
|
|
return IsExpanded()
|
|
|
|
&& GetControl()->IsResizable();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::Window* TitledControl::GetWindow (void)
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::Resize (void)
|
|
|
|
{
|
|
|
|
Size aWindowSize (GetOutputSizePixel());
|
|
|
|
|
|
|
|
int nTitleBarHeight
|
|
|
|
= GetTitleBar()->GetPreferredHeight(aWindowSize.Width());
|
|
|
|
GetTitleBar()->GetWindow()->SetPosSizePixel (
|
|
|
|
Point (0,0),
|
|
|
|
Size (aWindowSize.Width(), nTitleBarHeight));
|
2005-03-18 09:59:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
TreeNode* pControl = GetControl(false);
|
2004-07-13 08:40:12 -05:00
|
|
|
if (pControl != NULL
|
|
|
|
&& pControl->GetWindow() != NULL
|
|
|
|
&& pControl->GetWindow()->IsVisible())
|
|
|
|
{
|
|
|
|
pControl->GetWindow()->SetPosSizePixel (
|
|
|
|
Point (0,nTitleBarHeight),
|
|
|
|
Size (aWindowSize.Width(), aWindowSize.Height()-nTitleBarHeight));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::GetFocus (void)
|
|
|
|
{
|
|
|
|
::Window::GetFocus();
|
|
|
|
if (GetTitleBar() != NULL)
|
|
|
|
GetTitleBar()->SetFocus (true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::LoseFocus (void)
|
|
|
|
{
|
|
|
|
::Window::LoseFocus();
|
|
|
|
if (GetTitleBar() != NULL)
|
|
|
|
GetTitleBar()->SetFocus (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::KeyInput (const KeyEvent& rEvent)
|
|
|
|
{
|
|
|
|
KeyCode nCode = rEvent.GetKeyCode();
|
|
|
|
if (nCode == KEY_SPACE)
|
|
|
|
{
|
|
|
|
// Toggle the expansion state of the control (when toggling is
|
|
|
|
// supported.) The focus remains on this control.
|
|
|
|
GetParentNode()->GetControlContainer().SetExpansionState (
|
|
|
|
this,
|
|
|
|
ControlContainer::ES_TOGGLE);
|
|
|
|
}
|
|
|
|
else if (nCode == KEY_RETURN)
|
|
|
|
{
|
|
|
|
// Return, also called enter, enters the control and puts the
|
|
|
|
// focus to the first child. If the control is not yet
|
|
|
|
// expanded then do that first.
|
|
|
|
GetParentNode()->GetControlContainer().SetExpansionState (
|
|
|
|
this,
|
|
|
|
ControlContainer::ES_EXPAND);
|
|
|
|
|
2005-07-14 04:23:06 -05:00
|
|
|
if ( ! FocusManager::Instance().TransferFocus(this,nCode))
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
|
|
|
// When already expanded then put focus on first child.
|
2005-03-18 09:59:16 -06:00
|
|
|
TreeNode* pControl = GetControl(false);
|
2004-07-13 08:40:12 -05:00
|
|
|
if (pControl!=NULL && IsExpanded())
|
|
|
|
if (pControl->GetWindow() != NULL)
|
|
|
|
pControl->GetWindow()->GrabFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nCode == KEY_ESCAPE)
|
|
|
|
{
|
2005-07-14 04:23:06 -05:00
|
|
|
if ( ! FocusManager::Instance().TransferFocus(this,nCode))
|
2004-07-13 08:40:12 -05:00
|
|
|
// Put focus to parent.
|
|
|
|
GetParent()->GrabFocus();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
Window::KeyInput (rEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const String& TitledControl::GetTitle (void) const
|
|
|
|
{
|
|
|
|
return msTitle;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-23 07:14:26 -06:00
|
|
|
bool TitledControl::Expand (bool bExpanded)
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
2005-03-23 07:14:26 -06:00
|
|
|
bool bExpansionStateChanged (false);
|
|
|
|
|
2009-09-09 04:19:53 -05:00
|
|
|
if (IsExpandable() && IsEnabled())
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
2005-03-23 07:14:26 -06:00
|
|
|
if (GetTitleBar()->IsExpanded() != bExpanded)
|
|
|
|
bExpansionStateChanged |= GetTitleBar()->Expand (bExpanded);
|
2005-03-18 09:59:16 -06:00
|
|
|
// Get the control. Use the bExpanded parameter as argument to
|
|
|
|
// indicate that a control is created via its factory only when it
|
|
|
|
// is to be expanded. When it is collapsed this is not necessary.
|
|
|
|
TreeNode* pControl = GetControl(bExpanded);
|
2005-03-23 07:14:26 -06:00
|
|
|
if (pControl != NULL
|
|
|
|
&& GetControl()->IsExpanded() != bExpanded)
|
|
|
|
{
|
|
|
|
bExpansionStateChanged |= pControl->Expand (bExpanded);
|
|
|
|
}
|
|
|
|
if (bExpansionStateChanged)
|
|
|
|
UpdateStates();
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
2005-03-23 07:14:26 -06:00
|
|
|
return bExpansionStateChanged;
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TitledControl::IsExpandable (void) const
|
|
|
|
{
|
2005-03-18 09:59:16 -06:00
|
|
|
const TreeNode* pControl = GetConstControl(false);
|
|
|
|
if (pControl != NULL)
|
|
|
|
return pControl->IsExpandable();
|
|
|
|
else
|
|
|
|
// When a control factory is given but the control has not yet been
|
|
|
|
// created we assume that the control is expandable.
|
|
|
|
return true;
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TitledControl::IsExpanded (void) const
|
|
|
|
{
|
2005-03-18 09:59:16 -06:00
|
|
|
const TreeNode* pControl = GetConstControl(false);
|
|
|
|
if (pControl != NULL)
|
|
|
|
return pControl->IsExpanded();
|
|
|
|
else
|
|
|
|
return false;
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
2010-02-12 09:56:44 -06:00
|
|
|
void TitledControl::SetEnabledState(bool bFlag)
|
|
|
|
{
|
|
|
|
if (!bFlag)
|
|
|
|
{
|
|
|
|
GetParentNode()->GetControlContainer().SetExpansionState (
|
|
|
|
this,
|
|
|
|
ControlContainer::ES_COLLAPSE);
|
|
|
|
Disable();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
GetParentNode()->GetControlContainer().SetExpansionState (
|
|
|
|
this,
|
|
|
|
ControlContainer::ES_EXPAND);
|
|
|
|
*/
|
|
|
|
Enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
GetTitleBar()->SetEnabledState(bFlag);
|
|
|
|
}
|
2004-07-13 08:40:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::SetUserData (void* pUserData)
|
|
|
|
{
|
|
|
|
mpUserData = pUserData;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void* TitledControl::GetUserData (void) const
|
|
|
|
{
|
|
|
|
return mpUserData;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TitledControl::IsShowing (void) const
|
|
|
|
{
|
|
|
|
return mbVisible;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::Show (bool bVisible)
|
|
|
|
{
|
|
|
|
if (mbVisible != bVisible)
|
|
|
|
{
|
|
|
|
mbVisible = bVisible;
|
|
|
|
UpdateStates ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControl::UpdateStates (void)
|
|
|
|
{
|
|
|
|
if (mbVisible)
|
|
|
|
GetWindow()->Show();
|
|
|
|
else
|
|
|
|
GetWindow()->Hide();
|
|
|
|
|
2005-03-18 09:59:16 -06:00
|
|
|
TreeNode* pControl = GetControl(false);
|
2004-07-13 08:40:12 -05:00
|
|
|
if (pControl!=NULL && pControl->GetWindow() != NULL)
|
2008-12-11 01:05:03 -06:00
|
|
|
{
|
2004-07-13 08:40:12 -05:00
|
|
|
if (IsVisible() && IsExpanded())
|
|
|
|
pControl->GetWindow()->Show();
|
|
|
|
else
|
|
|
|
pControl->GetWindow()->Hide();
|
2008-12-11 01:05:03 -06:00
|
|
|
}
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK(TitledControl, WindowEventListener,
|
|
|
|
VclSimpleEvent*, pEvent)
|
|
|
|
{
|
|
|
|
if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
|
|
|
|
{
|
|
|
|
VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
|
|
|
|
switch (pWindowEvent->GetId())
|
|
|
|
{
|
|
|
|
case VCLEVENT_WINDOW_MOUSEBUTTONUP:
|
2009-09-09 04:19:53 -05:00
|
|
|
if (IsEnabled())
|
|
|
|
(*mpClickHandler)(*this);
|
2004-07-13 08:40:12 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:59:16 -06:00
|
|
|
TreeNode* TitledControl::GetControl (bool bCreate)
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
2005-03-18 09:59:16 -06:00
|
|
|
TreeNode* pNode = mpControlContainer->GetControl(1);
|
|
|
|
if (pNode==NULL && mpControlFactory.get()!=NULL && bCreate)
|
|
|
|
{
|
|
|
|
// We have to create the control with the factory object.
|
|
|
|
::std::auto_ptr<TreeNode> pControl (mpControlFactory->CreateControl(this));//GetParentNode()));
|
|
|
|
if (pControl.get() != NULL)
|
|
|
|
{
|
|
|
|
pControl->SetParentNode(this);
|
|
|
|
mpControlContainer->AddControl(pControl);
|
|
|
|
|
|
|
|
pNode = mpControlContainer->GetControl(1);
|
2005-07-14 04:23:06 -05:00
|
|
|
FocusManager::Instance().RegisterDownLink(this, pNode->GetWindow());
|
|
|
|
FocusManager::Instance().RegisterUpLink(pNode->GetWindow(), this);
|
2005-03-18 09:59:16 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return pNode;
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:59:16 -06:00
|
|
|
const TreeNode* TitledControl::GetConstControl (bool bCreate) const
|
2004-07-13 08:40:12 -05:00
|
|
|
{
|
2005-03-18 09:59:16 -06:00
|
|
|
return const_cast<TitledControl*>(this)->GetControl(bCreate);
|
2004-07-13 08:40:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TitleBar* TitledControl::GetTitleBar (void)
|
|
|
|
{
|
|
|
|
return static_cast<TitleBar*>(mpControlContainer->GetControl(0));
|
|
|
|
}
|
|
|
|
|
2005-07-14 04:23:06 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::accessibility::XAccessible> TitledControl::CreateAccessibleObject (
|
|
|
|
const ::com::sun::star::uno::Reference<
|
2006-12-12 11:44:50 -06:00
|
|
|
::com::sun::star::accessibility::XAccessible>& )
|
2005-07-14 04:23:06 -05:00
|
|
|
{
|
|
|
|
return new ::accessibility::AccessibleTreeNode(
|
|
|
|
*this,
|
|
|
|
GetTitle(),
|
|
|
|
GetTitle(),
|
2006-01-19 05:55:22 -06:00
|
|
|
::com::sun::star::accessibility::AccessibleRole::LIST_ITEM);
|
2005-07-14 04:23:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-03 10:21:29 -05:00
|
|
|
|
|
|
|
//===== TitledControlStandardClickHandler =====================================
|
|
|
|
|
|
|
|
TitledControlStandardClickHandler::TitledControlStandardClickHandler (
|
|
|
|
ControlContainer& rControlContainer,
|
|
|
|
ControlContainer::ExpansionState eExpansionState)
|
|
|
|
: mrControlContainer(rControlContainer),
|
|
|
|
meExpansionState(eExpansionState)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TitledControlStandardClickHandler::operator () (TitledControl& rTitledControl)
|
|
|
|
{
|
|
|
|
// Toggle expansion.
|
|
|
|
mrControlContainer.SetExpansionState (&rTitledControl, meExpansionState);
|
|
|
|
}
|
|
|
|
|
2004-07-13 08:40:12 -05:00
|
|
|
} } // end of namespace ::sd::toolpanel
|