update dev300-m58
[ooovba.git] / sw / source / core / access / accframe.hxx
blobb0b916fe920ba1860e49e7d3efd1e5ccca7f6dce
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: accframe.hxx,v $
10 * $Revision: 1.19 $
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 ************************************************************************/
30 #ifndef _ACCFRAME_HXX
31 #define _ACCFRAME_HXX
33 #include <sal/types.h>
35 #include <list>
36 #include <accfrmobj.hxx>
38 // Any method of this class must be called with an acquired solar mutex!
40 class SwAccessibleMap;
42 class SwAccessibleFrame
44 SwRect maVisArea;
45 const SwFrm* mpFrm;
46 const sal_Bool mbIsInPagePreview;
48 protected:
49 // --> OD 2007-06-29 #i77106#
50 // method needs to be called by new class <SwAccessibleTableColHeaders>
51 static sal_Int32 GetChildCount( const SwRect& rVisArea,
52 const SwFrm *pFrm,
53 sal_Bool bInPagePreview );
54 private:
55 static SwFrmOrObj GetChild( const SwRect& rVisArea,
56 const SwFrm *pFrm,
57 sal_Int32& rPos,
58 sal_Bool bInPagePreview);
59 static sal_Bool GetChildIndex( const SwRect& rVisArea,
60 const SwFrm *pFrm,
61 const SwFrmOrObj& rChild,
62 sal_Int32& rPos,
63 sal_Bool bInPagePreview );
64 static SwFrmOrObj GetChildAtPixel( const SwRect& rVisArea,
65 const SwFrm *pFrm,
66 const Point& rPos,
67 sal_Bool bInPagePreview,
68 const SwAccessibleMap *pMap );
69 static void GetChildren( const SwRect& rVisArea, const SwFrm *pFrm,
70 ::std::list< SwFrmOrObj >& rChildren,
71 sal_Bool bInPagePreview );
73 protected:
75 sal_Bool IsEditable( ViewShell *pVSh ) const;
77 sal_Bool IsOpaque( ViewShell *pVSh ) const;
79 inline sal_Bool IsShowing( const SwRect& rFrm ) const;
80 inline sal_Bool IsShowing( const SwFrmOrObj& rFrmOrObj ) const;
81 inline sal_Bool IsShowing() const;
83 inline sal_Bool IsInPagePreview() const
85 return mbIsInPagePreview;
88 inline void ClearFrm()
90 mpFrm = 0;
93 SwAccessibleFrame( const SwRect& rVisArea,
94 const SwFrm *pFrm,
95 sal_Bool bIsPagePreview );
96 virtual ~SwAccessibleFrame();
98 public:
99 // Return the SwFrm this context is attached to.
100 const SwFrm *GetFrm() const { return mpFrm; };
103 static const SwFrm *GetParent( const SwFrmOrObj& rFrmOrObj,
104 sal_Bool bInPagePreview );
106 protected:
108 // Return the bounding box of the frame clipped to the vis area. If
109 // no frame is specified, use this' frame.
110 SwRect GetBounds( const SwFrm *pFrm=0 );
112 // Return the upper that has a context attached. This might be
113 // another one than the immediate upper.
114 inline const SwFrm *GetParent() const;
116 // Return the lower count or the nth lower, there the lowers have a
117 // not be same one as the SwFrm's lowers
118 inline sal_Int32 GetChildCount() const;
119 inline SwFrmOrObj GetChild( sal_Int32 nPos ) const;
120 inline sal_Int32 GetChildIndex( const SwFrmOrObj& rChild ) const;
121 inline SwFrmOrObj GetChildAtPixel( const Point& rPos,
122 const SwAccessibleMap *pMap ) const;
123 inline void GetChildren( ::std::list< SwFrmOrObj >& rChildren ) const;
125 inline void SetVisArea( const SwRect& rNewVisArea )
127 maVisArea = rNewVisArea;
130 inline const SwRect& GetVisArea() const
132 return maVisArea;
136 String GetFormattedPageNumber() const;
139 inline sal_Bool SwAccessibleFrame::IsShowing( const SwRect& rFrm ) const
141 return rFrm.IsOver( maVisArea );
144 inline sal_Bool SwAccessibleFrame::IsShowing( const SwFrmOrObj& rFrmOrObj ) const
146 return IsShowing( rFrmOrObj.GetBox() );
149 inline sal_Bool SwAccessibleFrame::IsShowing() const
151 SwFrmOrObj aFrmOrObj( GetFrm() );
152 return IsShowing( aFrmOrObj );
155 inline const SwFrm *SwAccessibleFrame::GetParent() const
157 SwFrmOrObj aFrmOrObj( GetFrm() );
158 return GetParent( aFrmOrObj, IsInPagePreview() );
161 inline sal_Int32 SwAccessibleFrame::GetChildCount() const
163 return GetChildCount( maVisArea, mpFrm, IsInPagePreview() );
166 inline SwFrmOrObj SwAccessibleFrame::GetChild( sal_Int32 nPos ) const
168 return GetChild( maVisArea, mpFrm, nPos, IsInPagePreview() );
171 inline sal_Int32 SwAccessibleFrame::GetChildIndex( const SwFrmOrObj& rChild ) const
173 sal_Int32 nPos = 0;
174 return GetChildIndex( maVisArea, mpFrm, rChild, nPos, IsInPagePreview() ) ? nPos : -1L;
177 inline SwFrmOrObj SwAccessibleFrame::GetChildAtPixel( const Point& rPos,
178 const SwAccessibleMap *pMap ) const
180 return GetChildAtPixel( maVisArea, mpFrm, rPos, IsInPagePreview(), pMap );
183 inline void SwAccessibleFrame::GetChildren( ::std::list< SwFrmOrObj >& rChildren ) const
185 GetChildren( maVisArea, mpFrm, rChildren, IsInPagePreview() );
187 #endif