LibreOffice Module sc (master)
1
sc
source
ui
inc
hdrcont.hxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
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/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
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 .
18
*/
19
20
#pragma once
21
22
#include <
vcl/window.hxx
>
23
#include <
vcl/timer.hxx
>
24
#include <types.hxx>
25
26
#define HDR_SIZE_OPTIMUM 0xFFFF
27
28
// Size of the sliders
29
#define HDR_SLIDERSIZE 2
30
31
class
ScTabView
;
32
class
SelectionEngine
;
33
34
class
ScHeaderControl
:
public
vcl::Window
35
{
36
private
:
37
SelectionEngine
*
pSelEngine
;
38
Timer
aShowHelpTimer
;
39
vcl::Font
aNormFont
;
40
vcl::Font
aBoldFont
;
41
vcl::Font
aAutoFilterFont
;
42
bool
bBoldSet
;
43
bool
bAutoFilterSet
;
44
45
bool
bVertical
;
// Vertical = Row header
46
47
tools::Long
nWidth
;
48
tools::Long
nSmallWidth
;
49
tools::Long
nBigWidth
;
50
51
SCCOLROW
nSize
;
52
53
SCCOLROW
nMarkStart
;
54
SCCOLROW
nMarkEnd
;
55
bool
bMarkRange
;
56
57
bool
bDragging
;
// Resizing
58
SCCOLROW
nDragNo
;
59
tools::Long
nDragStart
;
60
tools::Long
nDragPos
;
61
void
*
nTipVisible
;
62
bool
bDragMoved
;
63
64
bool
bIgnoreMove
;
65
66
bool
bInRefMode
;
67
68
tools::Long
GetScrPos
(
SCCOLROW
nEntryNo )
const
;
69
SCCOLROW
GetMousePos
(
const
Point
& rPos,
bool
& rBorder)
const
;
70
bool
IsSelectionAllowed
(
SCCOLROW
nPos)
const
;
71
void
ShowDragHelp
();
72
void
HideDragHelp
();
73
74
void
DoPaint
(
SCCOLROW
nStart,
SCCOLROW
nEnd );
75
76
DECL_LINK
(ShowDragHelpHdl,
Timer
*,
void
);
77
78
protected
:
79
ScTabView
*
pTabView
;
80
81
// Window overrides
82
83
virtual
void
Paint
(
vcl::RenderContext
& rRenderContext,
const
tools::Rectangle
& rRect )
override
;
84
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
;
89
90
virtual
void
RequestHelp
(
const
HelpEvent
& rHEvt )
override
;
91
92
// new methods
93
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;
97
98
virtual
SCCOLROW
GetHiddenCount
(
SCCOLROW
nEntryNo )
const
;
99
virtual
bool
IsLayoutRTL
()
const
;
100
virtual
bool
IsMirrored
()
const
;
101
102
virtual
void
SetEntrySize
(
SCCOLROW
nPos, sal_uInt16 nNewWidth ) = 0;
103
virtual
void
HideEntries
(
SCCOLROW
nStart,
SCCOLROW
nEnd ) = 0;
104
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 );
110
111
virtual
void
DrawInvert
(
tools::Long
nDragPos
);
112
virtual
void
Command
(
const
CommandEvent
& rCEvt )
override
;
113
virtual
void
dispose
()
override
;
114
115
public
:
116
ScHeaderControl
(
vcl::Window
* pParent,
SelectionEngine
* pSelectionEngine,
117
SCCOLROW
nNewSize,
bool
bNewVertical,
ScTabView
* pTab );
118
virtual
~ScHeaderControl
()
override
;
119
120
void
SetIgnoreMove
(
bool
bSet) {
bIgnoreMove
= bSet; }
121
122
void
StopMarking
();
123
124
void
SetMark
(
bool
bNewSet,
SCCOLROW
nNewStart,
SCCOLROW
nNewEnd );
125
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
;
131
};
132
133
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CommandEvent
HelpEvent
MouseEvent
OutputDevice
Point
ScHeaderControl
Definition:
hdrcont.hxx:35
ScHeaderControl::GetHiddenCount
virtual SCCOLROW GetHiddenCount(SCCOLROW nEntryNo) const
Definition:
hdrcont.cxx:1070
ScHeaderControl::IsLayoutRTL
virtual bool IsLayoutRTL() const
Definition:
hdrcont.cxx:1081
ScHeaderControl::SetIgnoreMove
void SetIgnoreMove(bool bSet)
Definition:
hdrcont.hxx:120
ScHeaderControl::GetMarkRange
void GetMarkRange(SCCOLROW &rStart, SCCOLROW &rEnd) const
Definition:
hdrcont.cxx:1118
ScHeaderControl::bIgnoreMove
bool bIgnoreMove
Definition:
hdrcont.hxx:64
ScHeaderControl::aAutoFilterFont
vcl::Font aAutoFilterFont
Definition:
hdrcont.hxx:41
ScHeaderControl::RequestHelp
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition:
hdrcont.cxx:1059
ScHeaderControl::IsDisabled
virtual bool IsDisabled() const
Definition:
hdrcont.cxx:1091
ScHeaderControl::GetBigWidth
tools::Long GetBigWidth() const
Definition:
hdrcont.hxx:128
ScHeaderControl::pTabView
ScTabView * pTabView
Definition:
hdrcont.hxx:79
ScHeaderControl::GetPos
virtual SCCOLROW GetPos() const =0
ScHeaderControl::DoPaint
void DoPaint(SCCOLROW nStart, SCCOLROW nEnd)
Definition:
hdrcont.cxx:127
ScHeaderControl::nMarkEnd
SCCOLROW nMarkEnd
Definition:
hdrcont.hxx:54
ScHeaderControl::nDragStart
tools::Long nDragStart
Definition:
hdrcont.hxx:59
ScHeaderControl::ShowDragHelp
void ShowDragHelp()
Definition:
hdrcont.cxx:1007
ScHeaderControl::GetSmallWidth
tools::Long GetSmallWidth() const
Definition:
hdrcont.hxx:127
ScHeaderControl::pSelEngine
SelectionEngine * pSelEngine
Definition:
hdrcont.hxx:37
ScHeaderControl::MouseButtonDown
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition:
hdrcont.cxx:707
ScHeaderControl::bInRefMode
bool bInRefMode
Definition:
hdrcont.hxx:66
ScHeaderControl::Tracking
virtual void Tracking(const TrackingEvent &rTEvt) override
Definition:
hdrcont.cxx:915
ScHeaderControl::SetMark
void SetMark(bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd)
Definition:
hdrcont.cxx:146
ScHeaderControl::nBigWidth
tools::Long nBigWidth
Definition:
hdrcont.hxx:49
ScHeaderControl::aBoldFont
vcl::Font aBoldFont
Definition:
hdrcont.hxx:40
ScHeaderControl::Paint
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition:
hdrcont.cxx:219
ScHeaderControl::DrawInvert
virtual void DrawInvert(tools::Long nDragPos)
Definition:
hdrcont.cxx:1105
ScHeaderControl::GetWidth
tools::Long GetWidth() const
Definition:
hdrcont.hxx:126
ScHeaderControl::SelectWindow
virtual void SelectWindow()
Definition:
hdrcont.cxx:1101
ScHeaderControl::nSmallWidth
tools::Long nSmallWidth
Definition:
hdrcont.hxx:48
ScHeaderControl::nDragPos
tools::Long nDragPos
Definition:
hdrcont.hxx:60
ScHeaderControl::aShowHelpTimer
Timer aShowHelpTimer
Definition:
hdrcont.hxx:38
ScHeaderControl::ScHeaderControl
ScHeaderControl(vcl::Window *pParent, SelectionEngine *pSelectionEngine, SCCOLROW nNewSize, bool bNewVertical, ScTabView *pTab)
Definition:
hdrcont.cxx:50
ScHeaderControl::bDragging
bool bDragging
Definition:
hdrcont.hxx:57
ScHeaderControl::bDragMoved
bool bDragMoved
Definition:
hdrcont.hxx:62
ScHeaderControl::nTipVisible
void * nTipVisible
Definition:
hdrcont.hxx:61
ScHeaderControl::nDragNo
SCCOLROW nDragNo
Definition:
hdrcont.hxx:58
ScHeaderControl::IsSelectionAllowed
bool IsSelectionAllowed(SCCOLROW nPos) const
Definition:
hdrcont.cxx:668
ScHeaderControl::nMarkStart
SCCOLROW nMarkStart
Definition:
hdrcont.hxx:53
ScHeaderControl::DECL_LINK
DECL_LINK(ShowDragHelpHdl, Timer *, void)
ScHeaderControl::HideDragHelp
void HideDragHelp()
Definition:
hdrcont.cxx:1049
ScHeaderControl::SetWidth
void SetWidth(tools::Long nNew)
Definition:
hdrcont.cxx:109
ScHeaderControl::MouseMove
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition:
hdrcont.cxx:862
ScHeaderControl::HideEntries
virtual void HideEntries(SCCOLROW nStart, SCCOLROW nEnd)=0
ScHeaderControl::GetDragHelp
virtual OUString GetDragHelp(tools::Long nVal)
Definition:
hdrcont.cxx:1109
ScHeaderControl::Command
virtual void Command(const CommandEvent &rCEvt) override
Definition:
hdrcont.cxx:928
ScHeaderControl::bVertical
bool bVertical
Definition:
hdrcont.hxx:45
ScHeaderControl::bAutoFilterSet
bool bAutoFilterSet
Definition:
hdrcont.hxx:43
ScHeaderControl::dispose
virtual void dispose() override
Definition:
hdrcont.cxx:103
ScHeaderControl::MouseButtonUp
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition:
hdrcont.cxx:804
ScHeaderControl::nWidth
tools::Long nWidth
Definition:
hdrcont.hxx:47
ScHeaderControl::IsMirrored
virtual bool IsMirrored() const
Definition:
hdrcont.cxx:1086
ScHeaderControl::SetEntrySize
virtual void SetEntrySize(SCCOLROW nPos, sal_uInt16 nNewWidth)=0
ScHeaderControl::nSize
SCCOLROW nSize
Definition:
hdrcont.hxx:51
ScHeaderControl::~ScHeaderControl
virtual ~ScHeaderControl() override
Definition:
hdrcont.cxx:123
ScHeaderControl::GetEntrySize
virtual sal_uInt16 GetEntrySize(SCCOLROW nEntryNo) const =0
ScHeaderControl::ResizeAllowed
virtual bool ResizeAllowed() const
Definition:
hdrcont.cxx:1096
ScHeaderControl::GetEntryText
virtual OUString GetEntryText(SCCOLROW nEntryNo) const =0
ScHeaderControl::bMarkRange
bool bMarkRange
Definition:
hdrcont.hxx:55
ScHeaderControl::aNormFont
vcl::Font aNormFont
Definition:
hdrcont.hxx:39
ScHeaderControl::StopMarking
void StopMarking()
Definition:
hdrcont.cxx:984
ScHeaderControl::bBoldSet
bool bBoldSet
Definition:
hdrcont.hxx:42
ScHeaderControl::GetScrPos
tools::Long GetScrPos(SCCOLROW nEntryNo) const
Definition:
hdrcont.cxx:189
ScHeaderControl::GetMousePos
SCCOLROW GetMousePos(const Point &rPos, bool &rBorder) const
Definition:
hdrcont.cxx:628
ScHeaderControl::SetMarking
virtual void SetMarking(bool bSet)
Definition:
hdrcont.cxx:1114
ScTabView
Definition:
tabview.hxx:117
SelectionEngine
Timer
TrackingEvent
tools::Rectangle
vcl::Font
tools::Long
long Long
vcl::Window
timer.hxx
SCCOLROW
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition:
types.hxx:23
window.hxx
Generated on Sun Jul 30 2023 04:29:20 for LibreOffice Module sc (master) by
1.9.3