nss: upgrade to release 3.73
[LibreOffice.git] / sc / source / ui / inc / hdrcont.hxx
blob03b14af70c98575918a9e0a761140bf85bc6a56e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/timer.hxx>
25 #include <scdllapi.h>
26 #include <types.hxx>
28 #define HDR_SIZE_OPTIMUM 0xFFFF
30 // Size of the sliders
31 #define HDR_SLIDERSIZE 2
33 class ScTabView;
34 class SelectionEngine;
36 class ScHeaderControl : public vcl::Window
38 private:
39 SelectionEngine* pSelEngine;
40 Timer aShowHelpTimer;
41 vcl::Font aNormFont;
42 vcl::Font aBoldFont;
43 bool bBoldSet;
45 bool bVertical; // Vertical = Row header
47 tools::Long nWidth;
48 tools::Long nSmallWidth;
49 tools::Long nBigWidth;
51 SCCOLROW nSize;
53 SCCOLROW nMarkStart;
54 SCCOLROW nMarkEnd;
55 bool bMarkRange;
57 bool bDragging; // Resizing
58 SCCOLROW nDragNo;
59 tools::Long nDragStart;
60 tools::Long nDragPos;
61 void* nTipVisible;
62 bool bDragMoved;
64 bool bIgnoreMove;
66 bool bInRefMode;
68 tools::Long GetScrPos( SCCOLROW nEntryNo ) const;
69 SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const;
70 bool IsSelectionAllowed(SCCOLROW nPos) const;
71 void ShowDragHelp();
72 void HideDragHelp();
74 void DoPaint( SCCOLROW nStart, SCCOLROW nEnd );
76 DECL_LINK(ShowDragHelpHdl, Timer*, void);
78 protected:
79 ScTabView* pTabView;
81 // Window overrides
83 virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
85 virtual void MouseMove( const MouseEvent& rMEvt ) override;
86 virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
87 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
88 virtual void Tracking( const TrackingEvent& rTEvt ) override;
90 virtual void RequestHelp( const HelpEvent& rHEvt ) override;
92 // new methods
94 virtual SCCOLROW GetPos() const = 0; // current position (Scrolling)
95 virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) const = 0; // width / height (Pixel)
96 virtual OUString GetEntryText( SCCOLROW nEntryNo ) const = 0;
98 virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo ) const;
99 virtual bool IsLayoutRTL() const;
100 virtual bool IsMirrored() const;
102 virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0;
103 virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0;
105 virtual void SetMarking( bool bSet );
106 virtual void SelectWindow();
107 virtual bool IsDisabled() const;
108 virtual bool ResizeAllowed() const;
109 virtual OUString GetDragHelp( tools::Long nVal );
111 virtual void DrawInvert( tools::Long nDragPos );
112 virtual void Command( const CommandEvent& rCEvt ) override;
113 virtual void dispose() override;
115 public:
116 ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelectionEngine,
117 SCCOLROW nNewSize, bool bNewVertical, ScTabView* pTab );
118 virtual ~ScHeaderControl() override;
120 void SetIgnoreMove(bool bSet) { bIgnoreMove = bSet; }
122 void StopMarking();
124 void SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd );
126 tools::Long GetWidth() const { return nWidth; }
127 tools::Long GetSmallWidth() const { return nSmallWidth; }
128 tools::Long GetBigWidth() const { return nBigWidth; }
129 void SetWidth( tools::Long nNew );
130 void GetMarkRange(SCCOLROW& rStart, SCCOLROW& rEnd) const;
133 #endif
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */