Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / crstate.hxx
blob735735c9efaf2fac69091eed13a191c081b5e018
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: crstate.hxx,v $
10 * $Revision: 1.6 $
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 _CRSTATE_HXX
31 #define _CRSTATE_HXX
34 #ifndef _SWTYPES_HXX
35 #include <swtypes.hxx>
36 #endif
37 #ifndef _SWRECT_HXX
38 #include <swrect.hxx>
39 #endif
40 namespace binfilter {
42 enum SwFillMode
44 FILL_TAB, // default, Auffuellen mit Tabulatoren
45 FILL_SPACE, // ... mit Tabulatoren und Spaces
46 FILL_MARGIN, // nur links, zentriert, rechts Ausrichten
47 FILL_INDENT // durch linken Absatzeinzug
50 struct SwFillCrsrPos
52 SwRect aCrsr; // Position und Groesse des Shadowcursors
53 USHORT nParaCnt; // Anzahl der einzufuegenden Absaetze
54 USHORT nTabCnt; // Anzahl der Tabs bzw. Groesse des Einzugs
55 USHORT nSpaceCnt; // Anzahl der einzufuegenden Leerzeichen
56 USHORT nColumnCnt; // Anzahl der notwendigen Spaltenumbrueche
57 SwHoriOrient eOrient; // Absatzausrichtung
58 SwFillMode eMode; // Gewuenschte Auffuellregel
59 SwFillCrsrPos( SwFillMode eMd = FILL_TAB ) :
60 nParaCnt( 0 ), nTabCnt( 0 ), nSpaceCnt( 0 ), nColumnCnt( 0 ),
61 eOrient( HORI_NONE ), eMode( eMd )
65 // Multiportion types: two lines, bidirectional, 270 degrees rotation,
66 // ruby portion and 90 degrees rotation
67 #define MT_TWOLINE 0
68 #define MT_BIDI 1
69 #define MT_ROT_270 3
70 #define MT_RUBY 4
71 #define MT_ROT_90 7
73 struct Sw2LinesPos
75 SwRect aLine; // Position and size of the line
76 SwRect aPortion; // Position and size of the multi portion
77 SwRect aPortion2; // needed for nested multi portions
78 BYTE nMultiType; // Multiportion type
81 /**
82 * SwSpecialPos. This structure is used to pass some additional information
83 * during the call of SwTxtFrm::GetCharRect(). An SwSpecialPos defines a position
84 * inside a portion which does not have a representation in the core string or
85 * which is only represented by one position, e.g., field portions,
86 * number portions, ergo sum and quo vadis portions.
88 * nCharOfst - The offset inside the special portion. Fields and its
89 * follow fields are treated as one long special portion.
90 * nLineOfst - The number of lines between the beginning of the special
91 * portion and nCharOfst. A line offset required to be
92 * nCharOfst relative to the beginning of the line.
93 * nExtendRange - Setting this identifies portions which are in front or
94 * behind the core string (number portion, quo vadis)
96 * Examples 1)
98 * Get the position of the second character inside a number portion:
99 * nCharOfst = 2; nLineOfst = 0; nExtendRange = SP_EXTEND_RANGE_BEFORE;
100 * Call SwTxtFrm:::GetCharRect with core string position 0.
102 * Example 2)
104 * Field A - Length = 5
105 * Follow field B - Length = 9
106 * Get the position of the third character in follow field B, core position
107 * of field A is 33.
108 * nCharOfst = 7; nLineOfst = 0; nExtendRange = SP_EXTEND_RANGE_NONE;
109 * Call SwTxtFrm:::GetCharRect with core string position 33.
112 #define SP_EXTEND_RANGE_NONE 0
113 #define SP_EXTEND_RANGE_BEFORE 1
114 #define SP_EXTEND_RANGE_BEHIND 2
116 struct SwSpecialPos
118 xub_StrLen nCharOfst;
119 USHORT nLineOfst;
120 BYTE nExtendRange;
123 // CrsrTravelling-Staties (fuer GetCrsrOfst)
124 enum CrsrMoveState
126 MV_NONE, // default
127 MV_UPDOWN, // Crsr Up/Down
128 MV_RIGHTMARGIN, // an rechten Rand
129 MV_LEFTMARGIN, // an linken Rand
130 MV_SETONLYTEXT, // mit dem Cursr nur im Text bleiben
131 MV_TBLSEL // nicht in wiederholte Headlines
134 // struct fuer spaetere Erweiterungen
135 struct SwCrsrMoveState
137 SwFillCrsrPos *pFill; // fuer das automatische Auffuellen mit Tabs etc.
138 Sw2LinesPos *p2Lines; // for selections inside/around 2line portions
139 SwSpecialPos* pSpecialPos; // for positions inside fields
140 Point aRealHeight; // enthaelt dann die Position/Hoehe des Cursors
141 CrsrMoveState eState;
142 BYTE nCursorBidiLevel;
143 BOOL bStop :1;
144 BOOL bRealHeight :1; // Soll die reale Hoehe berechnet werden?
145 BOOL bFieldInfo :1; // Sollen Felder erkannt werden?
146 BOOL bPosCorr :1; // Point musste korrigiert werden
147 BOOL bFtnNoInfo :1; // Fussnotennumerierung erkannt
148 BOOL bExactOnly :1; // GetCrsrOfst nur nach Exakten Treffern
149 // suchen lassen, sprich niemals in das
150 // GetCntntPos laufen.
151 BOOL bFillRet :1; // wird nur im FillModus temp. genutzt
152 BOOL bSetInReadOnly :1; // ReadOnlyBereiche duerfen betreten werden
153 BOOL bRealWidth :1; // Calculation of the width required
154 BOOL b2Lines :1; // Check 2line portions and fill p2Lines
155 BOOL bNoScroll :1; // No scrolling of undersized textframes
156 BOOL bPosMatchesBounds :1; // GetCrsrOfst should not return the next
157 // position if screen position is inside second
158 // have of bound rect
160 SwCrsrMoveState( CrsrMoveState eSt = MV_NONE ) :
161 pFill( NULL ),
162 p2Lines( NULL ),
163 pSpecialPos( NULL ),
164 eState( eSt ),
165 nCursorBidiLevel( 0 ),
166 bStop( FALSE ),
167 bRealHeight( FALSE ),
168 bFieldInfo( FALSE ),
169 bPosCorr( FALSE ),
170 bFtnNoInfo( FALSE ),
171 bExactOnly( FALSE ),
172 bSetInReadOnly( FALSE ),
173 bRealWidth( FALSE ),
174 b2Lines( FALSE ),
175 bNoScroll( FALSE ),
176 bPosMatchesBounds( FALSE )
178 SwCrsrMoveState( SwFillCrsrPos *pInitFill ) :
179 pFill( pInitFill ),
180 pSpecialPos( NULL ),
181 eState( MV_SETONLYTEXT ),
182 nCursorBidiLevel( 0 ),
183 bStop( FALSE ),
184 bRealHeight( FALSE ),
185 bFieldInfo( FALSE ),
186 bPosCorr( FALSE ),
187 bFtnNoInfo( FALSE ),
188 bExactOnly( FALSE ),
189 bSetInReadOnly( FALSE ),
190 bRealWidth( FALSE ),
191 b2Lines( FALSE ),
192 bNoScroll( FALSE ),
193 bPosMatchesBounds( FALSE )
198 } //namespace binfilter
199 #endif