fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / accessibility / ChildrenManager.cxx
blobc2cfdcb64f4941be09f8217180a494501c90751c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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)
38 : mpImpl (NULL)
40 mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext);
41 if (mpImpl != NULL)
42 mpImpl->Init ();
43 else
44 throw uno::RuntimeException(
45 "ChildrenManager::ChildrenManager can't create implementation object", NULL);
51 ChildrenManager::~ChildrenManager (void)
53 if (mpImpl != NULL)
54 mpImpl->dispose();
56 // emtpy
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: */