1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/ChildrenManager.hxx>
21 #include "ChildrenManagerImpl.hxx"
22 #include <svx/AccessibleShape.hxx>
24 using namespace ::com::sun::star
;
25 using namespace ::com::sun::star::accessibility
;
26 using ::com::sun::star::uno::Reference
;
28 namespace accessibility
{
31 //===== AccessibleChildrenManager ===========================================
33 ChildrenManager::ChildrenManager (
34 const ::com::sun::star::uno::Reference
<XAccessible
>& rxParent
,
35 const ::com::sun::star::uno::Reference
<drawing::XShapes
>& rxShapeList
,
36 const AccessibleShapeTreeInfo
& rShapeTreeInfo
,
37 AccessibleContextBase
& rContext
)
40 mpImpl
= new ChildrenManagerImpl (rxParent
, rxShapeList
, rShapeTreeInfo
, rContext
);
44 throw uno::RuntimeException(
45 "ChildrenManager::ChildrenManager can't create implementation object", NULL
);
51 ChildrenManager::~ChildrenManager (void)
57 OSL_TRACE ("~ChildrenManager");
63 long ChildrenManager::GetChildCount (void) const throw ()
65 OSL_ASSERT (mpImpl
!= NULL
);
66 return mpImpl
->GetChildCount();
72 ::com::sun::star::uno::Reference
<XAccessible
> ChildrenManager::GetChild (long nIndex
)
73 throw (::com::sun::star::uno::RuntimeException
,
74 ::com::sun::star::lang::IndexOutOfBoundsException
)
76 OSL_ASSERT (mpImpl
!= NULL
);
77 return mpImpl
->GetChild (nIndex
);
83 void ChildrenManager::Update (bool bCreateNewObjectsOnDemand
)
85 OSL_ASSERT (mpImpl
!= NULL
);
86 mpImpl
->Update (bCreateNewObjectsOnDemand
);
92 void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference
<
93 ::com::sun::star::drawing::XShapes
>& xShapeList
)
95 OSL_ASSERT (mpImpl
!= NULL
);
96 mpImpl
->SetShapeList (xShapeList
);
102 void ChildrenManager::AddAccessibleShape (std::auto_ptr
<AccessibleShape
> pShape
)
104 OSL_ASSERT (mpImpl
!= NULL
);
105 mpImpl
->AddAccessibleShape (pShape
);
111 void ChildrenManager::ClearAccessibleShapeList (void)
113 OSL_ASSERT (mpImpl
!= NULL
);
114 mpImpl
->ClearAccessibleShapeList ();
120 void ChildrenManager::SetInfo (AccessibleShapeTreeInfo
& rShapeTreeInfo
)
122 OSL_ASSERT (mpImpl
!= NULL
);
123 mpImpl
->SetInfo (rShapeTreeInfo
);
129 void ChildrenManager::UpdateSelection (void)
131 OSL_ASSERT (mpImpl
!= NULL
);
132 mpImpl
->UpdateSelection ();
138 bool ChildrenManager::HasFocus (void)
140 OSL_ASSERT (mpImpl
!= NULL
);
141 return mpImpl
->HasFocus ();
147 void ChildrenManager::RemoveFocus (void)
149 OSL_ASSERT (mpImpl
!= NULL
);
150 mpImpl
->RemoveFocus ();
156 //===== IAccessibleViewForwarderListener ====================================
157 void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType
,
158 const IAccessibleViewForwarder
* pViewForwarder
)
160 OSL_ASSERT (mpImpl
!= NULL
);
161 mpImpl
->ViewForwarderChanged (aChangeType
, pViewForwarder
);
166 } // end of namespace accessibility
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */