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: ChildrenManager.cxx,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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <svx/ChildrenManager.hxx>
34 #ifndef _SVX_ACCESSIBILITY_CHILDREN_MANAGER_IMPL_HXX
35 #include "ChildrenManagerImpl.hxx"
37 #include <svx/AccessibleShape.hxx>
39 using namespace ::com::sun::star
;
40 using namespace ::com::sun::star::accessibility
;
41 using ::com::sun::star::uno::Reference
;
43 namespace accessibility
{
46 //===== AccessibleChildrenManager ===========================================
48 ChildrenManager::ChildrenManager (
49 const ::com::sun::star::uno::Reference
<XAccessible
>& rxParent
,
50 const ::com::sun::star::uno::Reference
<drawing::XShapes
>& rxShapeList
,
51 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
52 AccessibleContextBase
& rContext
)
55 mpImpl
= new ChildrenManagerImpl (rxParent
, rxShapeList
, rShapeTreeInfo
, rContext
);
59 throw uno::RuntimeException(
60 ::rtl::OUString::createFromAscii(
61 "ChildrenManager::ChildrenManager can't create implementation object"), NULL
);
67 ChildrenManager::~ChildrenManager (void)
73 OSL_TRACE ("~ChildrenManager");
79 long ChildrenManager::GetChildCount (void) const throw ()
81 OSL_ASSERT (mpImpl
!= NULL
);
82 return mpImpl
->GetChildCount();
88 ::com::sun::star::uno::Reference
<XAccessible
> ChildrenManager::GetChild (long nIndex
)
89 throw (::com::sun::star::uno::RuntimeException
,
90 ::com::sun::star::lang::IndexOutOfBoundsException
)
92 OSL_ASSERT (mpImpl
!= NULL
);
93 return mpImpl
->GetChild (nIndex
);
99 void ChildrenManager::Update (bool bCreateNewObjectsOnDemand
)
101 OSL_ASSERT (mpImpl
!= NULL
);
102 mpImpl
->Update (bCreateNewObjectsOnDemand
);
108 void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference
<
109 ::com::sun::star::drawing::XShapes
>& xShapeList
)
111 OSL_ASSERT (mpImpl
!= NULL
);
112 mpImpl
->SetShapeList (xShapeList
);
118 void ChildrenManager::AddAccessibleShape (std::auto_ptr
<AccessibleShape
> pShape
)
120 OSL_ASSERT (mpImpl
!= NULL
);
121 mpImpl
->AddAccessibleShape (pShape
);
127 void ChildrenManager::ClearAccessibleShapeList (void)
129 OSL_ASSERT (mpImpl
!= NULL
);
130 mpImpl
->ClearAccessibleShapeList ();
136 void ChildrenManager::SetInfo (AccessibleShapeTreeInfo
& rShapeTreeInfo
)
138 OSL_ASSERT (mpImpl
!= NULL
);
139 mpImpl
->SetInfo (rShapeTreeInfo
);
145 void ChildrenManager::UpdateSelection (void)
147 OSL_ASSERT (mpImpl
!= NULL
);
148 mpImpl
->UpdateSelection ();
154 bool ChildrenManager::HasFocus (void)
156 OSL_ASSERT (mpImpl
!= NULL
);
157 return mpImpl
->HasFocus ();
163 void ChildrenManager::RemoveFocus (void)
165 OSL_ASSERT (mpImpl
!= NULL
);
166 mpImpl
->RemoveFocus ();
172 //===== IAccessibleViewForwarderListener ====================================
173 void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType
,
174 const IAccessibleViewForwarder
* pViewForwarder
)
176 OSL_ASSERT (mpImpl
!= NULL
);
177 mpImpl
->ViewForwarderChanged (aChangeType
, pViewForwarder
);
182 } // end of namespace accessibility