merge the formfield patch from ooo-build
[ooovba.git] / sc / source / ui / inc / AccessibleEditObject.hxx
blob52ae323dcddf7c1445682eebb84cf25f154a86b9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleEditObject.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _SC_ACCESSIBLEEDITOBJECT_HXX
33 #define _SC_ACCESSIBLEEDITOBJECT_HXX
35 #include "AccessibleContextBase.hxx"
37 namespace accessibility
39 class AccessibleTextHelper;
41 class EditView;
42 class Window;
44 enum EditObjectType
46 CellInEditMode,
47 EditLine,
48 EditControl
51 /** @descr
52 This base class provides an implementation of the
53 <code>AccessibleCell</code> service.
55 class ScAccessibleEditObject
56 : public ScAccessibleContextBase
58 public:
59 //===== internal ========================================================
60 ScAccessibleEditObject(
61 const ::com::sun::star::uno::Reference<
62 ::com::sun::star::accessibility::XAccessible>& rxParent,
63 EditView* pEditView, Window* pWin, const rtl::OUString& rName,
64 const rtl::OUString& rDescription, EditObjectType eObjectType);
66 protected:
67 virtual ~ScAccessibleEditObject();
69 using ScAccessibleContextBase::IsDefunc;
71 public:
72 using ScAccessibleContextBase::addEventListener;
73 using ScAccessibleContextBase::removeEventListener;
74 using ScAccessibleContextBase::disposing;
76 virtual void SAL_CALL disposing();
78 virtual void LostFocus();
80 virtual void GotFocus();
82 ///===== XAccessibleComponent ============================================
84 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
85 SAL_CALL getAccessibleAtPoint(
86 const ::com::sun::star::awt::Point& rPoint )
87 throw (::com::sun::star::uno::RuntimeException);
89 protected:
90 /// Return the object's current bounding box relative to the desktop.
91 virtual Rectangle GetBoundingBoxOnScreen(void) const
92 throw (::com::sun::star::uno::RuntimeException);
94 /// Return the object's current bounding box relative to the parent object.
95 virtual Rectangle GetBoundingBox(void) const
96 throw (::com::sun::star::uno::RuntimeException);
98 public:
99 ///===== XAccessibleContext ==============================================
101 /// Return the number of currently visible children.
102 // is overloaded to calculate this on demand
103 virtual sal_Int32 SAL_CALL
104 getAccessibleChildCount(void)
105 throw (::com::sun::star::uno::RuntimeException);
107 /// Return the specified child or NULL if index is invalid.
108 // is overloaded to calculate this on demand
109 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
110 getAccessibleChild(sal_Int32 nIndex)
111 throw (::com::sun::star::uno::RuntimeException,
112 ::com::sun::star::lang::IndexOutOfBoundsException);
114 /// Return the set of current states.
115 virtual ::com::sun::star::uno::Reference<
116 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
117 getAccessibleStateSet(void)
118 throw (::com::sun::star::uno::RuntimeException);
120 protected:
121 /// Return this object's description.
122 virtual ::rtl::OUString SAL_CALL
123 createAccessibleDescription(void)
124 throw (::com::sun::star::uno::RuntimeException);
126 /// Return the object's current name.
127 virtual ::rtl::OUString SAL_CALL
128 createAccessibleName(void)
129 throw (::com::sun::star::uno::RuntimeException);
131 public:
132 ///===== XAccessibleEventBroadcaster =====================================
134 /** Add listener that is informed of future changes of name,
135 description and so on events.
137 virtual void SAL_CALL
138 addEventListener(
139 const ::com::sun::star::uno::Reference<
140 ::com::sun::star::accessibility::XAccessibleEventListener>& xListener)
141 throw (com::sun::star::uno::RuntimeException);
143 // Remove an existing event listener.
144 virtual void SAL_CALL
145 removeEventListener(
146 const ::com::sun::star::uno::Reference<
147 ::com::sun::star::accessibility::XAccessibleEventListener>& xListener)
148 throw (com::sun::star::uno::RuntimeException);
150 ///===== XServiceInfo ====================================================
152 /** Returns an identifier for the implementation of this object.
154 virtual ::rtl::OUString SAL_CALL
155 getImplementationName(void)
156 throw (::com::sun::star::uno::RuntimeException);
158 ///===== XTypeProvider ===================================================
160 /** Returns a implementation id.
162 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL
163 getImplementationId(void)
164 throw (::com::sun::star::uno::RuntimeException);
166 private:
167 accessibility::AccessibleTextHelper* mpTextHelper;
168 EditView* mpEditView;
169 Window* mpWindow;
170 EditObjectType meObjectType;
171 sal_Bool mbHasFocus;
173 sal_Bool IsDefunc(
174 const com::sun::star::uno::Reference<
175 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
177 void CreateTextHelper();
181 #endif