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: hdrcont.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 ************************************************************************/
31 #ifndef SC_HDRCONT_HXX
32 #define SC_HDRCONT_HXX
34 #include <vcl/window.hxx>
35 #ifndef _SELENG_HXX //autogen
36 #include <vcl/seleng.hxx>
38 #include "address.hxx"
40 // ---------------------------------------------------------------------------
43 #define HDR_HORIZONTAL 0
44 #define HDR_VERTICAL 1
46 #define HDR_SIZE_OPTIMUM 0xFFFF
49 // Groesse des Sliders
50 #define HDR_SLIDERSIZE 2
52 class ScHeaderControl
: public Window
55 SelectionEngine
* pSelEngine
;
61 BOOL bVertical
; // Vertikal = Zeilenheader
73 BOOL bDragging
; // Groessen aendern
81 long GetScrPos( SCCOLROW nEntryNo
);
82 SCCOLROW
GetMousePos( const MouseEvent
& rMEvt
, BOOL
& rBorder
);
83 bool IsSelectionAllowed(SCCOLROW nPos
) const;
86 void DoPaint( SCCOLROW nStart
, SCCOLROW nEnd
);
88 void DrawShadedRect( long nStart
, long nEnd
, const Color
& rBaseColor
);
91 // von Window ueberladen
93 virtual void Paint( const Rectangle
& rRect
);
95 virtual void MouseMove( const MouseEvent
& rMEvt
);
96 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
97 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
98 virtual void Tracking( const TrackingEvent
& rTEvt
);
100 virtual void RequestHelp( const HelpEvent
& rHEvt
);
104 virtual SCCOLROW
GetPos() = 0; // aktuelle Position (Scrolling)
105 virtual USHORT
GetEntrySize( SCCOLROW nEntryNo
) = 0; // Breite / Hoehe (Pixel)
106 virtual String
GetEntryText( SCCOLROW nEntryNo
) = 0;
108 virtual SCCOLROW
GetHiddenCount( SCCOLROW nEntryNo
);
109 virtual BOOL
IsLayoutRTL();
110 virtual BOOL
IsMirrored();
112 virtual void SetEntrySize( SCCOLROW nPos
, USHORT nNewWidth
) = 0;
113 virtual void HideEntries( SCCOLROW nStart
, SCCOLROW nEnd
) = 0;
115 virtual void SetMarking( BOOL bSet
);
116 virtual void SelectWindow();
117 virtual BOOL
IsDisabled();
118 virtual BOOL
ResizeAllowed();
119 virtual String
GetDragHelp( long nVal
);
121 virtual void DrawInvert( long nDragPos
);
122 virtual void Command( const CommandEvent
& rCEvt
);
125 ScHeaderControl( Window
* pParent
, SelectionEngine
* pSelectionEngine
,
126 SCCOLROW nNewSize
, USHORT nNewFlags
);
129 void SetIgnoreMove(BOOL bSet
) { bIgnoreMove
= bSet
; }
133 void SetMark( BOOL bNewSet
, SCCOLROW nNewStart
, SCCOLROW nNewEnd
);
135 long GetWidth() const { return nWidth
; }
136 long GetSmallWidth() const { return nSmallWidth
; }
137 long GetBigWidth() const { return nBigWidth
; }
138 void SetWidth( long nNew
);