1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: crstate.hxx,v $
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 ************************************************************************/
35 #include <swtypes.hxx>
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
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
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
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)
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.
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
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
118 xub_StrLen nCharOfst
;
123 // CrsrTravelling-Staties (fuer GetCrsrOfst)
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
;
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
) :
165 nCursorBidiLevel( 0 ),
167 bRealHeight( FALSE
),
172 bSetInReadOnly( FALSE
),
176 bPosMatchesBounds( FALSE
)
178 SwCrsrMoveState( SwFillCrsrPos
*pInitFill
) :
181 eState( MV_SETONLYTEXT
),
182 nCursorBidiLevel( 0 ),
184 bRealHeight( FALSE
),
189 bSetInReadOnly( FALSE
),
193 bPosMatchesBounds( FALSE
)
198 } //namespace binfilter