bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / swruler.hxx
blob9e59ae16c02aa1dce5def895c5b6e6e71231875f
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/.
8 */
10 #ifndef SW_COMMENT_RULER_HXX
11 #define SW_COMMENT_RULER_HXX
13 #include <svx/ruler.hxx>
15 class ViewShell;
16 class View;
17 class Window;
18 class SwEditWin;
20 /**
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.
25 class SwCommentRuler
26 : public SvxRuler
28 public:
29 SwCommentRuler (
30 ViewShell* pViewSh,
31 Window* pParent,
32 SwEditWin* pWin,
33 sal_uInt16 nRulerFlags,
34 SfxBindings& rBindings,
35 WinBits nWinStyle);
36 virtual ~SwCommentRuler ();
38 /**
39 * Paint the ruler.
40 * \param rRect ignored
42 virtual void Paint( const Rectangle& rRect );
44 protected:
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.
50 /**
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 );
56 /**
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);
62 /**
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 );
68 /**
69 * Update the view.
71 * Update the ruler appearance according to the document view and
72 * current cursor position.
74 virtual void Update();
76 /**
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();
84 /**
85 * Paint the comment control on VirtualDevice.
87 void DrawCommentControl();
88 /**
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);
97 /**
98 * Update the tooltip text.
100 void UpdateCommentHelpText();
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */