sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svx / unoedhlp.hxx
blob2a1bf7bcc10f44305577d3734bcf91818a29ef7f
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: unoedhlp.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
31 #ifndef _SVX_UNOEDHLP_HXX
32 #define _SVX_UNOEDHLP_HXX
34 #include <memory>
35 #include <tools/solar.h>
36 #include <tools/gen.hxx>
38 namespace binfilter {
40 struct EENotify;
41 class EditEngine;
43 /** Helper class for common functionality in edit sources
45 class SvxEditSourceHelper
47 public:
48 /** Calculate attribute run for EditEngines
50 Please note that the range returned is half-open: [nStartIndex,nEndIndex)
52 @param nStartIndex
53 Herein, the start index of the range of similar attributes is returned
55 @param nEndIndex
56 Herein, the end index (exclusive) of the range of similar attributes is returned
58 @param rEE
59 The EditEngine to query for attributes
61 @param nPara
62 The paragraph the following index value is to be interpreted in
64 @param nIndex
65 The character index from which the range of similar attributed characters is requested
67 @return sal_True, if the range has been successfully determined
69 static sal_Bool GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, const EditEngine& rEE, USHORT nPara, USHORT nIndex );
71 /** Convert point from edit engine to user coordinate space
73 As the edit engine internally keeps vertical text unrotated,
74 all internal edit engine methods return their stuff unrotated,
75 too. This method rotates and shifts given point appropriately,
76 if vertical writing is on.
78 @param rPoint
79 Point to transform
81 @param rEESize
82 Paper size of the edit engine
84 @param bIsVertical
85 Whether output text is vertical or not
87 @return the possibly transformed point
89 static Point EEToUserSpace( const Point& rPoint, const Size& rEESize, bool bIsVertical );
91 /** Convert point from user to edit engine coordinate space
93 As the edit engine internally keeps vertical text unrotated,
94 all internal edit engine methods return their stuff unrotated,
95 too. This method rotates and shifts given point appropriately,
96 if vertical writing is on.
98 @param rPoint
99 Point to transform
101 @param rEESize
102 Paper size of the edit engine
104 @param bIsVertical
105 Whether output text is vertical or not
107 @return the possibly transformed point
109 static Point UserSpaceToEE( const Point& rPoint, const Size& rEESize, bool bIsVertical );
111 /** Convert rect from edit engine to user coordinate space
113 As the edit engine internally keeps vertical text unrotated,
114 all internal edit engine methods return their stuff unrotated,
115 too. This method rotates and shifts given rect appropriately,
116 if vertical writing is on.
118 @param rRect
119 Rectangle to transform
121 @param rEESize
122 Paper size of the edit engine
124 @param bIsVertical
125 Whether output text is vertical or not
127 @return the possibly transformed rect
129 static Rectangle EEToUserSpace( const Rectangle& rRect, const Size& rEESize, bool bIsVertical );
132 }//end of namespace binfilter
133 #endif