1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_HDRCONT_HXX
21 #define SC_HDRCONT_HXX
23 #include <vcl/window.hxx>
24 #include <vcl/seleng.hxx>
25 #include "address.hxx"
27 #define HDR_SIZE_OPTIMUM 0xFFFF
29 // Size of the sliders
30 #define HDR_SLIDERSIZE 2
32 class ScHeaderControl
: public Window
35 SelectionEngine
* pSelEngine
;
40 bool bVertical
; // Vertical = Row header
52 bool bDragging
; // Resizing
60 long GetScrPos( SCCOLROW nEntryNo
) const;
61 SCCOLROW
GetMousePos( const MouseEvent
& rMEvt
, bool& rBorder
) const;
62 bool IsSelectionAllowed(SCCOLROW nPos
) const;
65 void DoPaint( SCCOLROW nStart
, SCCOLROW nEnd
);
67 void DrawShadedRect( long nStart
, long nEnd
, const Color
& rBaseColor
);
70 // Overloaded by Window
72 virtual void Paint( const Rectangle
& rRect
);
74 virtual void MouseMove( const MouseEvent
& rMEvt
);
75 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
76 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
77 virtual void Tracking( const TrackingEvent
& rTEvt
);
79 virtual void RequestHelp( const HelpEvent
& rHEvt
);
83 virtual SCCOLROW
GetPos() const = 0; // current position (Scrolling)
84 virtual sal_uInt16
GetEntrySize( SCCOLROW nEntryNo
) const = 0; // width / height (Pixel)
85 virtual OUString
GetEntryText( SCCOLROW nEntryNo
) const = 0;
87 virtual SCCOLROW
GetHiddenCount( SCCOLROW nEntryNo
) const;
88 virtual bool IsLayoutRTL() const;
89 virtual bool IsMirrored() const;
91 virtual void SetEntrySize( SCCOLROW nPos
, sal_uInt16 nNewWidth
) = 0;
92 virtual void HideEntries( SCCOLROW nStart
, SCCOLROW nEnd
) = 0;
94 virtual void SetMarking( bool bSet
);
95 virtual void SelectWindow();
96 virtual bool IsDisabled() const;
97 virtual bool ResizeAllowed() const;
98 virtual OUString
GetDragHelp( long nVal
);
100 virtual void DrawInvert( long nDragPos
);
101 virtual void Command( const CommandEvent
& rCEvt
);
104 ScHeaderControl( Window
* pParent
, SelectionEngine
* pSelectionEngine
,
105 SCCOLROW nNewSize
, bool bNewVertical
);
108 void SetIgnoreMove(bool bSet
) { bIgnoreMove
= bSet
; }
112 void SetMark( bool bNewSet
, SCCOLROW nNewStart
, SCCOLROW nNewEnd
);
114 long GetWidth() const { return nWidth
; }
115 long GetSmallWidth() const { return nSmallWidth
; }
116 long GetBigWidth() const { return nBigWidth
; }
117 void SetWidth( long nNew
);
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */