LibreOffice Module sw (master) 1
|
An horizontal ruler with a control for comment panel visibility for Writer. More...
#include <swruler.hxx>
Public Member Functions | |
SwCommentRuler (SwViewShell *pViewSh, vcl::Window *pParent, SwEditWin *pWin, SvxRulerSupportFlags nRulerFlags, SfxBindings &rBindings, WinBits nWinStyle) | |
virtual | ~SwCommentRuler () override |
virtual void | dispose () override |
virtual void | Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override |
Paint the ruler. More... | |
void | CreateJsonNotification (tools::JsonWriter &rJsonWriter) |
Public Member Functions inherited from SvxRuler | |
SvxRuler (vcl::Window *pParent, vcl::Window *pEditWin, SvxRulerSupportFlags nRulerFlags, SfxBindings &rBindings, WinBits nWinStyle) | |
virtual | ~SvxRuler () override |
virtual void | dispose () override |
void | SetDefTabDist (tools::Long) |
void | SetNullOffsetLogic (tools::Long lOff) |
void | SetActive (bool bOn=true) |
void | ForceUpdate () |
void | SetTabsRelativeToIndent (bool bRel) |
void | SetValues (RulerChangeType type, tools::Long value) |
tools::Long | GetPageWidth () const |
Private Member Functions | |
void | NotifyKit () |
virtual void | MouseButtonDown (const MouseEvent &rMEvt) override |
Callback function to handle a mouse button down event. More... | |
virtual void | MouseMove (const MouseEvent &rMEvt) override |
Callback function to handle a mouse move event. More... | |
virtual void | Command (const CommandEvent &rCEvt) override |
Callback function to handle a context menu call (mouse right button click). More... | |
virtual void | Update () override |
Update the view. More... | |
tools::Rectangle | GetCommentControlRegion () |
Get the rectangle area that should be used to draw the comment control. More... | |
void | DrawCommentControl (vcl::RenderContext &rRenderContext) |
Paint the comment control on VirtualDevice. More... | |
void | UpdateCommentHelpText () |
Update the tooltip text. More... | |
Color | GetFadedColor (const Color &rHighColor, const Color &rLowColor) |
Get the proper color between two options, according to current status. More... | |
DECL_LINK (FadeHandler, Timer *, void) | |
Fade timer callback. More... | |
Private Attributes | |
SwViewShell * | mpViewShell |
VclPtr< SwEditWin > | mpSwWin |
bool | mbIsHighlighted |
Timer | maFadeTimer |
int | mnFadeRate |
ScopedVclPtr< VirtualDevice > | maVirDev |
Additional Inherited Members | |
Protected Member Functions inherited from SvxRuler | |
virtual void | Command (const CommandEvent &rCEvt) override |
virtual void | Click () override |
virtual bool | StartDrag () override |
virtual void | Drag () override |
virtual void | EndDrag () override |
virtual void | ExtraDown () override |
virtual void | MouseMove (const MouseEvent &rMEvt) override |
virtual void | Notify (SfxBroadcaster &rBC, const SfxHint &rHint) override |
virtual void | Update () |
bool | IsActLastColumn (bool bForceDontConsiderHidden=false, sal_uInt16 nAct=USHRT_MAX) const |
bool | IsActFirstColumn (bool bForceDontConsiderHidden=false, sal_uInt16 nAct=USHRT_MAX) const |
sal_uInt16 | GetActLeftColumn (bool bForceDontConsiderHidden=false, sal_uInt16 nAct=USHRT_MAX) const |
sal_uInt16 | GetActRightColumn (bool bForceDontConsiderHidden=false, sal_uInt16 nAct=USHRT_MAX) const |
tools::Long | CalcPropMaxRight (sal_uInt16 nCol=USHRT_MAX) const |
An horizontal ruler with a control for comment panel visibility for Writer.
The comment control only appears when the document has comments already.
Definition at line 28 of file swruler.hxx.
SwCommentRuler::SwCommentRuler | ( | SwViewShell * | pViewSh, |
vcl::Window * | pParent, | ||
SwEditWin * | pWin, | ||
SvxRulerSupportFlags | nRulerFlags, | ||
SfxBindings & | rBindings, | ||
WinBits | nWinStyle | ||
) |
Definition at line 80 of file swruler.cxx.
References vcl::Font::GetFontHeight(), LINK, maFadeTimer, maVirDev, vcl::Font::SetFontHeight(), Timer::SetInvokeHandler(), Timer::SetTimeout(), and WB_HSCROLL.
|
overridevirtual |
Definition at line 101 of file swruler.cxx.
|
overrideprivatevirtual |
Callback function to handle a context menu call (mouse right button click).
When on comment control, it does not do anything.
Reimplemented from SvxRuler.
Definition at line 191 of file swruler.cxx.
References SvxRuler::Command(), GetCommentControlRegion(), CommandEvent::GetMousePosPixel(), SwViewShell::GetPostItMgr(), SwPostItMgr::HasNotes(), and mpViewShell.
void SwCommentRuler::CreateJsonNotification | ( | tools::JsonWriter & | rJsonWriter | ) |
Definition at line 236 of file swruler.cxx.
References RulerUnitData::aUnitStr, convertTwipToMm100(), SvxRuler::GetPageWidth(), tools::JsonWriter::put(), and tools::JsonWriter::startNode().
Referenced by NotifyKit().
|
private |
Fade timer callback.
|
overridevirtual |
Reimplemented from SvxRuler.
Definition at line 103 of file swruler.cxx.
References VclPtr< class reference_type >::clear(), SvxRuler::dispose(), and mpSwWin.
|
private |
Paint the comment control on VirtualDevice.
Definition at line 121 of file swruler.cxx.
References aLabel, CONTROL_BORDER_WIDTH, OutputDevice::DrawOutDev(), StyleSettings::GetButtonTextColor(), GetCommentControlRegion(), StyleSettings::GetDialogColor(), GetFadedColor(), tools::Rectangle::GetHeight(), StyleSettings::GetHighlightColor(), StyleSettings::GetHighlightTextColor(), AllSettings::GetLayoutRTL(), SwViewShell::GetPostItMgr(), OutputDevice::GetSettings(), StyleSettings::GetShadowColor(), tools::Rectangle::GetSize(), AllSettings::GetStyleSettings(), tools::Rectangle::GetWidth(), StyleSettings::GetWorkspaceColor(), maVirDev, mbIsHighlighted, mpViewShell, Point::setX(), SwPostItMgr::ShowNotes(), SwResId(), tools::Rectangle::TopLeft(), Point::X(), and Point::Y().
Referenced by Paint().
|
private |
Get the rectangle area that should be used to draw the comment control.
It is horizontally aligned to the SideBar panel.
Definition at line 312 of file swruler.cxx.
References SvxRuler::GetPageWidth(), SwViewShell::GetPostItMgr(), SwPostItMgr::GetSidebarBorderWidth(), SwPostItMgr::GetSidebarWidth(), mpSwWin, and mpViewShell.
Referenced by Command(), DrawCommentControl(), MouseButtonDown(), MouseMove(), and Update().
Get the proper color between two options, according to current status.
The return color can be one of the given colors, or a merged one. It depends on highlight fading status.
rHighColor | color used to highlight status |
rLowColor | color used to normal status |
Definition at line 341 of file swruler.cxx.
References Task::IsActive(), maFadeTimer, mbIsHighlighted, Color::Merge(), and mnFadeRate.
Referenced by DrawCommentControl().
|
overrideprivatevirtual |
Callback function to handle a mouse button down event.
When on comment control, it toggles the comment panel visibility.
Definition at line 216 of file swruler.cxx.
References SwView::ExecViewOptions(), GetCommentControlRegion(), MouseEvent::GetPosPixel(), SfxViewShell::GetViewFrame(), MouseEvent::IsLeft(), mpSwWin, and UpdateCommentHelpText().
|
overrideprivatevirtual |
Callback function to handle a mouse move event.
When on comment control, it let the control responsive by highlighting.
Reimplemented from SvxRuler.
Definition at line 200 of file swruler.cxx.
References tools::Rectangle::Contains(), GetCommentControlRegion(), MouseEvent::GetPosPixel(), SwViewShell::GetPostItMgr(), SwPostItMgr::HasNotes(), maFadeTimer, mbIsHighlighted, SvxRuler::MouseMove(), mpViewShell, Timer::Start(), and UpdateCommentHelpText().
|
private |
Definition at line 280 of file swruler.cxx.
References CreateJsonNotification(), tools::JsonWriter::finishAndGetAsOString(), SwViewShell::GetSfxViewShell(), comphelper::LibreOfficeKit::isActive(), SfxViewShell::libreOfficeKitViewCallback(), and mpViewShell.
Referenced by Update().
|
overridevirtual |
Paint the ruler.
rRect | ignored |
Definition at line 109 of file swruler.cxx.
References DrawCommentControl(), SwViewShell::GetPostItMgr(), SwPostItMgr::HasNotes(), comphelper::LibreOfficeKit::isActive(), and mpViewShell.
|
overrideprivatevirtual |
Update the view.
Update the ruler appearance according to the document view and current cursor position.
Reimplemented from SvxRuler.
Definition at line 292 of file swruler.cxx.
References GetCommentControlRegion(), NotifyKit(), and SvxRuler::Update().
|
private |
Update the tooltip text.
Definition at line 301 of file swruler.cxx.
References SwViewShell::GetPostItMgr(), mpViewShell, SwPostItMgr::ShowNotes(), and SwResId().
Referenced by MouseButtonDown(), and MouseMove().
|
private |
Definition at line 52 of file swruler.hxx.
Referenced by GetFadedColor(), MouseMove(), and SwCommentRuler().
|
private |
Definition at line 54 of file swruler.hxx.
Referenced by DrawCommentControl(), and SwCommentRuler().
|
private |
Definition at line 51 of file swruler.hxx.
Referenced by DrawCommentControl(), GetFadedColor(), and MouseMove().
|
private |
Definition at line 53 of file swruler.hxx.
Referenced by GetFadedColor().
Definition at line 50 of file swruler.hxx.
Referenced by dispose(), GetCommentControlRegion(), and MouseButtonDown().
|
private |
Definition at line 49 of file swruler.hxx.
Referenced by Command(), DrawCommentControl(), GetCommentControlRegion(), MouseMove(), NotifyKit(), Paint(), and UpdateCommentHelpText().