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 .
21 #ifndef _SC_ACCESSIBLEEDITOBJECT_HXX
22 #define _SC_ACCESSIBLEEDITOBJECT_HXX
24 #include "AccessibleContextBase.hxx"
26 namespace accessibility
28 class AccessibleTextHelper
;
34 This base class provides an implementation of the
35 <code>AccessibleCell</code> service.
37 class ScAccessibleEditObject
38 : public ScAccessibleContextBase
48 ScAccessibleEditObject(
49 const ::com::sun::star::uno::Reference
<
50 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
51 EditView
* pEditView
, Window
* pWin
, const OUString
& rName
,
52 const OUString
& rDescription
, EditObjectType eObjectType
);
55 virtual ~ScAccessibleEditObject();
57 using ScAccessibleContextBase::IsDefunc
;
60 using ScAccessibleContextBase::disposing
;
62 virtual void SAL_CALL
disposing();
64 virtual void LostFocus();
66 virtual void GotFocus();
68 ///===== XAccessibleComponent ============================================
70 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
71 SAL_CALL
getAccessibleAtPoint(
72 const ::com::sun::star::awt::Point
& rPoint
)
73 throw (::com::sun::star::uno::RuntimeException
);
76 /// Return the object's current bounding box relative to the desktop.
77 virtual Rectangle
GetBoundingBoxOnScreen(void) const
78 throw (::com::sun::star::uno::RuntimeException
);
80 /// Return the object's current bounding box relative to the parent object.
81 virtual Rectangle
GetBoundingBox(void) const
82 throw (::com::sun::star::uno::RuntimeException
);
85 ///===== XAccessibleContext ==============================================
87 /// Return the number of currently visible children.
88 // is overloaded to calculate this on demand
89 virtual sal_Int32 SAL_CALL
90 getAccessibleChildCount(void)
91 throw (::com::sun::star::uno::RuntimeException
);
93 /// Return the specified child or NULL if index is invalid.
94 // is overloaded to calculate this on demand
95 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
96 getAccessibleChild(sal_Int32 nIndex
)
97 throw (::com::sun::star::uno::RuntimeException
,
98 ::com::sun::star::lang::IndexOutOfBoundsException
);
100 /// Return the set of current states.
101 virtual ::com::sun::star::uno::Reference
<
102 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
103 getAccessibleStateSet(void)
104 throw (::com::sun::star::uno::RuntimeException
);
107 /// Return this object's description.
108 virtual OUString SAL_CALL
109 createAccessibleDescription(void)
110 throw (::com::sun::star::uno::RuntimeException
);
112 /// Return the object's current name.
113 virtual OUString SAL_CALL
114 createAccessibleName(void)
115 throw (::com::sun::star::uno::RuntimeException
);
118 ///===== XAccessibleEventBroadcaster =====================================
120 /** Add listener that is informed of future changes of name,
121 description and so on events.
123 virtual void SAL_CALL
124 addAccessibleEventListener(
125 const ::com::sun::star::uno::Reference
<
126 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
127 throw (com::sun::star::uno::RuntimeException
);
129 // Remove an existing event listener.
130 virtual void SAL_CALL
131 removeAccessibleEventListener(
132 const ::com::sun::star::uno::Reference
<
133 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
134 throw (com::sun::star::uno::RuntimeException
);
136 ///===== XServiceInfo ====================================================
138 /** Returns an identifier for the implementation of this object.
140 virtual OUString SAL_CALL
141 getImplementationName(void)
142 throw (::com::sun::star::uno::RuntimeException
);
144 ///===== XTypeProvider ===================================================
146 /** Returns a implementation id.
148 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
149 getImplementationId(void)
150 throw (::com::sun::star::uno::RuntimeException
);
153 accessibility::AccessibleTextHelper
* mpTextHelper
;
154 EditView
* mpEditView
;
156 EditObjectType meObjectType
;
160 const com::sun::star::uno::Reference
<
161 ::com::sun::star::accessibility::XAccessibleStateSet
>& rxParentStates
);
163 void CreateTextHelper();
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */