LibreOffice Module sw (master)  1
OutlineContentVisibilityWin.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 #pragma once
10 
12 #include "edtwin.hxx"
13 #include "FrameControl.hxx"
14 
15 enum class ButtonSymbol
16 {
17  SHOW,
18  HIDE,
19  NONE
20 };
21 
23 {
24 private:
25  std::unique_ptr<weld::Button> m_xShowBtn;
26  std::unique_ptr<weld::Button> m_xHideBtn;
27 
29  const SwFrame* m_pFrame;
33  size_t m_nOutlinePos;
34 
35  void ToggleOutlineContentVisibility(const bool bSubs);
36 
37 public:
38  SwOutlineContentVisibilityWin(SwEditWin* pEditWin, const SwFrame* pFrame);
39  virtual ~SwOutlineContentVisibilityWin() override { disposeOnce(); }
40  virtual void dispose() override;
41 
42  virtual void ShowAll(bool bShow) override;
43  virtual bool Contains(const Point& rDocPt) const override;
44  virtual void SetReadonly(bool /*bReadonly*/) override {}
45  virtual bool IsFocused() const override { return ControlHasFocus(); }
46  virtual const SwFrame* GetFrame() override { return m_pFrame; }
47  virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
48 
49  void Set();
50 
51  void SetSymbol(ButtonSymbol eTyle);
52  ButtonSymbol GetSymbol() const;
53 
54 private:
55  DECL_LINK(DelayAppearHandler, Timer*, void);
56  DECL_LINK(MousePressHdl, const MouseEvent&, bool);
57  DECL_LINK(MouseMoveHdl, const MouseEvent&, bool);
58 };
59 
60 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:298
std::unique_ptr< weld::Button > m_xHideBtn
virtual bool Contains(const Point &rDocPt) const override
Returns true if the point is inside the control.
virtual SwEditWin * GetEditWin() override
bool ControlHasFocus() const
virtual const SwFrame * GetFrame() override
int m_nDelayAppearing
Before we show the control, wait a few timer ticks to avoid appearing with every mouse over...
std::unique_ptr< weld::Button > m_xShowBtn
Abstract interface to be implemented by writer FrameControls.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
virtual void SetReadonly(bool) override
void ToggleOutlineContentVisibility(const bool bSubs)
virtual bool IsFocused() const override
 Returns true if the control has focus.
virtual void ShowAll(bool bShow) override
DECL_LINK(DelayAppearHandler, Timer *, void)
SwOutlineContentVisibilityWin(SwEditWin *pEditWin, const SwFrame *pFrame)