docthemes: Save themes def. to a file when added to ColorSets
[LibreOffice.git] / sw / source / uibase / docvw / SidebarWinAcc.cxx
blob232bc372880f21929ea4c8d71909de3c38854cf3
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 "SidebarWinAcc.hxx"
21 #include <AnnotationWin.hxx>
23 #include <viewsh.hxx>
24 #include <accmap.hxx>
25 #include <vcl/svapp.hxx>
27 #include <com/sun/star/accessibility/AccessibleRole.hpp>
29 namespace sw::sidebarwindows
31 SidebarWinAccessible::SidebarWinAccessible(sw::annotation::SwAnnotationWin& rSidebarWin,
32 SwViewShell& rViewShell,
33 const SwAnnotationItem& rSidebarItem)
34 : ImplInheritanceHelper(&rSidebarWin)
35 , mrViewShell(rViewShell)
36 , mpAnchorFrame(rSidebarItem.maLayoutInfo.mpAnchorFrame)
38 rSidebarWin.SetAccessibleRole(css::accessibility::AccessibleRole::COMMENT);
41 SidebarWinAccessible::~SidebarWinAccessible() {}
43 void SidebarWinAccessible::ChangeSidebarItem(const SwAnnotationItem& rSidebarItem)
45 SolarMutexGuard aGuard;
47 mpAnchorFrame = rSidebarItem.maLayoutInfo.mpAnchorFrame;
50 css::uno::Reference<css::accessibility::XAccessibleContext>
51 SidebarWinAccessible::getAccessibleContext()
53 ensureAlive();
55 return this;
58 css::uno::Reference<css::accessibility::XAccessible> SidebarWinAccessible::getAccessibleParent()
60 SolarMutexGuard aGuard;
62 css::uno::Reference<css::accessibility::XAccessible> xAccParent;
64 if (mpAnchorFrame && mrViewShell.GetAccessibleMap())
66 xAccParent = mrViewShell.GetAccessibleMap()->GetContext(mpAnchorFrame, false);
69 return xAccParent;
72 sal_Int64 SAL_CALL SidebarWinAccessible::getAccessibleIndexInParent()
74 SolarMutexGuard aGuard;
76 sal_Int64 nIndex(-1);
78 if (mpAnchorFrame && GetWindow() && mrViewShell.GetAccessibleMap())
80 nIndex = mrViewShell.GetAccessibleMap()->GetChildIndex(*mpAnchorFrame, *GetWindow());
83 return nIndex;
86 } // end of namespace sw::sidebarwindows
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */