1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_UNOTOOLS_ACCESSIBLERELATIONSETHELPER_HXX
21 #define INCLUDED_UNOTOOLS_ACCESSIBLERELATIONSETHELPER_HXX
23 #include <unotools/unotoolsdllapi.h>
25 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
26 #include <cppuhelper/weak.hxx>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <com/sun/star/lang/XServiceName.hpp>
30 #include <osl/mutex.hxx>
31 #include <cppuhelper/implbase1.hxx>
32 #include <comphelper/servicehelper.hxx>
35 class AccessibleRelationSetHelperImpl
;
37 //= XAccessibleRelationSet helper classes
39 //... namespace utl .......................................................
44 This base class provides an implementation of the
45 <code>AccessibleRelationSet</code> service.
47 class UNOTOOLS_DLLPUBLIC AccessibleRelationSetHelper
48 : public cppu::WeakImplHelper1
< css::accessibility::XAccessibleRelationSet
>
51 //===== internal ========================================================
52 AccessibleRelationSetHelper ();
53 AccessibleRelationSetHelper (const AccessibleRelationSetHelper
& rHelper
);
55 virtual ~AccessibleRelationSetHelper() override
;
58 //===== XAccessibleRelationSet ==========================================
60 /** Returns the number of relations in this relation set.
63 Returns the number of relations or zero if there are none.
65 virtual sal_Int32 SAL_CALL
getRelationCount( )
66 throw (css::uno::RuntimeException
, std::exception
) override
;
68 /** Returns the relation of this relation set that is specified by
72 This index specifies the relatio to return.
75 For a valid index, i.e. inside the range 0 to the number of
76 relations minus one, the returned value is the requested
77 relation. If the index is invalid then the returned relation
81 virtual css::accessibility::AccessibleRelation SAL_CALL
82 getRelation( sal_Int32 nIndex
)
83 throw (css::lang::IndexOutOfBoundsException
,
84 css::uno::RuntimeException
, std::exception
) override
;
86 /** Tests whether the relation set contains a relation matching the
90 The type of relation to look for in this set of relations. This
91 has to be one of the constants of
92 AccessibleRelationType.
95 Returns <TRUE/> if there is a (at least one) relation of the
96 given type and <FALSE/> if there is no such relation in the set.
98 virtual sal_Bool SAL_CALL
containsRelation( sal_Int16 aRelationType
)
99 throw (css::uno::RuntimeException
, std::exception
) override
;
101 /** Retrieve and return the relation with the given relation type.
104 The type of the relation to return. This has to be one of the
105 constants of AccessibleRelationType.
108 If a relation with the given type could be found than (a copy
109 of) this relation is returned. Otherwise a relation with the
110 type INVALID is returned.
112 virtual css::accessibility::AccessibleRelation SAL_CALL
113 getRelationByType( sal_Int16 aRelationType
)
114 throw (css::uno::RuntimeException
, std::exception
) override
;
117 const css::accessibility::AccessibleRelation
& rRelation
)
118 throw (css::uno::RuntimeException
);
120 //===== XTypeProvider ===================================================
122 /** Returns a sequence of all supported interfaces.
124 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
126 throw (css::uno::RuntimeException
, std::exception
) override
;
128 /** Returns a implementation id.
130 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
131 getImplementationId()
132 throw (css::uno::RuntimeException
, std::exception
) override
;
135 /// Mutex guarding this object.
136 ::osl::Mutex maMutex
;
139 /// The implementation of this helper interface.
140 std::unique_ptr
<AccessibleRelationSetHelperImpl
> mpHelperImpl
;
144 //... namespace utl .......................................................
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */