Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / AccessiblePreviewHeaderCell.hxx
blob1c1cfb8a89bef35a5ec2647e6acd66513d16ca78
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 #ifndef INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEPREVIEWHEADERCELL_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_ACCESSIBLEPREVIEWHEADERCELL_HXX
23 #include "AccessibleContextBase.hxx"
24 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
25 #include <tools/gen.hxx>
26 #include "global.hxx"
27 #include "address.hxx"
28 #include <cppuhelper/implbase1.hxx>
30 class ScPreviewShell;
31 class ScPreviewTableInfo;
32 namespace accessibility {
33 class AccessibleTextHelper;
36 typedef cppu::ImplHelper1< css::accessibility::XAccessibleValue>
37 ScAccessiblePreviewHeaderCellImpl;
39 class ScAccessiblePreviewHeaderCell :
40 public ScAccessibleContextBase,
41 public ScAccessiblePreviewHeaderCellImpl
43 public:
44 ScAccessiblePreviewHeaderCell( const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
45 ScPreviewShell* pViewShell,
46 const ScAddress& rCellPos, bool bIsColHdr, bool bIsRowHdr,
47 sal_Int32 nIndex );
49 protected:
50 virtual ~ScAccessiblePreviewHeaderCell();
52 using ScAccessibleContextBase::IsDefunc;
54 public:
55 using ScAccessibleContextBase::disposing;
56 virtual void SAL_CALL disposing() override;
58 //===== SfxListener =====================================================
60 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
62 ///===== XInterface =====================================================
64 virtual css::uno::Any SAL_CALL queryInterface(
65 css::uno::Type const & rType )
66 throw (css::uno::RuntimeException, std::exception) override;
68 virtual void SAL_CALL acquire() throw () override;
70 virtual void SAL_CALL release() throw () override;
72 //===== XAccessibleValue ================================================
74 virtual css::uno::Any SAL_CALL getCurrentValue() throw (css::uno::RuntimeException, std::exception) override;
75 virtual sal_Bool SAL_CALL setCurrentValue( const css::uno::Any& aNumber )
76 throw (css::uno::RuntimeException, std::exception) override;
77 virtual css::uno::Any SAL_CALL getMaximumValue() throw (css::uno::RuntimeException, std::exception) override;
78 virtual css::uno::Any SAL_CALL getMinimumValue() throw (css::uno::RuntimeException, std::exception) override;
80 //===== XAccessibleComponent ============================================
82 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
83 getAccessibleAtPoint( const css::awt::Point& aPoint )
84 throw (css::uno::RuntimeException, std::exception) override;
85 virtual void SAL_CALL grabFocus() throw (css::uno::RuntimeException, std::exception) override;
87 //===== XAccessibleContext ==============================================
89 virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (css::uno::RuntimeException, std::exception) override;
90 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
91 getAccessibleChild( sal_Int32 i )
92 throw (css::lang::IndexOutOfBoundsException,
93 css::uno::RuntimeException, std::exception) override;
94 virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (css::uno::RuntimeException, std::exception) override;
95 virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL
96 getAccessibleStateSet() throw (css::uno::RuntimeException, std::exception) override;
98 //===== XServiceInfo ====================================================
100 virtual OUString SAL_CALL getImplementationName()
101 throw(css::uno::RuntimeException, std::exception) override;
102 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
103 throw(css::uno::RuntimeException, std::exception) override;
105 ///===== XTypeProvider ===================================================
107 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
108 getTypes()
109 throw (css::uno::RuntimeException, std::exception) override;
111 /** Returns a implementation id.
113 virtual css::uno::Sequence<sal_Int8> SAL_CALL
114 getImplementationId()
115 throw (css::uno::RuntimeException, std::exception) override;
117 protected:
118 virtual OUString SAL_CALL createAccessibleDescription() throw(css::uno::RuntimeException, std::exception) override;
119 virtual OUString SAL_CALL createAccessibleName() throw (css::uno::RuntimeException, std::exception) override;
121 virtual Rectangle GetBoundingBoxOnScreen() const throw(css::uno::RuntimeException, std::exception) override;
122 virtual Rectangle GetBoundingBox() const throw (css::uno::RuntimeException, std::exception) override;
124 private:
125 ScPreviewShell* mpViewShell;
126 accessibility::AccessibleTextHelper* mpTextHelper;
127 sal_Int32 mnIndex;
128 ScAddress maCellPos;
129 bool mbColumnHeader;
130 bool mbRowHeader;
131 mutable ScPreviewTableInfo* mpTableInfo;
133 bool IsDefunc(
134 const css::uno::Reference<css::accessibility::XAccessibleStateSet>& rxParentStates);
136 void CreateTextHelper();
137 void FillTableInfo() const;
140 #endif
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */