Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include <svx/ChildrenManager.hxx>
21 : #include "ChildrenManagerImpl.hxx"
22 : #include <svx/AccessibleShape.hxx>
23 :
24 : using namespace ::com::sun::star;
25 : using namespace ::com::sun::star::accessibility;
26 : using ::com::sun::star::uno::Reference;
27 :
28 : namespace accessibility {
29 :
30 : // AccessibleChildrenManager
31 3 : 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 3 : : mpImpl (NULL)
37 : {
38 3 : mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext);
39 3 : if (mpImpl != NULL)
40 3 : mpImpl->Init ();
41 : else
42 : throw uno::RuntimeException(
43 0 : "ChildrenManager::ChildrenManager can't create implementation object", NULL);
44 3 : }
45 :
46 :
47 :
48 :
49 9 : ChildrenManager::~ChildrenManager()
50 : {
51 3 : if (mpImpl != NULL)
52 3 : mpImpl->dispose();
53 :
54 : // emtpy
55 : OSL_TRACE ("~ChildrenManager");
56 6 : }
57 :
58 17 : long ChildrenManager::GetChildCount() const throw ()
59 : {
60 : assert(mpImpl != NULL);
61 17 : return mpImpl->GetChildCount();
62 : }
63 :
64 7 : ::com::sun::star::uno::Reference<XAccessible> ChildrenManager::GetChild (long nIndex)
65 : throw (::com::sun::star::uno::RuntimeException,
66 : ::com::sun::star::lang::IndexOutOfBoundsException)
67 : {
68 : assert(mpImpl != NULL);
69 7 : return mpImpl->GetChild (nIndex);
70 : }
71 :
72 0 : Reference<XAccessible> ChildrenManager::GetChild (const Reference<drawing::XShape>& xShape)
73 : throw (::com::sun::star::uno::RuntimeException)
74 : {
75 : assert(mpImpl != NULL);
76 0 : return mpImpl->GetChild (xShape);
77 : }
78 :
79 : ::com::sun::star::uno::Reference<
80 0 : ::com::sun::star::drawing::XShape> ChildrenManager::GetChildShape(long nIndex)
81 : throw (::com::sun::star::uno::RuntimeException,
82 : ::com::sun::star::lang::IndexOutOfBoundsException)
83 : {
84 : assert(mpImpl != NULL);
85 0 : return mpImpl->GetChildShape(nIndex);
86 : }
87 :
88 7 : void ChildrenManager::Update (bool bCreateNewObjectsOnDemand)
89 : {
90 : assert(mpImpl != NULL);
91 7 : mpImpl->Update (bCreateNewObjectsOnDemand);
92 7 : }
93 :
94 4 : void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference<
95 : ::com::sun::star::drawing::XShapes>& xShapeList)
96 : {
97 : assert(mpImpl != NULL);
98 4 : mpImpl->SetShapeList (xShapeList);
99 4 : }
100 :
101 7 : void ChildrenManager::AddAccessibleShape (css::uno::Reference<css::accessibility::XAccessible> const & shape)
102 : {
103 : assert(mpImpl != NULL);
104 7 : mpImpl->AddAccessibleShape (shape);
105 7 : }
106 :
107 4 : void ChildrenManager::ClearAccessibleShapeList()
108 : {
109 : assert(mpImpl != NULL);
110 4 : mpImpl->ClearAccessibleShapeList ();
111 4 : }
112 :
113 0 : void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo)
114 : {
115 : assert(mpImpl != NULL);
116 0 : mpImpl->SetInfo (rShapeTreeInfo);
117 0 : }
118 :
119 3 : void ChildrenManager::UpdateSelection()
120 : {
121 : assert(mpImpl != NULL);
122 3 : mpImpl->UpdateSelection ();
123 3 : }
124 :
125 0 : bool ChildrenManager::HasFocus()
126 : {
127 : assert(mpImpl != NULL);
128 0 : return mpImpl->HasFocus ();
129 : }
130 :
131 0 : void ChildrenManager::RemoveFocus()
132 : {
133 : assert(mpImpl != NULL);
134 0 : mpImpl->RemoveFocus ();
135 0 : }
136 :
137 : // IAccessibleViewForwarderListener
138 9 : void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType,
139 : const IAccessibleViewForwarder* pViewForwarder)
140 : {
141 : assert(mpImpl != NULL);
142 9 : mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
143 9 : }
144 :
145 : } // end of namespace accessibility
146 :
147 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|