1f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file
5f6e50924SAndrew Rist * distributed with this work for additional information
6f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the
8f6e50924SAndrew Rist * "License"); you may not use this file except in compliance
9f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at
10f6e50924SAndrew Rist *
11f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12f6e50924SAndrew Rist *
13f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing,
14f6e50924SAndrew Rist * software distributed under the License is distributed on an
15f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f6e50924SAndrew Rist * KIND, either express or implied. See the License for the
17f6e50924SAndrew Rist * specific language governing permissions and limitations
18f6e50924SAndrew Rist * under the License.
19f6e50924SAndrew Rist *
20f6e50924SAndrew Rist *************************************************************/
21f6e50924SAndrew Rist
22f6e50924SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include <svx/ChildrenManager.hxx>
27cdf0e10cSrcweir #ifndef _SVX_ACCESSIBILITY_CHILDREN_MANAGER_IMPL_HXX
28cdf0e10cSrcweir #include "ChildrenManagerImpl.hxx"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include <svx/AccessibleShape.hxx>
31cdf0e10cSrcweir
32cdf0e10cSrcweir using namespace ::com::sun::star;
33cdf0e10cSrcweir using namespace ::com::sun::star::accessibility;
34cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
35cdf0e10cSrcweir
36cdf0e10cSrcweir namespace accessibility {
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweir //===== AccessibleChildrenManager ===========================================
40cdf0e10cSrcweir
ChildrenManager(const::com::sun::star::uno::Reference<XAccessible> & rxParent,const::com::sun::star::uno::Reference<drawing::XShapes> & rxShapeList,const AccessibleShapeTreeInfo & rShapeTreeInfo,AccessibleContextBase & rContext)41cdf0e10cSrcweir ChildrenManager::ChildrenManager (
42cdf0e10cSrcweir const ::com::sun::star::uno::Reference<XAccessible>& rxParent,
43cdf0e10cSrcweir const ::com::sun::star::uno::Reference<drawing::XShapes>& rxShapeList,
44cdf0e10cSrcweir const AccessibleShapeTreeInfo& rShapeTreeInfo,
45cdf0e10cSrcweir AccessibleContextBase& rContext)
46cdf0e10cSrcweir : mpImpl (NULL)
47cdf0e10cSrcweir {
48cdf0e10cSrcweir mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext);
49cdf0e10cSrcweir if (mpImpl != NULL)
50cdf0e10cSrcweir mpImpl->Init ();
51cdf0e10cSrcweir else
52cdf0e10cSrcweir throw uno::RuntimeException(
53cdf0e10cSrcweir ::rtl::OUString::createFromAscii(
54cdf0e10cSrcweir "ChildrenManager::ChildrenManager can't create implementation object"), NULL);
55cdf0e10cSrcweir }
56cdf0e10cSrcweir
57cdf0e10cSrcweir
58cdf0e10cSrcweir
59cdf0e10cSrcweir
~ChildrenManager(void)60cdf0e10cSrcweir ChildrenManager::~ChildrenManager (void)
61cdf0e10cSrcweir {
62cdf0e10cSrcweir if (mpImpl != NULL)
63cdf0e10cSrcweir mpImpl->dispose();
64cdf0e10cSrcweir
65cdf0e10cSrcweir // emtpy
66cdf0e10cSrcweir OSL_TRACE ("~ChildrenManager");
67cdf0e10cSrcweir }
68cdf0e10cSrcweir
69cdf0e10cSrcweir
70cdf0e10cSrcweir
71cdf0e10cSrcweir
GetChildCount(void) const72cdf0e10cSrcweir long ChildrenManager::GetChildCount (void) const throw ()
73cdf0e10cSrcweir {
74cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
75cdf0e10cSrcweir return mpImpl->GetChildCount();
76cdf0e10cSrcweir }
77cdf0e10cSrcweir
78cdf0e10cSrcweir
79cdf0e10cSrcweir
80cdf0e10cSrcweir
GetChild(long nIndex)81cdf0e10cSrcweir ::com::sun::star::uno::Reference<XAccessible> ChildrenManager::GetChild (long nIndex)
82cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException,
83cdf0e10cSrcweir ::com::sun::star::lang::IndexOutOfBoundsException)
84cdf0e10cSrcweir {
85cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
86cdf0e10cSrcweir return mpImpl->GetChild (nIndex);
87cdf0e10cSrcweir }
88cdf0e10cSrcweir
GetChild(const Reference<drawing::XShape> & xShape)89*9b8096d0SSteve Yin Reference<XAccessible> ChildrenManager::GetChild (const Reference<drawing::XShape>& xShape)
90*9b8096d0SSteve Yin throw (::com::sun::star::uno::RuntimeException)
91*9b8096d0SSteve Yin {
92*9b8096d0SSteve Yin OSL_ASSERT (mpImpl != NULL);
93*9b8096d0SSteve Yin return mpImpl->GetChild (xShape);
94*9b8096d0SSteve Yin }
95cdf0e10cSrcweir
96*9b8096d0SSteve Yin ::com::sun::star::uno::Reference<
GetChildShape(long nIndex)97*9b8096d0SSteve Yin ::com::sun::star::drawing::XShape> ChildrenManager::GetChildShape(long nIndex)
98*9b8096d0SSteve Yin throw (::com::sun::star::uno::RuntimeException)
99*9b8096d0SSteve Yin {
100*9b8096d0SSteve Yin OSL_ASSERT (mpImpl != NULL);
101*9b8096d0SSteve Yin return mpImpl->GetChildShape(nIndex);
102*9b8096d0SSteve Yin }
103cdf0e10cSrcweir
104cdf0e10cSrcweir
Update(bool bCreateNewObjectsOnDemand)105cdf0e10cSrcweir void ChildrenManager::Update (bool bCreateNewObjectsOnDemand)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
108cdf0e10cSrcweir mpImpl->Update (bCreateNewObjectsOnDemand);
109cdf0e10cSrcweir }
110cdf0e10cSrcweir
111cdf0e10cSrcweir
112cdf0e10cSrcweir
113cdf0e10cSrcweir
SetShapeList(const::com::sun::star::uno::Reference<::com::sun::star::drawing::XShapes> & xShapeList)114cdf0e10cSrcweir void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference<
115cdf0e10cSrcweir ::com::sun::star::drawing::XShapes>& xShapeList)
116cdf0e10cSrcweir {
117cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
118cdf0e10cSrcweir mpImpl->SetShapeList (xShapeList);
119cdf0e10cSrcweir }
120cdf0e10cSrcweir
121cdf0e10cSrcweir
122cdf0e10cSrcweir
123cdf0e10cSrcweir
AddAccessibleShape(std::auto_ptr<AccessibleShape> pShape)124cdf0e10cSrcweir void ChildrenManager::AddAccessibleShape (std::auto_ptr<AccessibleShape> pShape)
125cdf0e10cSrcweir {
126cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
127cdf0e10cSrcweir mpImpl->AddAccessibleShape (pShape);
128cdf0e10cSrcweir }
129cdf0e10cSrcweir
130cdf0e10cSrcweir
131cdf0e10cSrcweir
132cdf0e10cSrcweir
ClearAccessibleShapeList(void)133cdf0e10cSrcweir void ChildrenManager::ClearAccessibleShapeList (void)
134cdf0e10cSrcweir {
135cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
136cdf0e10cSrcweir mpImpl->ClearAccessibleShapeList ();
137cdf0e10cSrcweir }
138cdf0e10cSrcweir
139cdf0e10cSrcweir
140cdf0e10cSrcweir
141cdf0e10cSrcweir
SetInfo(AccessibleShapeTreeInfo & rShapeTreeInfo)142cdf0e10cSrcweir void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo)
143cdf0e10cSrcweir {
144cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
145cdf0e10cSrcweir mpImpl->SetInfo (rShapeTreeInfo);
146cdf0e10cSrcweir }
147cdf0e10cSrcweir
148cdf0e10cSrcweir
149cdf0e10cSrcweir
150cdf0e10cSrcweir
UpdateSelection(void)151cdf0e10cSrcweir void ChildrenManager::UpdateSelection (void)
152cdf0e10cSrcweir {
153cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
154cdf0e10cSrcweir mpImpl->UpdateSelection ();
155cdf0e10cSrcweir }
156cdf0e10cSrcweir
157cdf0e10cSrcweir
158cdf0e10cSrcweir
159cdf0e10cSrcweir
HasFocus(void)160cdf0e10cSrcweir bool ChildrenManager::HasFocus (void)
161cdf0e10cSrcweir {
162cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
163cdf0e10cSrcweir return mpImpl->HasFocus ();
164cdf0e10cSrcweir }
165cdf0e10cSrcweir
166cdf0e10cSrcweir
167cdf0e10cSrcweir
168cdf0e10cSrcweir
RemoveFocus(void)169cdf0e10cSrcweir void ChildrenManager::RemoveFocus (void)
170cdf0e10cSrcweir {
171cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
172cdf0e10cSrcweir mpImpl->RemoveFocus ();
173cdf0e10cSrcweir }
174cdf0e10cSrcweir
175cdf0e10cSrcweir
176cdf0e10cSrcweir
177cdf0e10cSrcweir
178cdf0e10cSrcweir //===== IAccessibleViewForwarderListener ====================================
ViewForwarderChanged(ChangeType aChangeType,const IAccessibleViewForwarder * pViewForwarder)179cdf0e10cSrcweir void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType,
180cdf0e10cSrcweir const IAccessibleViewForwarder* pViewForwarder)
181cdf0e10cSrcweir {
182cdf0e10cSrcweir OSL_ASSERT (mpImpl != NULL);
183cdf0e10cSrcweir mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
184cdf0e10cSrcweir }
185cdf0e10cSrcweir
186cdf0e10cSrcweir
187cdf0e10cSrcweir
188cdf0e10cSrcweir } // end of namespace accessibility
189cdf0e10cSrcweir
190