tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / include / comphelper / accessibleselectionhelper.hxx
blob78bdabcae61130dc1001662ed4b075df07a83269
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_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
21 #define INCLUDED_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
23 #include <config_options.h>
24 #include <comphelper/accessiblecomponenthelper.hxx>
25 #include <cppuhelper/implbase.hxx>
26 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
27 #include <comphelper/comphelperdllapi.h>
29 #define ACCESSIBLE_SELECTION_CHILD_ALL (sal_Int32(-1))
31 namespace comphelper
35 //= OCommonAccessibleSelection
37 /** base class encapsulating common functionality for the helper classes implementing
38 the XAccessibleSelection
40 class COMPHELPER_DLLPUBLIC OCommonAccessibleSelection
42 protected:
44 OCommonAccessibleSelection();
46 ~OCommonAccessibleSelection();
48 protected:
50 // access to context - still waiting to be overwritten
51 /// @throws css::uno::RuntimeException
52 virtual css::uno::Reference< css::accessibility::XAccessibleContext >
53 implGetAccessibleContext() = 0;
55 // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
56 /// @throws css::uno::RuntimeException
57 virtual bool
58 implIsSelected( sal_Int64 nAccessibleChildIndex ) = 0;
60 // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
61 /// @throws css::uno::RuntimeException
62 virtual void
63 implSelect( sal_Int64 nAccessibleChildIndex, bool bSelect ) = 0;
65 protected:
67 /** non-virtual versions of the methods which can be implemented using <method>implIsSelected</method> and <method>implSelect</method>
69 @throws css::lang::IndexOutOfBoundsException
70 @throws css::uno::RuntimeException
72 void selectAccessibleChild( sal_Int64 nChildIndex );
73 /// @throws css::lang::IndexOutOfBoundsException
74 /// @throws css::uno::RuntimeException
75 bool isAccessibleChildSelected( sal_Int64 nChildIndex );
76 /// @throws css::uno::RuntimeException
77 void clearAccessibleSelection( );
78 /// @throws css::uno::RuntimeException
79 void selectAllAccessibleChildren( );
80 /// @throws css::uno::RuntimeException
81 sal_Int64 getSelectedAccessibleChildCount( );
82 /// @throws css::lang::IndexOutOfBoundsException
83 /// @throws css::uno::RuntimeException
84 css::uno::Reference< css::accessibility::XAccessible > getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex );
85 /// @throws css::lang::IndexOutOfBoundsException
86 /// @throws css::uno::RuntimeException
87 void deselectAccessibleChild( sal_Int64 nSelectedChildIndex );
91 //= OAccessibleSelectionHelper
94 /** a helper class for implementing an AccessibleSelection which at the same time
95 supports an XAccessibleSelection interface.
97 class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OAccessibleSelectionHelper : public cppu::ImplInheritanceHelper<OAccessibleComponentHelper, css::accessibility::XAccessibleSelection>,
98 public OCommonAccessibleSelection
100 private:
101 OAccessibleSelectionHelper(OAccessibleSelectionHelper const &) = delete;
102 OAccessibleSelectionHelper(OAccessibleSelectionHelper &&) = delete;
103 void operator =(OAccessibleSelectionHelper const &) = delete;
104 void operator =(OAccessibleSelectionHelper &&) = delete;
106 protected:
108 OAccessibleSelectionHelper();
110 // return ourself here by default
111 virtual css::uno::Reference< css::accessibility::XAccessibleContext > implGetAccessibleContext() override final;
113 public:
115 // XAccessibleSelection - default implementations
116 virtual void SAL_CALL selectAccessibleChild( sal_Int64 nChildIndex ) override final;
117 virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int64 nChildIndex ) override final;
118 virtual void SAL_CALL clearAccessibleSelection( ) override final;
119 virtual void SAL_CALL selectAllAccessibleChildren( ) override final;
120 virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount( ) override final;
121 virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex ) override final;
122 virtual void SAL_CALL deselectAccessibleChild( sal_Int64 nSelectedChildIndex ) override final;
126 } // namespace comphelper
129 #endif // INCLUDED_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */