lok: Don't attempt to select the exact text after a failed search.
[LibreOffice.git] / svx / source / accessibility / ChildrenManager.cxx
blobada8b29df564f3e8b450cb487a98d6385fae5ec8
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 {
30 // AccessibleChildrenManager
31 ChildrenManager::ChildrenManager (
32 const ::com::sun::star::uno::Reference<XAccessible>& rxParent,
33 const ::com::sun::star::uno::Reference<drawing::XShapes>& rxShapeList,
34 const AccessibleShapeTreeInfo& rShapeTreeInfo,
35 AccessibleContextBase& rContext)
36 : mpImpl (NULL)
38 mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext);
39 if (mpImpl != NULL)
40 mpImpl->Init ();
41 else
42 throw uno::RuntimeException(
43 "ChildrenManager::ChildrenManager can't create implementation object", NULL);
49 ChildrenManager::~ChildrenManager()
51 if (mpImpl != NULL)
52 mpImpl->dispose();
54 // emtpy
55 OSL_TRACE ("~ChildrenManager");
58 long ChildrenManager::GetChildCount() const throw ()
60 assert(mpImpl != NULL);
61 return mpImpl->GetChildCount();
64 ::com::sun::star::uno::Reference<XAccessible> ChildrenManager::GetChild (long nIndex)
65 throw (::com::sun::star::uno::RuntimeException,
66 ::com::sun::star::lang::IndexOutOfBoundsException)
68 assert(mpImpl != NULL);
69 return mpImpl->GetChild (nIndex);
72 Reference<XAccessible> ChildrenManager::GetChild (const Reference<drawing::XShape>& xShape)
73 throw (::com::sun::star::uno::RuntimeException)
75 assert(mpImpl != NULL);
76 return mpImpl->GetChild (xShape);
79 ::com::sun::star::uno::Reference<
80 ::com::sun::star::drawing::XShape> ChildrenManager::GetChildShape(long nIndex)
81 throw (::com::sun::star::uno::RuntimeException,
82 ::com::sun::star::lang::IndexOutOfBoundsException)
84 assert(mpImpl != NULL);
85 return mpImpl->GetChildShape(nIndex);
88 void ChildrenManager::Update (bool bCreateNewObjectsOnDemand)
90 assert(mpImpl != NULL);
91 mpImpl->Update (bCreateNewObjectsOnDemand);
94 void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference<
95 ::com::sun::star::drawing::XShapes>& xShapeList)
97 assert(mpImpl != NULL);
98 mpImpl->SetShapeList (xShapeList);
101 void ChildrenManager::AddAccessibleShape (css::uno::Reference<css::accessibility::XAccessible> const & shape)
103 assert(mpImpl != NULL);
104 mpImpl->AddAccessibleShape (shape);
107 void ChildrenManager::ClearAccessibleShapeList()
109 assert(mpImpl != NULL);
110 mpImpl->ClearAccessibleShapeList ();
113 void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo)
115 assert(mpImpl != NULL);
116 mpImpl->SetInfo (rShapeTreeInfo);
119 void ChildrenManager::UpdateSelection()
121 assert(mpImpl != NULL);
122 mpImpl->UpdateSelection ();
125 bool ChildrenManager::HasFocus()
127 assert(mpImpl != NULL);
128 return mpImpl->HasFocus ();
131 void ChildrenManager::RemoveFocus()
133 assert(mpImpl != NULL);
134 mpImpl->RemoveFocus ();
137 // IAccessibleViewForwarderListener
138 void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType,
139 const IAccessibleViewForwarder* pViewForwarder)
141 assert(mpImpl != NULL);
142 mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
145 } // end of namespace accessibility
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */