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/.
10 #ifndef SW_COMMENT_RULER_HXX
11 #define SW_COMMENT_RULER_HXX
13 #include <svx/ruler.hxx>
21 * An horizontal ruler with a control for comment panel visibility fo Writer.
23 * The comment control only appears when the document has comments already.
33 sal_uInt16 nRulerFlags
,
34 SfxBindings
& rBindings
,
36 virtual ~SwCommentRuler ();
40 * \param rRect ignored
42 virtual void Paint( const Rectangle
& rRect
);
45 ViewShell
* mpViewShell
; //< Shell to check if there is any comments on doc and their visibility
46 SwEditWin
* mpSwWin
; //< Used to get SwView to change the SideBar visibility
47 bool mbIsHighlighted
; //< If comment control is highlighted (mouse is over it)
48 VirtualDevice maVirDev
; //< VirtualDevice of this window. Just for convenience.
51 * Callback function to handle a mouse button down event.
53 * When on comment control, it toggles the comment panel visibility.
55 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
57 * Callback function to handle a mouse move event.
59 * When on comment control, it let the control responsive by highlighting.
61 virtual void MouseMove(const MouseEvent
& rMEvt
);
63 * Callback function to handle a context menu call (mouse right button click).
65 * When on comment control, it does not do anything.
67 virtual void Command( const CommandEvent
& rCEvt
);
71 * Update the ruler appearance according to the document view and
72 * current cursor position.
74 virtual void Update();
77 * Get the rectangle area that should be used to draw the comment control.
79 * It is horizontally aligned to the SideBar panel.
80 * \param Rectangle The area where the comment control is.
82 Rectangle
GetCommentControlRegion();
85 * Paint the comment control on VirtualDevice.
87 void DrawCommentControl();
89 * Draw a little horizontal arrow tip on VirtualDevice.
90 * \param nX left coordinate of arrow
91 * \param nY top coordinate of arrow
92 * \param Color arrow color
93 * \param bPointRight if arrow should point to right. Otherwise, it will point left.
95 void ImplDrawArrow(long nX
, long nY
, const Color
& rColor
, bool bPointRight
);
98 * Update the tooltip text.
100 void UpdateCommentHelpText();
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */