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 INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_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
34 class ScHeaderControl
: public vcl::Window
37 SelectionEngine
* pSelEngine
;
42 bool bVertical
; // Vertical = Row header
54 bool bDragging
; // Resizing
64 long GetScrPos( SCCOLROW nEntryNo
) const;
65 SCCOLROW
GetMousePos( const MouseEvent
& rMEvt
, bool& rBorder
) const;
66 bool IsSelectionAllowed(SCCOLROW nPos
) const;
69 void DoPaint( SCCOLROW nStart
, SCCOLROW nEnd
);
71 void DrawShadedRect( long nStart
, long nEnd
, const Color
& rBaseColor
);
78 virtual void Paint( vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) override
;
80 virtual void MouseMove( const MouseEvent
& rMEvt
) override
;
81 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
82 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
83 virtual void Tracking( const TrackingEvent
& rTEvt
) override
;
85 virtual void RequestHelp( const HelpEvent
& rHEvt
) override
;
89 virtual SCCOLROW
GetPos() const = 0; // current position (Scrolling)
90 virtual sal_uInt16
GetEntrySize( SCCOLROW nEntryNo
) const = 0; // width / height (Pixel)
91 virtual OUString
GetEntryText( SCCOLROW nEntryNo
) const = 0;
93 virtual SCCOLROW
GetHiddenCount( SCCOLROW nEntryNo
) const;
94 virtual bool IsLayoutRTL() const;
95 virtual bool IsMirrored() const;
97 virtual void SetEntrySize( SCCOLROW nPos
, sal_uInt16 nNewWidth
) = 0;
98 virtual void HideEntries( SCCOLROW nStart
, SCCOLROW nEnd
) = 0;
100 virtual void SetMarking( bool bSet
);
101 virtual void SelectWindow();
102 virtual bool IsDisabled() const;
103 virtual bool ResizeAllowed() const;
104 virtual OUString
GetDragHelp( long nVal
);
106 virtual void DrawInvert( long nDragPos
);
107 virtual void Command( const CommandEvent
& rCEvt
) override
;
110 ScHeaderControl( vcl::Window
* pParent
, SelectionEngine
* pSelectionEngine
,
111 SCCOLROW nNewSize
, bool bNewVertical
, ScTabView
* pTab
);
112 virtual ~ScHeaderControl();
114 void SetIgnoreMove(bool bSet
) { bIgnoreMove
= bSet
; }
118 void SetMark( bool bNewSet
, SCCOLROW nNewStart
, SCCOLROW nNewEnd
);
120 long GetWidth() const { return nWidth
; }
121 long GetSmallWidth() const { return nSmallWidth
; }
122 long GetBigWidth() const { return nBigWidth
; }
123 void SetWidth( long nNew
);
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */