tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / AccessibleCellBase.hxx
blobf756faf4821fba3270e69410157a4bcbb8356cb1
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 #pragma once
22 #include "AccessibleContextBase.hxx"
23 #include <address.hxx>
24 #include <com/sun/star/accessibility/XAccessibleValue.hpp>
25 #include <cppuhelper/implbase1.hxx>
27 typedef cppu::ImplHelper1< css::accessibility::XAccessibleValue>
28 ScAccessibleCellBaseImpl;
30 class ScAccessibleCellBase
31 : public ScAccessibleContextBase,
32 public ScAccessibleCellBaseImpl
34 public:
35 //===== internal ========================================================
36 ScAccessibleCellBase(
37 const css::uno::Reference<css::accessibility::XAccessible>& rxParent,
38 ScDocument* pDoc,
39 const ScAddress& rCellAddress,
40 sal_Int64 nIndex);
41 protected:
42 virtual ~ScAccessibleCellBase() override;
43 public:
45 virtual bool isVisible() override;
47 ///===== XInterface =====================================================
49 virtual css::uno::Any SAL_CALL queryInterface(
50 css::uno::Type const & rType ) override;
52 virtual void SAL_CALL acquire() noexcept override;
54 virtual void SAL_CALL release() noexcept override;
56 ///===== XAccessibleComponent ============================================
58 virtual sal_Int32 SAL_CALL getForeground( ) override;
60 virtual sal_Int32 SAL_CALL getBackground( ) override;
62 ///===== XAccessibleContext ==============================================
64 /// Return this objects index among the parents children.
65 virtual sal_Int64 SAL_CALL
66 getAccessibleIndexInParent() override;
68 protected:
69 /// Return this object's description.
70 virtual OUString
71 createAccessibleDescription() override;
73 /// Return the object's current name.
74 virtual OUString
75 createAccessibleName() override;
77 public:
78 ///===== XAccessibleValue ================================================
80 virtual css::uno::Any SAL_CALL
81 getCurrentValue() override;
83 virtual sal_Bool SAL_CALL
84 setCurrentValue( const css::uno::Any& aNumber ) override;
86 virtual css::uno::Any SAL_CALL
87 getMaximumValue( ) override;
89 virtual css::uno::Any SAL_CALL
90 getMinimumValue( ) override;
92 virtual css::uno::Any SAL_CALL
93 getMinimumIncrement( ) override;
95 ///===== XServiceInfo ====================================================
97 /** Returns an identifier for the implementation of this object.
99 virtual OUString SAL_CALL
100 getImplementationName() override;
102 ///===== XTypeProvider ===================================================
104 /// returns the possible types
105 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
106 getTypes() override;
108 /** Returns an implementation id.
110 virtual css::uno::Sequence<sal_Int8> SAL_CALL
111 getImplementationId() override;
113 protected:
114 ScAddress maCellAddress;
116 ScDocument* mpDoc;
118 sal_Int64 mnIndex;
120 private:
121 virtual bool IsEditable(sal_Int64 nParentStates);
122 protected:
123 /// @throw css::uno::RuntimeException
124 OUString GetNote() const;
126 /// @throw css::uno::RuntimeException
127 OUString GetAllDisplayNote() const;
128 /// @throw css::uno::RuntimeException
129 OUString getShadowAttrs() const;
130 /// @throw css::uno::RuntimeException
131 OUString getBorderAttrs();
132 public:
133 const ScAddress& GetCellAddress() const { return maCellAddress; }
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */