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: ruler.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 ************************************************************************/
30 #ifndef _SVX_RULER_HXX
31 #define _SVX_RULER_HXX
34 #ifndef _RULER_HXX //autogen
35 #include <bf_svtools/ruler.hxx>
38 #ifndef _SFXLSTNER_HXX //autogen
39 #include <bf_svtools/lstner.hxx>
41 class SfxRectangleItem
;
48 class SvxLongLRSpaceItem
;
49 class SvxLongULSpaceItem
;
52 class SvxPagePosSizeItem
;
57 class SvxRuler
: public Ruler
, public SfxListener
59 friend class SvxRulerItem
;
60 SvxRulerItem
**pCtrlItem
;
61 SvxLongLRSpaceItem
*pLRSpaceItem
; //Linker und Rechter Rand
62 SfxRectangleItem
*pMinMaxItem
; //Maxima fuers Draggen
63 SvxLongULSpaceItem
*pULSpaceItem
; //Oberer und Unterer Rand
64 SvxTabStopItem
*pTabStopItem
; //Tabstops
65 SvxLRSpaceItem
*pParaItem
; //Absaetze
66 SvxLRSpaceItem
*pParaBorderItem
; //Border distance
67 SvxPagePosSizeItem
*pPagePosItem
; //Seitenabstaende zum Lineal
68 SvxColumnItem
*pColumnItem
; //Spalten
69 SvxObjectItem
*pObjectItem
; //Objekt
71 SvxRuler_Impl
*pRuler_Imp
;
72 BOOL bAppSetNullOffset
:1;
74 long lLogicNullOffset
; // in logischen Koordinaten
75 long lAppNullOffset
; // in logischen Koordinaten
76 long lMinFrame
; // minimale Framebreite in Pixel
82 // letzte Spalte verkleinern, Shift
83 DRAG_OBJECT_SIZE_LINEAR
= 0x0002,
84 DRAG_OBJECT_SIZE_PROPORTIONAL
= 0x0004, // proportional, Ctrl
85 // nur aktuelle Zeile (Tabelle; Shift-Ctrl)
86 DRAG_OBJECT_ACTLINE_ONLY
= 0x0008,
87 // aktuell gleiche Tastenbelegung
88 DRAG_OBJECT_LEFT_INDENT_ONLY
= DRAG_OBJECT_SIZE_PROPORTIONAL
96 RulerTab
*pTabs
; // Tabpositionen in Pixel
97 RulerIndent
*pIndents
; // Absatzraender in Pixel
98 RulerBorder
*pBorders
;
100 RulerBorder
*pObjectBorders
;
101 SfxBindings
*pBindings
;
109 void StartListening_Impl();
111 // Seitenr"ander oder umgebender Rahmen
112 void UpdateFrame(const SvxLongLRSpaceItem
*);
113 void UpdateFrame(const SvxLongULSpaceItem
*);
114 void UpdateFrameMinMax(const SfxRectangleItem
*);
116 void UpdatePara(const SvxLRSpaceItem
*);
118 void UpdateParaBorder(const SvxLRSpaceItem
*);
120 void Update(const SvxTabStopItem
*);
121 // Seitenposition und -breite
122 void Update(const SvxPagePosSizeItem
*);
124 void Update(const SvxColumnItem
*);
127 void Update( const SvxProtectItem
* );
128 // left-to-right text
129 void UpdateTextRTL( const SfxBoolItem
* );
135 void UpdateColumns();
138 long ConvertHPosPixel(long lPos
) const;
139 long ConvertVPosPixel(long lPos
) const;
140 long ConvertHSizePixel(long lSize
) const;
141 long ConvertVSizePixel(long lSize
) const;
143 long ConvertPosPixel(long lPos
) const;
144 long ConvertSizePixel(long lSize
) const;
148 // long GetLogicFirstLineIndent() const;
149 // long GetLogicLeftIndent() const;
151 inline long GetLeftFrameMargin() const;
152 long GetRightFrameMargin() const;
170 virtual void MouseMove( const MouseEvent
& rMEvt
);
172 virtual void SFX_NOTIFY( SfxBroadcaster
& rBC
, const TypeId
& rBCType
,
173 const SfxHint
& rHint
, const TypeId
& rHintType
);
175 // Berechnung der Grenzwerte fuer Objectgrenzen
176 // Werte sind bezogen auf die Seite
177 BOOL
IsActLastColumn(
178 BOOL bForceDontConsiderHidden
= FALSE
, USHORT nAct
=USHRT_MAX
) const ;
181 #define SVXRULER_SUPPORT_TABS 0x0001
182 #define SVXRULER_SUPPORT_PARAGRAPH_MARGINS 0x0002
183 #define SVXRULER_SUPPORT_BORDERS 0x0004
184 #define SVXRULER_SUPPORT_OBJECT 0x0008
185 #define SVXRULER_SUPPORT_SET_NULLOFFSET 0x0010
186 #define SVXRULER_SUPPORT_NEGATIVE_MARGINS 0x0020
187 #define SVXRULER_SUPPORT_PARAGRAPH_MARGINS_VERTICAL 0x0040
189 SvxRuler(Window
* pParent
,
192 SfxBindings
&rBindings
,
193 WinBits nWinStyle
= WB_STDRULER
);
198 // Setzen / Erfragen NullOffset in logischen Einheiten
200 void SetActive(BOOL bOn
= TRUE
);
202 void ForceUpdate() { Update(); }
205 }//end of namespace binfilter