LibreOffice Module sw (master)
1
sw
source
uibase
inc
swruler.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
10
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWRULER_HXX
11
#define INCLUDED_SW_SOURCE_UIBASE_INC_SWRULER_HXX
12
13
#include <
svx/ruler.hxx
>
14
#include <
vcl/timer.hxx
>
15
#include <
vcl/virdev.hxx
>
16
17
class
SwViewShell
;
18
class
View
;
19
namespace
vcl
{
class
Window
; }
20
class
SwEditWin
;
21
namespace
tools
{
class
JsonWriter; }
22
28
class
SwCommentRuler
final :
public
SvxRuler
29
{
30
public
:
31
SwCommentRuler
(
32
SwViewShell
* pViewSh,
33
vcl::Window
* pParent,
34
SwEditWin
* pWin,
35
SvxRulerSupportFlags
nRulerFlags,
36
SfxBindings
& rBindings,
37
WinBits
nWinStyle);
38
virtual
~SwCommentRuler
()
override
;
39
virtual
void
dispose
()
override
;
40
45
virtual
void
Paint
(
vcl::RenderContext
& rRenderContext,
const
tools::Rectangle
& rRect )
override
;
46
void
CreateJsonNotification
(
tools::JsonWriter
& rJsonWriter);
47
48
private
:
49
SwViewShell
*
mpViewShell
;
//< Shell to check if there is any comments on doc and their visibility
50
VclPtr<SwEditWin>
mpSwWin
;
//< Used to get SwView to change the SideBar visibility
51
bool
mbIsHighlighted
;
//< If comment control is highlighted (mouse is over it)
52
Timer
maFadeTimer
;
//< Timer for high/'low'light fading
53
int
mnFadeRate
;
//< From 0 to 100. 0 means not highlighted.
54
ScopedVclPtr<VirtualDevice>
maVirDev
;
//< VirtualDevice of this window. Just for convenience.
55
56
void
NotifyKit
();
62
virtual
void
MouseButtonDown
(
const
MouseEvent
& rMEvt )
override
;
68
virtual
void
MouseMove
(
const
MouseEvent
& rMEvt)
override
;
74
virtual
void
Command
(
const
CommandEvent
& rCEvt )
override
;
81
virtual
void
Update
()
override
;
82
89
tools::Rectangle
GetCommentControlRegion
();
90
94
void
DrawCommentControl
(
vcl::RenderContext
& rRenderContext);
95
99
void
UpdateCommentHelpText
();
100
111
Color
GetFadedColor
(
const
Color
&rHighColor,
const
Color
&rLowColor);
112
114
DECL_LINK
(FadeHandler,
Timer
*,
void
);
115
};
116
117
#endif
118
119
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Color
CommandEvent
MouseEvent
OutputDevice
ScopedVclPtr< VirtualDevice >
SfxBindings
SvxRuler
SwCommentRuler
An horizontal ruler with a control for comment panel visibility for Writer.
Definition:
swruler.hxx:29
SwCommentRuler::UpdateCommentHelpText
void UpdateCommentHelpText()
Update the tooltip text.
Definition:
swruler.cxx:301
SwCommentRuler::MouseButtonDown
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Callback function to handle a mouse button down event.
Definition:
swruler.cxx:216
SwCommentRuler::Update
virtual void Update() override
Update the view.
Definition:
swruler.cxx:292
SwCommentRuler::Paint
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Paint the ruler.
Definition:
swruler.cxx:109
SwCommentRuler::mpViewShell
SwViewShell * mpViewShell
Definition:
swruler.hxx:49
SwCommentRuler::DECL_LINK
DECL_LINK(FadeHandler, Timer *, void)
Fade timer callback.
SwCommentRuler::mnFadeRate
int mnFadeRate
Definition:
swruler.hxx:53
SwCommentRuler::MouseMove
virtual void MouseMove(const MouseEvent &rMEvt) override
Callback function to handle a mouse move event.
Definition:
swruler.cxx:200
SwCommentRuler::Command
virtual void Command(const CommandEvent &rCEvt) override
Callback function to handle a context menu call (mouse right button click).
Definition:
swruler.cxx:191
SwCommentRuler::mbIsHighlighted
bool mbIsHighlighted
Definition:
swruler.hxx:51
SwCommentRuler::mpSwWin
VclPtr< SwEditWin > mpSwWin
Definition:
swruler.hxx:50
SwCommentRuler::CreateJsonNotification
void CreateJsonNotification(tools::JsonWriter &rJsonWriter)
Definition:
swruler.cxx:236
SwCommentRuler::DrawCommentControl
void DrawCommentControl(vcl::RenderContext &rRenderContext)
Paint the comment control on VirtualDevice.
Definition:
swruler.cxx:121
SwCommentRuler::maFadeTimer
Timer maFadeTimer
Definition:
swruler.hxx:52
SwCommentRuler::maVirDev
ScopedVclPtr< VirtualDevice > maVirDev
Definition:
swruler.hxx:54
SwCommentRuler::NotifyKit
void NotifyKit()
Definition:
swruler.cxx:280
SwCommentRuler::~SwCommentRuler
virtual ~SwCommentRuler() override
Definition:
swruler.cxx:101
SwCommentRuler::dispose
virtual void dispose() override
Definition:
swruler.cxx:103
SwCommentRuler::GetCommentControlRegion
tools::Rectangle GetCommentControlRegion()
Get the rectangle area that should be used to draw the comment control.
Definition:
swruler.cxx:312
SwCommentRuler::GetFadedColor
Color GetFadedColor(const Color &rHighColor, const Color &rLowColor)
Get the proper color between two options, according to current status.
Definition:
swruler.cxx:341
SwCommentRuler::SwCommentRuler
SwCommentRuler(SwViewShell *pViewSh, vcl::Window *pParent, SwEditWin *pWin, SvxRulerSupportFlags nRulerFlags, SfxBindings &rBindings, WinBits nWinStyle)
Definition:
swruler.cxx:80
SwEditWin
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition:
edtwin.hxx:61
SwViewShell
Definition:
viewsh.hxx:110
Timer
VclPtr< SwEditWin >
tools::JsonWriter
tools::Rectangle
SfxGroupId::View
@ View
tools
vcl
ruler.hxx
SvxRulerSupportFlags
SvxRulerSupportFlags
vcl::Window
timer.hxx
EViewType::Window
@ Window
virdev.hxx
WinBits
sal_Int64 WinBits
Generated on Sun Jul 30 2023 04:29:56 for LibreOffice Module sw (master) by
1.9.3