update credits
[LibreOffice.git] / include / unotools / accessiblerelationsethelper.hxx
blob18e9a80a639abf950c07c3112333cb4397470353
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 _UTL_ACCESSIBLERELATIONSETHELPER_HXX_
21 #define _UTL_ACCESSIBLERELATIONSETHELPER_HXX_
23 #include "unotools/unotoolsdllapi.h"
25 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <cppuhelper/weak.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/lang/XTypeProvider.hpp>
30 #include <com/sun/star/lang/XServiceName.hpp>
31 #include <osl/mutex.hxx>
32 #include <cppuhelper/implbase1.hxx>
33 #include <comphelper/servicehelper.hxx>
35 class AccessibleRelationSetHelperImpl;
37 //=========================================================================
38 //= XAccessibleRelationSet helper classes
39 //=========================================================================
41 //... namespace utl .......................................................
42 namespace utl
44 //.........................................................................
46 /** @descr
47 This base class provides an implementation of the
48 <code>AccessibleRelationSet</code> service.
50 class UNOTOOLS_DLLPUBLIC AccessibleRelationSetHelper
51 : public cppu::WeakImplHelper1<
52 ::com::sun::star::accessibility::XAccessibleRelationSet
55 public:
56 //===== internal ========================================================
57 AccessibleRelationSetHelper ();
58 AccessibleRelationSetHelper (const AccessibleRelationSetHelper& rHelper);
59 protected:
60 virtual ~AccessibleRelationSetHelper (void);
61 public:
63 //===== XAccessibleRelationSet ==========================================
65 /** Returns the number of relations in this relation set.
67 @return
68 Returns the number of relations or zero if there are none.
70 virtual sal_Int32 SAL_CALL getRelationCount( )
71 throw (::com::sun::star::uno::RuntimeException);
73 /** Returns the relation of this relation set that is specified by
74 the given index.
76 @param nIndex
77 This index specifies the relatio to return.
79 @return
80 For a valid index, i.e. inside the range 0 to the number of
81 relations minus one, the returned value is the requested
82 relation. If the index is invalid then the returned relation
83 has the type INVALID.
86 virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL
87 getRelation( sal_Int32 nIndex )
88 throw (::com::sun::star::lang::IndexOutOfBoundsException,
89 ::com::sun::star::uno::RuntimeException);
91 /** Tests whether the relation set contains a relation matching the
92 specified key.
94 @param aRelationType
95 The type of relation to look for in this set of relations. This
96 has to be one of the constants of
97 <type>AccessibleRelationType</type>.
99 @return
100 Returns <TRUE/> if there is a (at least one) relation of the
101 given type and <FALSE/> if there is no such relation in the set.
103 virtual sal_Bool SAL_CALL containsRelation( sal_Int16 aRelationType )
104 throw (::com::sun::star::uno::RuntimeException);
106 /** Retrieve and return the relation with the given relation type.
108 @param aRelationType
109 The type of the relation to return. This has to be one of the
110 constants of <type>AccessibleRelationType</type>.
112 @return
113 If a relation with the given type could be found than (a copy
114 of) this relation is returned. Otherwise a relation with the
115 type INVALID is returned.
117 virtual ::com::sun::star::accessibility::AccessibleRelation SAL_CALL
118 getRelationByType( sal_Int16 aRelationType )
119 throw (::com::sun::star::uno::RuntimeException);
121 void AddRelation(
122 const ::com::sun::star::accessibility::AccessibleRelation& rRelation)
123 throw (::com::sun::star::uno::RuntimeException);
125 //===== XTypeProvider ===================================================
127 /** Returns a sequence of all supported interfaces.
129 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
130 getTypes (void)
131 throw (::com::sun::star::uno::RuntimeException);
133 /** Returns a implementation id.
135 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
136 getImplementationId (void)
137 throw (::com::sun::star::uno::RuntimeException);
139 protected:
140 /// Mutex guarding this object.
141 ::osl::Mutex maMutex;
143 private:
144 /// The implementation of this helper interface.
145 AccessibleRelationSetHelperImpl* mpHelperImpl;
148 //.........................................................................
150 //... namespace utl .......................................................
151 #endif
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */