Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / AccessibleCell.hxx
blob5fd9025ea3216c6fc21243a1d821272893595c1d
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 .
21 #ifndef _SC_ACCESSIBLECELL_HXX
22 #define _SC_ACCESSIBLECELL_HXX
24 #include "AccessibleCellBase.hxx"
25 #include "global.hxx"
26 #include "viewdata.hxx"
27 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
28 #include <unotools/accessiblerelationsethelper.hxx>
29 #include <editeng/AccessibleStaticTextBase.hxx>
30 #include <comphelper/uno3.hxx>
32 class ScTabViewShell;
33 class ScAccessibleDocument;
35 /** @descr
36 This base class provides an implementation of the
37 <code>AccessibleCell</code> service.
39 class ScAccessibleCell
40 : public ScAccessibleCellBase,
41 public accessibility::AccessibleStaticTextBase
43 public:
44 //===== internal ========================================================
45 ScAccessibleCell(
46 const ::com::sun::star::uno::Reference<
47 ::com::sun::star::accessibility::XAccessible>& rxParent,
48 ScTabViewShell* pViewShell,
49 ScAddress& rCellAddress,
50 sal_Int32 nIndex,
51 ScSplitPos eSplitPos,
52 ScAccessibleDocument* pAccDoc);
54 virtual void Init();
56 using ScAccessibleCellBase::disposing;
57 virtual void SAL_CALL disposing();
59 protected:
60 virtual ~ScAccessibleCell();
62 using ScAccessibleCellBase::IsDefunc;
64 public:
65 ///===== XInterface =====================================================
67 DECLARE_XINTERFACE()
69 ///===== XTypeProvider ===================================================
71 DECLARE_XTYPEPROVIDER()
73 ///===== XAccessibleComponent ============================================
75 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
76 SAL_CALL getAccessibleAtPoint(
77 const ::com::sun::star::awt::Point& rPoint )
78 throw (::com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL grabFocus( )
81 throw (::com::sun::star::uno::RuntimeException);
83 protected:
84 /// Return the object's current bounding box relative to the desktop.
85 virtual Rectangle GetBoundingBoxOnScreen(void) const
86 throw (::com::sun::star::uno::RuntimeException);
88 /// Return the object's current bounding box relative to the parent object.
89 virtual Rectangle GetBoundingBox(void) const
90 throw (::com::sun::star::uno::RuntimeException);
92 public:
93 ///===== XAccessibleContext ==============================================
95 /// Return the number of currently visible children.
96 // is overloaded to calculate this on demand
97 virtual sal_Int32 SAL_CALL
98 getAccessibleChildCount(void)
99 throw (::com::sun::star::uno::RuntimeException);
101 /// Return the specified child or NULL if index is invalid.
102 // is overloaded to calculate this on demand
103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
104 getAccessibleChild(sal_Int32 nIndex)
105 throw (::com::sun::star::uno::RuntimeException,
106 ::com::sun::star::lang::IndexOutOfBoundsException);
108 /// Return the set of current states.
109 virtual ::com::sun::star::uno::Reference<
110 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
111 getAccessibleStateSet(void)
112 throw (::com::sun::star::uno::RuntimeException);
114 virtual ::com::sun::star::uno::Reference<
115 ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
116 getAccessibleRelationSet(void)
117 throw (::com::sun::star::uno::RuntimeException);
119 ///===== XServiceInfo ====================================================
121 /** Returns an identifier for the implementation of this object.
123 virtual OUString SAL_CALL
124 getImplementationName(void)
125 throw (::com::sun::star::uno::RuntimeException);
127 /** Returns a list of all supported services.
129 virtual ::com::sun::star::uno::Sequence< OUString> SAL_CALL
130 getSupportedServiceNames(void)
131 throw (::com::sun::star::uno::RuntimeException);
133 private:
134 ScTabViewShell* mpViewShell;
135 ScAccessibleDocument* mpAccDoc;
137 ScSplitPos meSplitPos;
139 sal_Bool IsDefunc(
140 const com::sun::star::uno::Reference<
141 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
142 virtual sal_Bool IsEditable(
143 const com::sun::star::uno::Reference<
144 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
145 sal_Bool IsOpaque(
146 const com::sun::star::uno::Reference<
147 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates);
148 sal_Bool IsSelected();
150 ScDocument* GetDocument(ScTabViewShell* mpViewShell);
152 ::std::auto_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos);
154 void FillDependends(utl::AccessibleRelationSetHelper* pRelationSet);
155 void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet);
156 void AddRelation(const ScAddress& rCell,
157 const sal_uInt16 aRelationType,
158 ::utl::AccessibleRelationSetHelper* pRelationSet);
159 void AddRelation(const ScRange& rRange,
160 const sal_uInt16 aRelationType,
161 ::utl::AccessibleRelationSetHelper* pRelationSet);
165 #endif
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */